Google Search - Blog...........

ABAP - Updating Value Of Another Field On The Selection Screen.

REPORT z_sri_help_value_for_tables .

TABLES tcurt.

DATA dyfields LIKE dynpread OCCURS 1 WITH HEADER LINE.

PARAMETERS: p_waers LIKE tcurt-waers, "Currency
p_ltext LIKE tcurt-ltext, "Long Text
p_ktext LIKE tcurt-ktext. "Short Text

*--- Example of updating value of another field on the screen

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_waers.

CLEAR: dyfields[],
dyfields.

*--- select currency

CALL FUNCTION 'HELP_VALUES_GET'
EXPORTING
fieldname = 'WAERS'
tabname = 'TCURT'
IMPORTING
select_value = p_waers.

*--- get long text for the selected currency

SELECT SINGLE ltext
FROM tcurt
INTO dyfields-fieldvalue
WHERE spras = sy-langu
AND waers = p_waers.

IF sy-subrc <> 0.
CLEAR dyfields-fieldvalue.
ENDIF.

*--- update another field
dyfields-fieldname = 'P_LTEXT'.
APPEND dyfields.

CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = sy-cprog
dynumb = sy-dynnr
TABLES
dynpfields = dyfields.


ALSO READ:

- Complex Selection Screen (Using Macros).

- Printing Selection Screen Data On The Report Output.

- Creating The Listbox Using Macros.

- Restrict Values For The F4 (Value On Request) Help.

- Screen Field Validation Using Chain Endchain.

No comments:

Post a Comment