‎2008 Mar 03 6:09 AM
Dear friends,
I am retriving the data from MBEW Table based on Material (MATNR) ,Fiscal year of current period (LFGJA), Current period (posting period) (LFMON).
I want to retrive all the data from table where material is equal to given material and Fiscal year of current period(LFGJA) is less then or equal to given value, and Current period (posting period) (LFMON) less then or equal to given value. but it is not fetching the data.
the query is like this.
SELECT matnr
bwkey
bwtar
lbkum
salk3
verpr
lfmon
INTO TABLE gt_mbew
FROM mbew
WHERE matnr = 'XXXXX'
AND lfgja LE '2008'
AND lfmon LE '01'.
with the above query i want to get the data wich is less then or equal to given value. I mean It shout retrive first 01/2008, then 12/2007,11/2007,10/2007.....
how to do this...
Thanks,
Sridhar
‎2008 Mar 03 6:24 AM
Hi,
Try this :
SELECT matnr
bwkey
bwtar
lbkum
salk3
verpr
lfmon
INTO TABLE gt_mbew
FROM mbew
WHERE matnr = 'XXXXX'
AND lfgja LE 2008
AND lfmon LE 01.
The values for the fields 'lfgja' and 'lfmon' should not be written in single quotes because the data type is NUMC.
Reward if helpful
Thanks,
Chinmaye
‎2008 Mar 03 6:28 AM
Sorry, The values for 'lfgja' and 'lfmon' are comming from selection screen, just for our reference I haven it like this.
‎2008 Mar 03 6:38 AM
Hi,
The data will be fetched in to the internal table as its in the database.
If you want the data to be in the order in which you have specified, sort the internal table once you get the data.
SORT gt_mbew by LFGJA.
Reward if helpful.
Regards.
‎2008 Mar 03 6:44 AM
Hi,
Aren't u getting output or aren't u getting output in the desired order?
Regards,
Ramya