Skip to Content

Append a line to extractor with in user exit

Hi Experts,

Iam trying to append lines to my extractor as per the target table.

example my extract ZDS_STAR has 1 line for the key , where as the target table PLAS has multiple lines and I need a field to be read from PLAS and add as many lines as it has for same key combination from my Extractor. Can some one send me example code for this scenerio.

Z_STAR structure:

Key1 Key2 Key3 PLAS-FIELD keyfig1 keyfig2

PLAS Structure:

Key1 Key2 Key3 PLAS-FIELD1

Key1 Key2 Key3 PLAS-FIELD2

Key1 Key2 Key3 PLAS-FIELD3

expected result of Z_STAR structure:

Key1 Key2 Key3 PLAS-FIELD1 keyfig1 keyfig2

Key1 Key2 Key3 PLAS-FIELD2 keyfig1 keyfig2

Key1 Key2 Key3 PLAS-FIELD3 keyfig1 keyfig2

Thanks

Sam

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Nov 08, 2018 at 02:33 AM

    Hi Sam Kumar ,

    See the exmaple below and hope it's helpful:

    DATA: BEGIN OF ls_PLAS,
    PLAS-FIELD TYPE ...,
    keyfig1 TYPE ...,
    keyfig2 TYPE ...,
    END OF ls_PLAS,
    lt_PLAS LIKE SORTED TABLE OF ls_PLAS.
    lt_STAR[] = c_t_data[].
    SELECT PLAS-FIELD, keyfig1, keyfig2 FROM PLAS
    INTO CORRESPONDING FIELDS OF TABLE lt_PLAS
    FOR ALL ENTRIES IN lt_STAR
    WHERE key1 = lt_STAR-key1
    AND key2 = lt_STAR-key2
    AND key3 = lt_STAR-key3.

    Best regards,
    Maggie

    Add comment
    10|10000 characters needed characters exceeded