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

LOOP question

Former Member
0 Likes
448

Hello,

I have an internal table, like the EKBE table.

I want to create a table with the following format.

For each PO order (EBELN), for easch item (EBELP), for each po category (BEWTP), I want to sum the WRBTR and BPMNG. When the SHKZG is H the WRBTR and BPMNG must be negative for the sum.

The result is that we will have one line per PO's Item.

i attach and a photo of the ekbe table.

thanks.

[http://www.mypicx.com/uploadimg/989252154_05212009_1.bmp]

Edited by: stratos_chm on May 21, 2009 4:36 PM

2 REPLIES 2
Read only

Former Member
0 Likes
418

HI,

The order of the field in the internal table should be 
EBELN 
EBELP
BEWTP
....

SORT ITAB BY EBELN EBELP BEWTP.
LOOP AT ITAB.

IF SHKZG EQ 'H'.
AMOUNT   " SUBTRACTION
ELSE.
AMOUNT " ADDITON
ENDIF.

AT NEW BEWTP.
" you can find the amount for tha one line per PO's Item
 WRITE AMOUNT.

CLEAR AMOUNT 
ENDLOOP.

ENDLOOP.

Read only

Former Member
0 Likes
418

This looks pretty straightforward. Why don't you try coding this yourself and get back to the forum if you have a specific question?

Rob