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: 

problem

Former Member
0 Kudos

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

7 REPLIES 7

Former Member
0 Kudos

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.

0 Kudos

explain me some more clearly,pls.

with example coding.

0 Kudos

Hey,

I have written the 100% logic with 80% of the code, you just to fit it in your program.. nothing to explain here.. see the table values i have shown.. how they are changing..

It will work!!!

Thanks and Best Regards,

Vikas Bittera.

0 Kudos

k thank you yar, let you know afer done this,

0 Kudos

Sure, i will wait for the result..

Thanks and Best Regards,

Vikas Bittera.

0 Kudos

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

item# = tab2-item#

movtp = 602.

what it means, tell me clearly.

0 Kudos

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.