动态更改选择界面选择文本

文章转自: http://blog.chinaunix.net/uid-8527621-id-2983708.html

REPORT  z_barry_mod_sel_text.
 
TABLES mara.
 
PARAMETER p_test(10).
SELECT-OPTIONS: s_test FOR mara-matnr ,
                s_matnr FOR mara-matnr .
 
*INITIALIZATION.
AT SELECTION-SCREEN OUTPUT.
  PERFORM mod_sel_text USING sy-repid 'P' 'P_TEST' 'P类型测试'.
  PERFORM mod_sel_text USING sy-repid 'S' 'S_TEST' 'S类型测试'.
 
*&---------------------------------------------------------------------*
*&      FORM  MOD_SEL_TEXT
*&---------------------------------------------------------------------*
FORM mod_sel_text USING p_repid kind parameter text .
  DATA sel TYPE rsseltexts OCCURS 1 WITH HEADER LINE.
  REFRESH sel.
  sel-name = parameter.
  sel-kind = kind.
  sel-text   = text.
  APPEND sel.
  CALL FUNCTION 'SELECTION_TEXTS_MODIFY'
    EXPORTING
      program                     = p_repid
    TABLES
      seltexts                    = sel
    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.                    "MOD_SEL_TEXT

你可能感兴趣的:(text,screen)