Skip to Content
author's profile photo Former Member
Former Member

logic required!

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..

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Sep 26, 2006 at 11:13 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 26, 2006 at 11:15 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 26, 2006 at 11:16 AM

    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...

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 26, 2006 at 11:17 AM

    hi,

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

    Reward if usefull..

    Regards,

    Srinivas

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.