"方法调用:参数'P'代表 PARAMETERS
'S' 代表SELECT-OPTION
PERFORM sub_set_text USING 'P' '屏幕字段名称' '显示文本'. "
*& 更新选择屏幕的按钮文本
*&---------------------------------------------------------------------*
*& --> p1 text
*& <-- p2 text
*&---------------------------------------------------------------------*
FORM sub_set_text USING lv_kind TYPE char1
lv_field TYPE char30
lv_text TYPE char30.
DATA lt_seltext TYPE rsseltexts OCCURS 1 WITH HEADER LINE.
DATA:gv_repid TYPE sy-repid.
CHECK lv_text IS NOT INITIAL.
REFRESH lt_seltext.
lt_seltext-name = lv_field.
lt_seltext-kind = lv_kind.
lt_seltext-TEXT = lv_text.
APPEND lt_seltext.
gv_repid = sy-repid.
CALL FUNCTION 'SELECTION_TEXTS_MODIFY'
EXPORTING
PROGRAM = gv_repid
TABLES
seltexts = lt_seltext
EXCEPTIONS
program_not_found = 1
program_cannot_be_generated = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " SUB_SET_TEXT