‎2007 Oct 29 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(xvbap-pstyv) and its respective
x1(xvbap-pstyv)
-
a) if they are same then Compare the confirmed qty(XVBEP-LMENG) field and
-
if x2 (xvbap-pstyv) is greater than Z011(xvbap-pstyv) then
-
replace the x2s (xvbap-pstyv) 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?
‎2007 Oct 29 7:13 PM
Yes, you can do like:
Loop at xvbap with PSTVY = 'X1'.
read table xvbep with posnr = xvbap-posnr.
*... do your processing
endloop.Regards,
Naimesh Patel
‎2007 Oct 29 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(xvbap-pstyv) and its respective x1(xvbap-pstyv)
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(xvbap-mein) of x2 with x1
Grateful for any suggesstion which might give me a hint
‎2007 Oct 29 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 = XVBAP1-MEINS.
* SUM XVBAP''s LMENG for the <b>XVBAP1-POSNR</b>.
loop at xvbep where posnr = xvbap1-posnr.
l_x2_sum = l_x2_sum + xvbep-lmeng.
endloop.
* SUM XVBAP''s LMENG for the <b>XVBAP-POSNR.</b>
loop at xvbep where posnr = xvbap1-posnr.
l_x2_sum = l_x2_sum + xvbep-lmeng.
endloop.
* now compare as per your requirement....
endloop.
endloop.Regards,
Naimesh Patel
‎2007 Nov 21 12:20 PM