Program:
REPORT zsm_screen.
DATA: lv_output TYPE char10.
DATA: it_dynpfields TYPE TABLE OF dynpread,
wa_dynpfields TYPE dynpread.
CALL SCREEN 400.
MODULE user_command_0400 INPUT.
IF sy-ucomm = 'F_CALC'.
wa_dynpfields-fieldname = 'LV_ONE'.
APPEND wa_dynpfields TO it_dynpfields.
wa_dynpfields-fieldname = 'LV_TWO'.
APPEND wa_dynpfields TO it_dynpfields.
wa_dynpfields-fieldname = 'LV_OUTPUT'.
APPEND wa_dynpfields TO it_dynpfields.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = sy-cprog
dynumb = sy-dynnr
* 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 = it_dynpfields
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.
* Implement suitable error handling here
ENDIF.
READ TABLE it_dynpfields INTO DATA(wa_one) WITH KEY fieldname = 'LV_ONE'.
READ TABLE it_dynpfields INTO DATA(wa_two) WITH KEY fieldname = 'LV_TWO'.
lv_output = wa_one-fieldvalue + wa_two-fieldvalue.
ENDIF.
ENDMODULE.
Output:
0 Comments