2009 Mar 03 8:30 AM
Hi all,
I have two parameters on my selection screen, i am taking the value of first parameter from F4 help and now i want to populate the value dynamically in second parameter depending upon the value selected by the user in first parameter.
i am using the following code.
at selection-screen on value request p_first.
call the FM to get F4 help.
loop at screen.
if screen-name = P_SECOND.
p_scond = desired value.
modify screen.
endif.
endloop.
but this is not working.
Please let me know how to achieve this.
Thanks in adv.
2009 Mar 03 9:36 AM
Hi Sheelesh,
You can use the following code to achieve your goal :
TABLES : d020s.
* Name of the program from which the function module is called
DATA: dyname LIKE d020s-prog VALUE 'TESTPROG',
* Number of the screen, from which the call was made. sy-dynnr can be set here
dynumb LIKE d020s-dnum VALUE '100'.
DATA: BEGIN OF dynpfields OCCURS 3.
INCLUDE STRUCTURE dynpread.
DATA: END OF dynpfields.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_kunnr.
* Place the code to populate contents for your F4 Value field here.
<...>
* Populate all the fields for which you want default
* value along with the value in dynpfields internal table.
* Move the screen fileld name in fieldname column.
MOVE 'G_NAME' TO dynpfields-fieldname.
* Move the field value in fieldvalue column.
MOVE 'Testtable' TO dynpfields-fieldvalue.
APPEND dynpfields.
* You can append more screen field names and there values in this internal table.
* Call this FM.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = dyname
dynumb = dynumb
TABLES
dynpfields = dynpfields
EXCEPTIONS
invalid_abapworkarea = 01
invalid_dynprofield = 02
invalid_dynproname = 03
invalid_dynpronummer = 04
invalid_request = 05
no_fielddescription = 06
undefind_error = 07.
This function module should be used in the user-programmed help if one or more screen fields are to be given selected values, e.g. if the values are to be reset after calling HELP_VALUES_GET_WITH_TABLE_EXT. automatic value reset, as performed e.g. by the function module HELP_VALUES_GET_EXTEND, can also be overwritten.
You can use this function module to reset selected help processor field contents in the corresponding screen fields w/o caling PBO.
Screen field contents are read by the function module DYNP_VALUES_READ.
Thanks
Ashwani
Hi all,
I have two parameters on my selection screen, i am taking the value of first parameter from F4 help and now i want to populate the value dynamically in second parameter depending upon the value selected by the user in first parameter.
i am using the following code.
at selection-screen on value request p_first.
call the FM to get F4 help.
loop at screen.
if screen-name = P_SECOND.
p_scond = desired value.
modify screen.
endif.
endloop.
but this is not working.
Please let me know how to achieve this.
Thanks in adv.
2009 Mar 03 8:43 AM
To set the value in your dynpro use this FM:
DYNP_VALUES_UPDATE.
Give me some point if you found usefull my answer.
Thanks.
2009 Mar 03 8:45 AM
Hi,
use
AT SELECTION-SCREEN.
loop at screen.
if screen-name = P_SECOND.
p_scond = desired value.
modify screen.
endif.
endloop.
Regards
Akshay
2009 Mar 03 9:36 AM
Hi Sheelesh,
You can use the following code to achieve your goal :
TABLES : d020s.
* Name of the program from which the function module is called
DATA: dyname LIKE d020s-prog VALUE 'TESTPROG',
* Number of the screen, from which the call was made. sy-dynnr can be set here
dynumb LIKE d020s-dnum VALUE '100'.
DATA: BEGIN OF dynpfields OCCURS 3.
INCLUDE STRUCTURE dynpread.
DATA: END OF dynpfields.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_kunnr.
* Place the code to populate contents for your F4 Value field here.
<...>
* Populate all the fields for which you want default
* value along with the value in dynpfields internal table.
* Move the screen fileld name in fieldname column.
MOVE 'G_NAME' TO dynpfields-fieldname.
* Move the field value in fieldvalue column.
MOVE 'Testtable' TO dynpfields-fieldvalue.
APPEND dynpfields.
* You can append more screen field names and there values in this internal table.
* Call this FM.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = dyname
dynumb = dynumb
TABLES
dynpfields = dynpfields
EXCEPTIONS
invalid_abapworkarea = 01
invalid_dynprofield = 02
invalid_dynproname = 03
invalid_dynpronummer = 04
invalid_request = 05
no_fielddescription = 06
undefind_error = 07.
This function module should be used in the user-programmed help if one or more screen fields are to be given selected values, e.g. if the values are to be reset after calling HELP_VALUES_GET_WITH_TABLE_EXT. automatic value reset, as performed e.g. by the function module HELP_VALUES_GET_EXTEND, can also be overwritten.
You can use this function module to reset selected help processor field contents in the corresponding screen fields w/o caling PBO.
Screen field contents are read by the function module DYNP_VALUES_READ.
Thanks
Ashwani
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |