ABAP顾问
分类:
2007-06-07 21:56:18
*&---------------------------------------------------------------------*
*& Report Z_BARRY_PARAMETERS *
*& *
*&---------------------------------------------------------------------*
*& *
*&---------------------------------------------------------------------*
REPORT z_barry_parameters .
TABLES tcurt.
DATA dyfields LIKE dynpread OCCURS 1 WITH HEADER LINE.
PARAMETERS: p_waers LIKE tcurt-waers,
p_ltext LIKE tcurt-ltext,
p_ktext LIKE tcurt-ktext.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_waers.
CLEAR: dyfields[], dyfields.
CALL FUNCTION 'HELP_VALUES_GET'
EXPORTING
fieldname = 'WAERS'
tabname = 'TCURT'
IMPORTING
select_value = p_waers.
SELECT SINGLE ltext FROM tcurt
INTO dyfields-fieldvalue
WHERE spras = sy-langu
AND waers = p_waers.
IF sy-subrc <> 0.
CLEAR dyfields-fieldvalue.
ENDIF.
dyfields-fieldname = 'P_LTEXT'.
APPEND dyfields.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = sy-cprog
dynumb = sy-dynnr
TABLES
dynpfields = dyfields.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_ktext.
CLEAR: dyfields[], dyfields.
dyfields-fieldname = 'P_WAERS'.
APPEND dyfields.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = sy-cprog
dynumb = sy-dynnr
TABLES
dynpfields = dyfields.
READ TABLE dyfields INDEX 1.
SELECT SINGLE ktext FROM tcurt
INTO p_ktext
WHERE spras EQ sy-langu
AND waers EQ dyfields-fieldvalue.