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

Regarding adding carry forward quantity

Former Member
0 Likes
518

hi Experts,

I have a query like i have to print Report like for example-

date Quan bal(MENGE1)

01/09 2 2

02/09 3 5 This 5 comes when 2 is added with 3.

so, for this my code is,

LOOP AT ITAB .

READ TABLE ITAB INDEX SY-INDEX.

*APPEND ITAB.

ITAB-MENGE1 = ITAB-MENGE + ITAB-MENGE1.

MODIFY ITAB.

WRITE 😕 ITAB-EBELN,ITAB-MEINS,ITAB-MENGE,ITAB-MENGE1..

ENDLOOP.

ITAB contain all the data like date and Quan.

Bal is the variable i have created for cal.

Can anyone give me the solution for this.

Thanks in advance.

Regds,

Vipul

5 REPLIES 5
Read only

former_member222860
Active Contributor
0 Likes
488

Try using>

MODIFY ITAB TRANSPORTING MENGE1.

Read only

0 Likes
488

hi mahesh ,

Thanks for your reply but i have already tried it is not effective.

Regs

Vipul

Read only

Former Member
0 Likes
488

Loop at itab.

at first.

bal = 0.

endat.

bal = bal + itab-menge.

write: itab-ebeln, itab-menge, itab-bal. "If only write will suffice or modify itab transporting bal.

endloop.

Read only

0 Likes
488

hi Richa,

Thanks for your reply,but my second row quantity like 2 is not added with 3.

it is printing same as Quan = bal.

Regds,

Vipul

Read only

0 Likes
488

I have resoved my issue.