DATA: BEGIN OF gt_data OCCURS 0,
emp_name TYPE zemp-emp_name,
END OF gt_data.
DATA: gt_rtntab LIKE ddshretval OCCURS 0 WITH HEADER LINE.
DATA: gt_dynpread LIKE dynpread OCCURS o WITH HEADER LINE.
PARAMETERS : p_emp_no LIKE zemp-emp_no,
p_name LIKE zemp-emp_name.
INITIALIZATION.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_name.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = sy-cprog
dynumb = sy-dynnr
request = 'A'
translate_to_upper = 'X'
TABLES
dynpfields = gt_dynpread.
READ TABLE gt_dynpread WITH KEY fieldname = 'P_EMP_NO'.
SELECT DISTINCT emp_name INTO TABLE gt_data
FROM zemp
WHERE emp_no = gt_dynpread-fieldname.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'P_NAME'
dynpprog = sy-cprog
dynpnr = sy-dynnr
window_title = 'EMP_NAME'
value_org = 'S'
TABLES
value_tab = gt_data
return_tab = gt_rtntab.
READ TABLE gt_rtntab INDEX 1.
p_name = gt_rtntab-fieldval.
利用内表构成输入帮助
于 2022-04-20 18:05:51 首次发布