‎2006 Dec 18 6:55 AM
Hi,
I have a date 18.06.2006 and 18.11.2006,and i want to display in range s_date where 18.06.2006 to be 01.06.2006 and 18.11.2006 to be 30.11.2006.means in that begining date of the first month and last date of the second month should be display like s_date eq 01.06.2006 to 30.11.2006.i have the two dates in the internal table.now how to find the date range for the above dates.
Thanks,
Rajendra.
‎2006 Dec 18 7:04 AM
TAKE YOUR DAY 18.06.2006.
VDATE = '20060618'
TAKE THREE VARIABLE V_YEAR = VDATE(4).
V_MON = VDATE+4(2).
V_DAY = '01'.
CONCATENATE V_YEAR V_MON V_DATE INTO VDATE1.
FOR LAST DAY USE FM 'LAST_DAY_OF_MONTHS' AND PASS THE VALE 18.11.2006.
REGARDS
SHIBA DUTTA
‎2006 Dec 18 7:00 AM
Hi to polupate the first day of the month ..
s_date-sign = 'I'.
s_date-option = 'BT'.
simply put 01 in the internal table date .. say it_date-date+6(2) = '01'
and s_date-low = it_date-date
and for the last day use this FM.
RP_LAST_DAY_OF_MONTHS and pass the second day from the internal table
and pass this date to s_date-high.
‎2006 Dec 18 7:02 AM
Hi,
Exactly wat do u mean by date range
Is it the diff betn 2 dates
then daterange = s_date-High - s_date-low
U can use this Fm to find last day of any month 'RE_LAST_DAY_OF_MONTH'
For the first day just s_date-low+6(2) = '01'.
Regards
bheema
‎2006 Dec 18 7:02 AM
‎2006 Dec 18 7:04 AM
for first day
use this ..
20061212
itab-date+4(4) = 0101.
or if it is
12122006
itab-date+0(4) = 0101.
this will capture the first day .
for the last day .
use the Fm
RP_LAST_DAY_OF_MONTHS
pass the next date to this and the o/p will be the last date of month .
hope this helps
regards,
vijay
‎2006 Dec 18 7:04 AM
TAKE YOUR DAY 18.06.2006.
VDATE = '20060618'
TAKE THREE VARIABLE V_YEAR = VDATE(4).
V_MON = VDATE+4(2).
V_DAY = '01'.
CONCATENATE V_YEAR V_MON V_DATE INTO VDATE1.
FOR LAST DAY USE FM 'LAST_DAY_OF_MONTHS' AND PASS THE VALE 18.11.2006.
REGARDS
SHIBA DUTTA
‎2006 Dec 18 7:04 AM
there is a function module to convert the data to initial and end data, do one thing try the function moudle to convert starting data using the function module and if u need end of data, split the date, month, year in to 3 variables and increment the year by 1 and convert the date to end date ur problem will be solved.
‎2006 Dec 18 7:10 AM
hi,
chk this code. you can use ethis logic
tables: mkpf.
data : date like sy-datum.
data : date1 like sy-datum.
select-options: s_date for mkpf-budat.
initialization.
CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'
EXPORTING
iv_date = sy-datum
IMPORTING
EV_MONTH_BEGIN_DATE = date
EV_MONTH_END_DATE = date1
.
s_date-option = 'EQ'.
s_date-sign = 'I'.
s_date-low = date.
s_date-high = date1.
append s_date.Regards
Anver