brunch

You can make anything
by writing

C.S.Lewis

by 동네아밥 Jul 08. 2021

텍스트심볼 (TEXT-000) 검색

이거 없었으면 프로그램 400여 개 일일이 뒤질뻔.. 진짜 뒤질뻔

TABLES: RS38M.
 
 DATA : BEGIN OF ITAB OCCURS 0,
          NAME TYPE PROGNAME.
         INCLUDE STRUCTURE TEXTPOOL.
 DATA : END OF ITAB.
 
 DATA : TEXTS  LIKE TEXTPOOL OCCURS 50 WITH HEADER LINE,
        W_TEXT LIKE TEXTPOOL.
 
 DATA : IT          LIKE LINE OF ITAB OCCURS 0,
        LINES       TYPE I,
        MYALV       TYPE REF TO CL_SALV_TABLE,
        MYFUNCTIONS TYPE REF TO CL_SALV_FUNCTIONS_LIST,
        MYCOLUMNS   TYPE REF TO CL_SALV_COLUMNS_TABLE.
 
 SELECTION-SCREEN : BEGIN OF BLOCK B WITH FRAME TITLE TEXT-001.
 
 SELECT-OPTIONS : S_ZPRG  FOR  RS38M-PROGRAMM.
 PARAMETERS:      P_LANGU TYPE SY-LANGU DEFAULT '3'.
 
 SELECTION-SCREEN : END OF BLOCK B.
 
 START-OF-SELECTION.
 
   SELECT PROGNAME AS NAME
     FROM REPOSRC
     INTO CORRESPONDING FIELDS OF TABLE ITAB
     WHERE PROGNAME IN S_ZPRG.
 
   DATA(LV_LINES) = LINES( ITAB ).
   LOOP AT ITAB.
     IF SY-TABIX GT LV_LINES.
       EXIT.
     ENDIF.
     READ TEXTPOOL ITAB-NAME INTO TEXTS LANGUAGE P_LANGU.
     LOOP AT TEXTS INTO W_TEXT . "WHERE id EQ 'I'.
       MOVE-CORRESPONDING W_TEXT TO ITAB.
       APPEND ITAB TO ITAB.
     ENDLOOP.
   ENDLOOP.
 
   IT[] = ITAB[].
 
   TRY.
       CALL METHOD CL_SALV_TABLE=>FACTORY
         IMPORTING
           R_SALV_TABLE = MYALV
         CHANGING
           T_TABLE      = ITAB[].
     CATCH CX_SALV_MSG.
   ENDTRY.
 
   DESCRIBE TABLE ITAB LINES LINES.
   MESSAGE S375(PO) WITH LINES '' 'records found..'.
   MYCOLUMNS = MYALV->GET_COLUMNS( ).
   MYCOLUMNS->SET_OPTIMIZE( ).
   MYFUNCTIONS = MYALV->GET_FUNCTIONS( ).
   MYFUNCTIONS->SET_ALL( ).
   CALL METHOD MYALV->DISPLAY.

작가의 이전글 *_FIELDCATALOG_MERGE 이거 이제 그만좀
브런치는 최신 브라우저에 최적화 되어있습니다. IE chrome safari