‎2009 Aug 10 11:06 AM
Hi all,
I have a requirement that.... the parameter field should be in display mode and
it has an F4 help and i can select the value from that.
user can not edit the value what ever i selected in F4 help.
i have already tried with this code.. but i can able to select the values from F4 help... but selected values is not listing in the parameter as though it is in display mode....
PARAMETERS: p_file TYPE string MODIF ID GRP.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-group1 = 'GRP'.
screen-active = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
How to achive this... pls help me....
Thanks in advance
Regards
Raja
‎2009 Aug 10 11:16 AM
‎2009 Aug 10 11:11 AM
Hi
How are u managing the F4 help?
U should use the event AT SELECTION-SCREEN ON VALUE-REQUEST
Max
‎2009 Aug 10 11:16 AM
Hi max,
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL METHOD cl_gui_frontend_services=>directory_browse
EXPORTING
initial_folder = lv_folder
CHANGING
selected_folder = p_file
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
not_supported_by_gui = 3
OTHERS = 4.
when i select some folder and click on ok button that selected folder is not setting in the parameter field...
hope you understand the issue....
regards
Raja
‎2009 Aug 10 11:11 AM
Try this for disable mode.
PARAMETERS: p_file TYPE string.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-name = 'P_FILE'.
screen-input = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
‎2009 Aug 10 11:16 AM
‎2009 Aug 10 11:18 AM
Hi all,
I tried with all screen setting paramters
Screen-input
screen-output
screen-active.....etc
but not able to achive it...
regards
Raja
‎2009 Aug 10 11:33 AM
Hi
Try this, it works:
PARAMETERS: P_FILE TYPE STRING MODIF ID GRP LOWER CASE.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'GRP'.
* SCREEN-ACTIVE = '0'.
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
DATA: LV_FOLDER TYPE STRING,
SEL_FOLDER TYPE STRING.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>DIRECTORY_BROWSE
EXPORTING
INITIAL_FOLDER = LV_FOLDER
CHANGING
SELECTED_FOLDER = SEL_FOLDER
EXCEPTIONS
CNTL_ERROR = 1
ERROR_NO_GUI = 2
NOT_SUPPORTED_BY_GUI = 3
OTHERS = 4.
DATA: DYNAME LIKE D020S-PROG,
DYNUMB LIKE D020S-DNUM.
DATA: DYNPFIELDS TYPE TABLE OF DYNPREAD WITH HEADER LINE.
DYNPFIELDS-FIELDNAME = 'P_FILE'.
MOVE SEL_FOLDER TO DYNPFIELDS-FIELDVALUE.
APPEND DYNPFIELDS.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
DYNAME = DYNAME
DYNUMB = DYNUMB
TABLES
DYNPFIELDS = DYNPFIELDS.Max
‎2009 Aug 10 11:45 AM
‎2009 Aug 10 11:21 AM
Once I had the same issue and after struggling with this a lot I realized that this is not possible. If parameter is in read-only mode you will not be able to pick value from input help and return it to you screen field.
I found an alternative solution though:
- create input/ouptun field on screen layout
- select output only mode - you will get a field which doens't have this icon at the end which allows to pick value after F4 is pressed
- just next to this field place a litte button (this will show your input help once you click on this pushbutton - simulation of F4)
- now place your custom coding for this button (either Search help created in Dictionary or using fm F4IF_FIELD_VALUE_REQUEST ) and return picked value directly to this read-only screen field like this
"in PAI
DATA: ret_tab TYPE TABLE OF ddshretval,
wa_ret like line of ret_tab.
if ok_code = 'FC_PUSHBUTTON'. "your pushbutton code
CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
EXPORTING
tabname = 'TRDIR' "example table and field to pick value from
fieldname = 'NAME'
searchhelp = 'ZGLXX_HLP_COL_REPORTS_PMI' "and search help if any exists
TABLES
return_tab = ret_tab
EXCEPTIONS
field_not_found = 1
no_help_for_field = 2
inconsistent_help = 3
no_values_found = 4
OTHERS = 5.
READ TABLE ret_tab into wa_ret INDEX 1.
CHECK sy-subrc = 0.
trdir-name = wa_ret-fieldval. "here TRDIR-NAME is name of read-only field
endif.
Regards
Marcin