‎2009 Jun 01 11:03 AM
hi all,
in the selection screen i have a posting date from MKPF Table but date should display only month and year as
DATE : 1/2008 TO 12/2008
I have written as below using offset.
select-options: l_date for mkpf-budat+2(6).
but how to get the values from MKPF table using select query.
in below query budat+2(6) is not working how can i compare and get the values based on month and year.
select mblnr
mjahr
bldat
budat
into table gt_mkpf
from mkpf
for all entries in gt_mseg
where mblnr eq gt_mseg-mblnr
and mjahr eq gt_mseg-mjahr
and budat+2(6) in l_date.
please , thanks in advance
‎2009 Jun 01 11:11 AM
Dear Neethu,
I will advise you keep the date format as it is. Just ignore date while providing dates through selection screen. This will work as it is difficult to understand.
Regards,
Vijay
‎2009 Jun 01 11:18 AM
HI,
Try this code
DATE : 1/2008 TO 12/2008
select-options: l_date for mkpf-budat+2(6). " value foramt will be YYYYMM
Ranges : r_budat FOR mkpf-budat.
Loop at l_date.
r_budat-sign = l_date-sign.
r_budat-option = l_date-option.
concatenate l_date-low '01' into r_budat-low.
concatenate l_date-high '01' into r_budat-high.
CALL FUNCTION 'LAST_DAY_OF_MONTHS'
EXPORTING
day_in = r_budat-high
IMPORTING
last_day_of_month = r_budat-high
EXCEPTIONS
day_in_no_date = 1
OTHERS = 2.
Append r_budat.
ENDloop.
select mblnr
mjahr
bldat
budat
into table gt_mkpf
from mkpf
for all entries in gt_mseg
where mblnr eq gt_mseg-mblnr
and mjahr eq gt_mseg-mjahr
and budat in r_budat.
‎2009 Jun 01 11:20 AM
‎2009 Jun 01 11:28 AM
Its simple
1/2008 TO 12/2008
1/2008 means 01012008
and 12/2008 means last day of december 31122008
just make 2 fields with these dates and use them in ur select query.