ABAP大虾,请问如何读取屏幕字段的值
1个回答
展开全部
用函数DYNP_VALUES_READ
举个例子。
I_USER,I_CODE是屏幕的字段名
"屏幕字段值
DATA: gt_dynpfields TYPE STANDARD TABLE OF dynpread.
"获取屏幕字段
CLEAR: gt_dynpfields,gw_dynpfields.
gw_dynpfields-fieldname = 'I_USER'.
APPEND gw_dynpfields TO gt_dynpfields.
gw_dynpfields-fieldname = 'I_CODE'.
APPEND gw_dynpfields TO gt_dynpfields.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = sy-repid
dynumb = sy-dynnr
translate_to_upper = 'X'
TABLES
dynpfields = gt_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.
举个例子。
I_USER,I_CODE是屏幕的字段名
"屏幕字段值
DATA: gt_dynpfields TYPE STANDARD TABLE OF dynpread.
"获取屏幕字段
CLEAR: gt_dynpfields,gw_dynpfields.
gw_dynpfields-fieldname = 'I_USER'.
APPEND gw_dynpfields TO gt_dynpfields.
gw_dynpfields-fieldname = 'I_CODE'.
APPEND gw_dynpfields TO gt_dynpfields.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = sy-repid
dynumb = sy-dynnr
translate_to_upper = 'X'
TABLES
dynpfields = gt_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.
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询