‎2009 Jan 02 7:28 AM
Hi,
My requirement is to copy the values of a field from one subscreen to the other when changing the tabs.
For example, in PO transaction, when one switches from a tab to another, value from a particular field should be copied into a specified filed.
I have tried with using get parameter in the PBO of the second subscreen, but that parameter id is not set in the PAI of the first subscreen.
It is not possible to modify the first subscreen logic.
Please suggest a relevant solution.
Thanx.
‎2009 Jan 02 7:30 AM
hi,
Use the Fm DYNP_VALUES_READ to get the screen values.
call function 'DYNP_VALUES_READ'
exporting
dyname = d020s-prog
dynumb = d020s-dnum
translate_to_upper = 'X'
* REQUEST = ' '
tables
dynpfields = t_dynpread.Edited by: avinash kodarapu on Jan 2, 2009 1:01 PM
‎2009 Jan 02 7:30 AM
hi,
Use the Fm DYNP_VALUES_READ to get the screen values.
call function 'DYNP_VALUES_READ'
exporting
dyname = d020s-prog
dynumb = d020s-dnum
translate_to_upper = 'X'
* REQUEST = ' '
tables
dynpfields = t_dynpread.Edited by: avinash kodarapu on Jan 2, 2009 1:01 PM
‎2009 Jan 02 10:10 AM
Hi Abhinav,
To read the value from a screen field, use code, its working:-
DATA : tb_dynpfields LIKE dynpread OCCURS 0 WITH HEADER LINE, "for reading screen value
spey TYPE yapn-spey. "variable to store screen field value
CLEAR: tb_dynpfields.
REFRESH: tb_dynpfields.
MOVE 'YAPN-SPEY' TO tb_dynpfields-fieldname. "YAPN-SPEY is screen field name
APPEND tb_dynpfields.
CALL FUNCTION 'DYNP_VALUES_READ' "to read screen field values
EXPORTING
dyname = 'Z_F1F4' "program name
dynumb = '1010' "screen id
* TRANSLATE_TO_UPPER = ' '
* REQUEST = ' '
* PERFORM_CONVERSION_EXITS = ' '
* PERFORM_INPUT_CONVERSION = ' '
* DETERMINE_LOOP_INDEX = ' '
* START_SEARCH_IN_CURRENT_SCREEN = ' '
* START_SEARCH_IN_MAIN_SCREEN = ' '
* START_SEARCH_IN_STACKED_SCREEN = ' '
* START_SEARCH_ON_SCR_STACKPOS = ' '
* SEARCH_OWN_SUBSCREENS_FIRST = ' '
* SEARCHPATH_OF_SUBSCREEN_AREAS = ' '
TABLES
dynpfields = tb_dynpfields "internal table with screen field value
EXCEPTIONS
INVALID_ABAPWORKAREA = 1
INVALID_DYNPROFIELD = 2
INVALID_DYNPRONAME = 3
INVALID_DYNPRONUMMER = 4
INVALID_REQUEST = 5
NO_FIELDDESCRIPTION = 6
INVALID_PARAMETER = 7
UNDEFIND_ERROR = 8
DOUBLE_CONVERSION = 9
STEPL_NOT_FOUND = 10
OTHERS = 11.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
READ TABLE tb_dynpfields INDEX 1.
IF sy-subrc EQ 0.
spey = tb_dynpfields-fieldvalue. "assign screen field value to a variable
ELSE.
spey = ' '.
ENDIF.
Hope this solves your problem.
Thanks & Regards,
Tarun Gambhir