09-13-2006 2:09 PM
Hi,
I would like to add an existing Search Help on a screen field in Screen painter.
Of course it's possible to just click on th screen field and in the property box, I just have to set the name of teh search help.
The problem is that I need the screen field to be grey and user musn't be able to change the field value if he doens't use the search help.
I'm not allowed to modify the existing search help or to built it on my own from source code, I must use the existing one.
Do you have an idea on how to do so?
Regards,
Morgan
09-13-2006 2:24 PM
Hi Morgan
If I understood you correctly, you want to assign a existing search help to your input enabled field in the screen , and if the user doesnt enter a value or doesn't use F4Help values then you want to grey out, if it is your question ,
Then do like this.
In the PBO of the screen make the field disabled for input and in the PAI provide an option by putting a button beside the screen field where your providing the search help to make it input enabled , thus if the user want to enter a value in it then he will hit the button and will make it edit enabled and enters the value or just he can skip.
PSEUDO CODE
PBO
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 1.
SCREEN-INPUT = 0 .
ENDIF.
ENDLOOP.
PAI.
MODULE EDIT_ENABLED.
..
MODULE EDIT_ENABLED.
IF SY-UCOMM = EDIT_BUTTON.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 1.
SCREEN-INPUT = 1 .
ENDIF.
ENDLOOP.
END MODULE.
Regards,
Raghav
09-13-2006 2:24 PM
Hi Morgan
If I understood you correctly, you want to assign a existing search help to your input enabled field in the screen , and if the user doesnt enter a value or doesn't use F4Help values then you want to grey out, if it is your question ,
Then do like this.
In the PBO of the screen make the field disabled for input and in the PAI provide an option by putting a button beside the screen field where your providing the search help to make it input enabled , thus if the user want to enter a value in it then he will hit the button and will make it edit enabled and enters the value or just he can skip.
PSEUDO CODE
PBO
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 1.
SCREEN-INPUT = 0 .
ENDIF.
ENDLOOP.
PAI.
MODULE EDIT_ENABLED.
..
MODULE EDIT_ENABLED.
IF SY-UCOMM = EDIT_BUTTON.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 1.
SCREEN-INPUT = 1 .
ENDIF.
ENDLOOP.
END MODULE.
Regards,
Raghav
09-13-2006 2:40 PM
Hi Raghav,
it's not really what I want. Your solution provide a way for user to change between a screen field that is grey or not. I want the field to be grey all the time and user to be obliged to use the match code to fill the screen field.
So :
screen field is grey
if user use match code he can change screen field value
if he use keyboard, he can't change screen field value.
That is what I want.
Thanks for your help
Regards,
Morgan
09-13-2006 2:54 PM
Dropdown Box:
In the screen painter for that field goto properties -> Dropdown ->select listbox.
Option 1:
Instead let that field be in change mode and if user enters any wrong entry which is not there in the table give a error messgae.
CHAIN.
FIELD addr1_data-country.
MODULE modify_screenfields1.
ENDCHAIN.
MODULE modify_screenfields1 INPUT.
CASE sy-ucomm.
WHEN 'ENTER' OR 'EXECUTE'.
IF NOT addr1_data-country IS INITIAL.
SELECT SINGLE landx FROM t005t INTO lws_landx WHERE
land1 = addr1_data-country
AND spras = 'EN'.
IF sy-subrc <> 0.
MESSAGE e000(zo_spa) WITH text-022. " Invalid Country code
ELSE.
t005t-landx = lws_landx.
ENDIF.
ELSE.
CLEAR: t005t-landx.
ENDIF.
ENDCASE.
ENDMODULE. " modify_screenfields1 INPUT
Option 2: Other than if u want the way u like, let that field be greyed out. don't attach the search help.
In the PROCESS ON VALUE-REQUEST.
FIELD addr1_data-region MODULE region_pov.
MODULE region_pov INPUT.
Using the F4IF_INT_TABLE_VALUE_REQUEST table value request show the search help.
also make that field input enabled.
ENDMODULE. " region_pov INPUT
I think this will solve ur problem.
Regards,
Prakash.
Message was edited by: Prakash Ramu
09-13-2006 3:13 PM
Thanks but none of your solutiosn can be applied to my problem :
in each of this case, I have to select values on my own.
case 1 : I do a select to check user entry and I don't use the matchcode, it doesn't match the reuqirement
case 2: I replace the existing search help by an internal table that I provide to a module taht transform my internal table in a Search Help.
The probleme is that I MUST NOt select values on my own cause the customer gave me the search help he developed himself. That is the reason why I MUST use the existing search help.
09-13-2006 3:20 PM
Morgan,
No need to bring all the values to the internal table. You can directly use FM <b>'F4IF_FIELD_VALUE_REQUEST'</b> to bring the data directly from search help.
FORM f4_ym CHANGING p_ym.
DATA: li_ret_tab LIKE ddshretval OCCURS 0 WITH HEADER LINE.
CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
EXPORTING
tabname = ' '
fieldname = ' '
searchhelp = 'BU_DATE_CHAR'
TABLES
return_tab = li_ret_tab
EXCEPTIONS
field_not_found = 1
no_help_for_field = 2
inconsistent_help = 3
no_values_found = 4
OTHERS = 5.
IF sy-subrc IS INITIAL.
READ TABLE li_ret_tab INDEX 1.
IF sy-subrc IS INITIAL.
CONCATENATE li_ret_tab-fieldval6(4) li_ret_tab-fieldval3(2)
INTO p_ym.
ENDIF.
ENDIF.
ENDFORM. " f4_ym
Regards,
Prakash.
09-13-2006 4:39 PM
I'm thinking that you will need 3 things.
1.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'ID1'.
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
2. CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
3. CALL FUNCTION 'DYNP_VALUES_UPDATE'
09-13-2006 2:32 PM
Hi Morgan
I guess you should have a Drop down / List box in that case.
Regrads
Srikanth M
09-13-2006 2:49 PM
How to do a drop down list box? Cause I don't see such a component in my sceen painter ...
09-13-2006 2:55 PM
Check this for <a href="http://help.sap.com/saphelp_46c/helpdata/en/9f/dbabe435c111d1829f0000e829fbfe/content.htm">Help</a> for how to use list box.
09-13-2006 3:15 PM
Th probleme with the Drop Down list box is the same than the preceding one. I must do a select to fill the values displayed in drop down list box, that means I can't give directly the existing search help, so, I must build the request on my own ...