Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Collect where itab structures are different...

Hi Experts,

I have a problem where by i'm trying to collect identical lines from an internal table.

What ive done in the past is to move the header line one by one and then collectther esults into a itab that has the same stucture as the contents being moved into it.

However, i'm trying to collect identical lines where by i have 4 columns usign the above steps but doesnt seem to be working. Any help would be greatly appreciated.

Thanks - DJ

DATA: BEGIN OF gt_data OCCURS 0,

material(13) TYPE C,

quantity TYPE i,

unique_no(18) TYPE C,

description(40) TYPE c,

END OF gt_data.

DATA: BEGIN OF gt_putput OCCURS 0,

material(13) TYPE C,

quantity TYPE i,

unique_no(18) TYPE C,

description(40) TYPE c,

END OF gt_output.

Tags:
replied

Hi

Try the below code

DATA: BEGIN OF gt_data OCCURS 0,

material(13) TYPE C,

quantity TYPE i,

unique_no(18) TYPE C,

description(40) TYPE c,

END OF gt_data.

DATA: BEGIN OF gt_putput OCCURS 0,

material(13) TYPE C,

quantity TYPE i,

END OF gt_output.

sort gt_data.

loop at gt_data .

gt_putput-material = gt_data-material .

gt_putput-quantity = gt_data-quantity.

collect gt_putput.

endloop.

Let me know, if you need further help

Regards

MD

Edited by: Madhan Doraikannan on Sep 25, 2008 10:18 AM

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question