cancel
Showing results for 
Search instead for 
Did you mean: 

Append a line to extractor with in user exit

0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

maggie_yi
Advisor
Advisor
0 Kudos

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