Application Development 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: 

logic required!

Former Member
0 Kudos

friends,

there is a report that has the final format like the one below...

LGORT BWART COUNT

102S 105 230

102S 315 118

103S 105 439

103S 315 133

Now, i need to change the format of the report such that it should look like :

LGORT 105 315 TOTAL

102S 230 118 348

103S 439 133 572

i.e. there should be only one entry for each storage loc. and the final col. TOTAL should be the sum of the all the movement types...i have worked it out with a couple of logics and not able to arrive at the soln..pl suggest...thanks all..

5 REPLIES 5

Former Member
0 Kudos

are u calling /creating tables dynamically ? If not u can put like this

loop at itab.

itab-total = itab-105 + itab-315.

modify itab.

endloop.

regards

Prabhu

Former Member
0 Kudos

hi,

itab has three fields- lgort,bwart,count and a variable v_count.

loop at itab.
 at new lgort.
  write : / itab-lgort, itab-bwart.
  v_count = v_count + itab-count
 endat
 write : itab-bwart.
 at end of lgort.
  write : v_count.
 endat.
endloop.

hope this helps.

Regards,

Richa

Former Member
0 Kudos

hi,

thanks for the reply..the problem is not with the totaling..i am not able to get the corresponding entries of 105 and 315 in a single line...either they are getting appended or if i use modify, they are getting overwritten...if i use clear the itab, then only the second entry is coming...

Former Member
0 Kudos

hi,

Loop at itab and Use At-New of field or At-End of field.

Reward if usefull..

Regards,

Srinivas

0 Kudos

At-New of field or At-End of field will solve your issue