Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Logic for internal table

Former Member
0 Likes
461

Hi,

I have an internal table with the following structure.

PO Number PO Line Number Quantity ETA

PO_1 001 10 10 Aug 2009

PO_1 002 12 11 Aug 2009

PO_2 001 5 10 Aug 2009

PO_1 001 13 10 Aug 2009

PO_1 001 7 11 Aug 2009

Now I want to sum up quantity based on ETA dates so that the structure will look like as below:

PO Number PO Line Number Quantity ETA

PO_1 001 23 10 Aug 2009

PO_1 001 7 11 Aug 2009

PO_1 002 12 11 Aug 2009

PO_2 001 5 10 Aug 2009

Collect statement will not work as the checking is on date but not on po no and line item.

Regards,

Abhi...

1 ACCEPTED SOLUTION
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
434

use format 092009 and collect

3 REPLIES 3
Read only

Former Member
0 Likes
434

Hi,

If possible create a structure with ponumber poitem date quant and then move corresponding fields to another internal table and use collect

Read only

Former Member
0 Likes
434

Use SUM statement for adding the quantity fields.

Sample code :

LOOP AT T INTO WA_T.

WA_N = WA_T

SUM.

WA_N-QUANTITY = WA_T-QUANTITY.

APPEND WA_N TO ITAB_N.

ENDLOOP.

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
435

use format 092009 and collect