10292007 7:02 PM
Hi can anybody have any idea how i can implement this
suppose i have same order which has different item category let's say x1 and x2.
x1 can can be follow by several x2 item caterory i need to
1. Match the Unit of measure for the x2(xvbappstyv) and its respective
x1(xvbappstyv)

a) if they are same then Compare the confirmed qty(XVBEPLMENG) field and

if x2 (xvbappstyv) is greater than Z011(xvbappstyv) then

replace the x2’s (xvbappstyv) confirmed qty by x1 in XVBEP .
how do i compare the unit pf measure i am thinking maybe i need to loop in xvbap then in xvbep then how do i link the item category by it's posnr may be is it correct?
10292007 7:13 PM
Yes, you can do like:
Loop at xvbap with PSTVY = 'X1'.
read table xvbep with posnr = xvbapposnr.
*... do your processing
endloop.
Regards,
Naimesh Patel
10292007 8:31 PM
need to to 2 loop can't do a read since in table xvbep there can be many entry with same posnr
can i do a read in xvbep??
what i an unsure is how do i Match the Unit of measure for the x2(xvbappstyv) and its respective x1(xvbappstyv)
what i plan to do is
loop at xvbap where pstyv eq 'x1'
// keep the posnr in a variable var_posnr
loop at xvbep
//but how to match the unit of measure(xvbapmein) of x2 with x1
Grateful for any suggesstion which might give me a hint
10292007 8:48 PM
This is bit tricky....
1. Copy your XVBAP to XVBAP1.
2. Try to implement this code....
Loop at xvbap1 where pstyv = 'X2'.
loop at xvbap where pstyv = 'X1'
and MEINS = XVBAP1MEINS.
* SUM XVBAP''s LMENG for the <b>XVBAP1POSNR</b>.
loop at xvbep where posnr = xvbap1posnr.
l_x2_sum = l_x2_sum + xvbeplmeng.
endloop.
* SUM XVBAP''s LMENG for the <b>XVBAPPOSNR.</b>
loop at xvbep where posnr = xvbap1posnr.
l_x2_sum = l_x2_sum + xvbeplmeng.
endloop.
* now compare as per your requirement....
endloop.
endloop.
Regards,
Naimesh Patel
11212007 12:20 PM