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

problem

Hi experts

I am facing the following problem, my requirement is,

i have internal table containing sales order, line item, shipped qty,mov type(601,602).

I want to say weather the order is closed or open line item wise.

so i need to compare the shipped qty and order qty.

regarding shipped qty i need to do calculation that 601 ship qty - 602 ship qty in a particular line item(considering reverse document), then only move to comparing order qty.

Can you please give me suggestions how to solve this problem.

Thanks in advance.

Regards

rajaram

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Sep 03, 2007 at 12:40 PM

    Hi,

    as i already suggested, use COLLECT..

    Now i wil show u how it will work..

    tab1

    12345 00010 50 601

    12345 00010 60 601

    12345 00010 120 602

    12345 00010 20 601

    LOOP AT tab1.

    pass data to tab2..

    COLLECt tab2.

    ENDLOOP.

    tab2

    12345 00010 130 601

    12345 00010 120 602

    SORT tab2 BY field1 field2 field4.

    LOOP AT tab2.

    READ TABLE tab2 INTO e_tab2 WITH KEY so# = tab2-so#

    item# = tab2-item#

    movtp = 602.

    if sy-subrc eq 0.

    DELETE tab2 INDEX sy-tabix.

    ENDIF.

    tab2-shipqty = tab2-shipqty - e_tab2-shipqty.

    MODIFY tab2.

    ENDLOOP.

    tab2

    12345 00010 10 601

    At last you can check which records do not have ship qty = 0, and display them as open items..

    Thanks and Best Regards,

    Vikas Bittera.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      Here we are looping at table tab2.. we will find the corresponding mov type 602 record for the current mov type 601 record..

      We just have to compare the qty.. so i will read the same table itab2 with full key values of the current record..

      12345 00010 is the key of my current record and it has miv type 601..

      So, i will get the 2nd record with move type 602 into the structure e_tab2.. this structure has the same fields as table tab2.

      Now once i get this record, i can do the comparison from e_tab2, so i do not need this record any more and i will delete it...

      Thanks and Regards,

      Vikas Bittera.

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.