2007 Dec 13 1:53 PM
hi all.
im facing a problem related to montly price.
i have to get the details material, plant, val class, mrp controller, profit center and 12 months price with respect to period.
i m giving the selecion screen values as 09.2005 09.2006(spmon).
i have to calculate price for 12 months (mbewh-verpr)
im passing the values to fieldcat with respect to the given period.
but im getting nil values in field cat.
how to convert the period and get the values corresponding to montly price.
also we have to check mbewh-lfmon(month) and mbewh-lfgja(year).
plz give logic or code.
2007 Dec 13 2:33 PM
DATA: mon_low LIKE marv-lfmon,
yr_low LIKE marv-lfgja,
mon_high LIKE marv-lfmon,
yr_high LIKE marv-lfgja.
Kindly check the Standard program : RM07KOHDEL2
SELECT * FROM (tab_name) INTO TABLE it_mbewh "n828058
WHERE matnr IN r_matnr
AND bwkey IN r_bwkey
AND lfgja >= yr_low
AND lfgja <= yr_high
AND ( ( lfmon >= mon_low AND lfgja = yr_low ) OR
( lfmon <= 12 AND lfgja > yr_low AND lfgja < yr_high ) OR
( lfmon <= mon_high AND lfgja = yr_high ) )
ORDER BY matnr bwkey.
I hope it would solve the problem.
2007 Dec 13 2:06 PM
2007 Dec 13 2:33 PM
DATA: mon_low LIKE marv-lfmon,
yr_low LIKE marv-lfgja,
mon_high LIKE marv-lfmon,
yr_high LIKE marv-lfgja.
Kindly check the Standard program : RM07KOHDEL2
SELECT * FROM (tab_name) INTO TABLE it_mbewh "n828058
WHERE matnr IN r_matnr
AND bwkey IN r_bwkey
AND lfgja >= yr_low
AND lfgja <= yr_high
AND ( ( lfmon >= mon_low AND lfgja = yr_low ) OR
( lfmon <= 12 AND lfgja > yr_low AND lfgja < yr_high ) OR
( lfmon <= mon_high AND lfgja = yr_high ) )
ORDER BY matnr bwkey.
I hope it would solve the problem.
2007 Dec 13 2:35 PM