2006 Nov 14 6:48 AM
Develpoe a program how to set month first and last date by default
for the select-options.
2006 Nov 14 6:51 AM
hi,
check this sample code...
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 " ---> input
IMPORTING
EV_MONTH_BEGIN_DATE = date " ---> begin date
EV_MONTH_END_DATE = date1 " ---> enddate
.
s_date-option = 'EQ'.
s_date-sign = 'I'.
s_date-low = date.
s_date-high = date1.
append s_date.
rgds
Anver
2006 Nov 14 6:51 AM
hi,
check this sample code...
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 " ---> input
IMPORTING
EV_MONTH_BEGIN_DATE = date " ---> begin date
EV_MONTH_END_DATE = date1 " ---> enddate
.
s_date-option = 'EQ'.
s_date-sign = 'I'.
s_date-low = date.
s_date-high = date1.
append s_date.
rgds
Anver
2006 Nov 14 6:53 AM
sorry use this fm.
data:f_date type sy-datum,
l_date type sydatum.
CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'
EXPORTING
iv_date = sy-datum
IMPORTING
EV_MONTH_BEGIN_DATE = f_date
EV_MONTH_END_DATE = l_date.
write:/ f_date,
/ l_date.
kishan negi
2006 Nov 14 7:03 AM
without using any predefined table . generally i want pls help to me.
2006 Nov 14 7:04 AM
2006 Nov 14 7:06 AM
Hi Madahv,
with out using any variables it is not possibel.
any way v have to find the end date and begdate.
also need the function module.
and finally we have to append the data to select options.
so for all these v need the variable.
chk my code. it is using minimum variable.
u can folllw that. no prblem at all.
Rgds
Anver
if hlped pls mark points
2006 Nov 14 7:13 AM
You are using mkpf_budat .without using that one .i want generally.
2006 Nov 14 7:15 AM
i wnat to set it to like.
data: d like sy-datum.
select-options : s_date like d.
2006 Nov 14 7:17 AM
2006 Nov 14 6:57 AM
SELECT-OPTIONS: S_DATE FOR SY-DATUM.
INITIALIZATION.
S_DATE-LOW = S_DATE-HIGH = SY-DATUM.
S_DATE-LOW+6(2) = '01'.
CALL FUNCTION 'LAST_DAY_OF_MONTHS'
EXPORTING
day_in = S_DATE-HIGH
IMPORTING
LAST_DAY_OF_MONTH = S_DATE-HIGH
EXCEPTIONS
DAY_IN_NO_DATE = 1
OTHERS = 2
.
APPEND S_DATE.
START-OF-SELECTION.
2006 Nov 14 6:57 AM
Hi,
In the select-options : s_date DEFAULT firstdate TO lastdate ... OPTION op ... SIGN s use this options
2006 Nov 14 7:09 AM
Hi,
Here is the syntax-
select-options s_date for mara-ersda default '1/11/2006' to '30/11/2006'.
Hope this helps.
Regds,
Seema.
2006 Nov 14 7:17 AM
create new program...simply copy this code and pase and activate & execute.....
code:
data: b_date like sy-datum.
data: l_date like sy-datum.
select-options: date for sy-datum.
initialization.
CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'
EXPORTING
iv_date = sy-datum
IMPORTING
EV_MONTH_BEGIN_DATE = b_date
EV_MONTH_END_DATE = l_date
.
date-low = b_date.
date-high = l_date.
date-sign = 'I'.
date-option = 'BT'.
append date.
Regards,
Ramesh.