07-18-2007 9:45 PM
I want to filter my query by the Cal. yr/month dimension (OCALMONTH), and need to create a customer exit variable that will allow me to filter for the last 24 months excluding the current month. Any help provided would be greatly appreciated. Thanks!
07-18-2007 10:03 PM
hello,
If you are making a select stm....try on the where....using between.
bye
Gabriel
07-19-2007 4:04 AM
Use this FM CCM_GO_BACK_MONTHS
Enter the current date &
the number of month you want to goback + 1
(for excluding current month).
DATA: current_YYYYMM TYPE RSCALMONTH,
past_YYYYMM TYPE RSCALMONTH.
current_YYYYMM = SY-DATUM(6).
ADD 1 to current_YYYYMM. '<------exclude current month.
past_YYYYMM = 'date output from the above FM'(6).
Now select the record from table:
using
SELECT *
FROM <>
WHERE <YYYYMM> BETWEEN (current_YYYYMM AND past_YYYYMM).
Regards,
A.Singh
Message was edited by:
Amarjit Singh
07-19-2007 4:28 AM
Hi Daren
try this way
SO_HZFRM-LOW is Selection option From Date
SO_HOZTO-LOW is Selection option To date
this is work properly
*-- Select green tyres and there quantity
SELECT ZGREEN_TY ZOUTSTND_QTY
INTO CORRESPONDING FIELDS OF TABLE IT_GREEN_REQPLAN
FROM ZTAB_PP_001
WHERE ZALLOC_FROM GE SO_HZFRM-LOW
AND ZALLOC_TO LE SO_HOZTO-LOW
AND ZPLANT EQ SO_PLANT-LOW
AND ZACTIVE = 'YES'.
Rewards if helpful.