READ_TEXT alternative

      TYPES: BEGIN OF ty_stxl,
               tdname TYPE stxl-tdname,
               clustr TYPE stxl-clustr,
               clustd TYPE stxl-clustd,
             END OF ty_stxl.
      DATA:  t_stxl TYPE STANDARD TABLE OF ty_stxl.
      FIELD-SYMBOLS: <stxl> TYPE ty_stxl.
* compressed text data without text name
      TYPES: BEGIN OF ty_stxl_raw,
               clustr TYPE stxl-clustr,
               clustd TYPE stxl-clustd,
             END OF ty_stxl_raw.
      DATA:  t_stxl_raw TYPE STANDARD TABLE OF ty_stxl_raw.
      DATA:  w_stxl_raw TYPE ty_stxl_raw.
* decompressed text
      DATA:  t_tline TYPE STANDARD TABLE OF tline.
      FIELD-SYMBOLS: <tline> TYPE tline.
      DATA: t_stxh TYPE STANDARD TABLE OF stxh,
            w_stxh TYPE stxh.
*      SELECT tdname tdobject tdid
*         FROM stxh
*           INTO CORRESPONDING FIELDS OF TABLE t_stxh.
*AND THEN
* select compressed text lines in blocks of 3000 (adjustable)
      SELECT tdname clustr clustd
              INTO TABLE t_stxl
              FROM stxl
              PACKAGE SIZE 3000
              WHERE relid    = 'TX'          "standard text
                AND tdobject = 'VBBK'
                AND tdname   = gs_vbak-vbeln
        AND tdid     = 'ZE10'
        AND tdspras  = sy-langu.
        LOOP AT t_stxl ASSIGNING <stxl>.
*   decompress text
          CLEAR: t_stxl_raw[], t_tline[].
          w_stxl_raw-clustr = <stxl>-clustr.
          w_stxl_raw-clustd = <stxl>-clustd.
          APPEND w_stxl_raw TO t_stxl_raw.
          IMPORT tline = t_tline FROM INTERNAL TABLE t_stxl_raw.
*  access text lines for further processing
          LOOP AT t_tline ASSIGNING <tline>.
            MOVE <tline>-tdline TO gs_final-port_of_dis.
          ENDLOOP.
        ENDLOOP.
        FREE t_stxl.
      ENDSELECT.
Please support my work

Comments

Popular posts from this blog

Business senario : FB60 AND FB70 validation and subsituation

MB_MIGO_BADI THIS BADI USED TO POSTING DATA IN MIGO

all user exit mv45afzz (implicit user exit )