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

Help regarding code related to quantity calculation based on movement type

hi All,

I need your help regarding the quantity calculation based on movement type My requirement is as follows:

I have a material number and plant as my selection screen parameters.(MARC table)

Depending on material number and plant, we need to show the values of material document year and quantity from MSEG table.

The output should be:

material document year - quantity

for example:

1998 - 1000

1999 - 2000 and so on (as per the data present in the table for that particular material number and plant)

The quantity should be calculated as shown below:

Quantity = Issues - returns

Isssues can be obtained fro mthe movement types 201, 221 and 261.

Returns can be obtained from the mvoement types 202, 222 and 262.

Thus quantity should be calculated and displayed per year.

Can any body please provide me the logic for the same.

Thanks in advance.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Oct 29, 2008 at 11:18 AM

    Hi,

    Have you started coding atleast ? If not start coding and if you face any difficulties then ask questions.

    regards,

    Advait

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 29, 2008 at 11:23 AM

    Hi Supraja,

    You can use case statement inside the internal table loop for different Movement Types clubbed under one scenario.

    For e.g.,

    LOOP AT ITAB.
     CASE Mov_Type.
        WHEN 201 or 202 or 203.
            ISSUES = Sum up the quantity field
        WHEN 301 or 302 or 303.
            REVENUE = Sum up the quantity field
      ENDCASE.
    ENDLOOP.
    

    After the loop,

    Toal_Qty = ISSUES - REVENUE.

    Best Regards,

    Ram.

    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.