07-20-2010 11:37 PM
In select-options, how to get the default values as current month first date and last date by default? Eg: 1/12/2010 and 31/12/2010
07-21-2010 12:29 AM
Hi friend,,
Try this code:
INITIALIZATION.
DATA:
lv_bgdat TYPE d,
lv_endat TYPE d.
*
CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'
EXPORTING
iv_date = sy-datum
IMPORTING
ev_month_begin_date = lv_bgdat
ev_month_end_date = lv_endat.
* p_out is your select-options
REFRESH p_out.
p_out-sign = 'I'.
p_out-option = 'BT'.
p_out-low = lv_bgdat.
p_out-high = lv_endat.
APPEND p_out.
hope that help
07-21-2010 1:54 PM
u can simply use this code :
REPORT zso_date.
SELECT-OPTIONS s_date FOR sy-datum.
INITIALIZATION.
"1 First day of month
CONCATENATE sy-datum(6) '01' INTO s_date-low.
"2 Last day of month :
"find first day of next month :
s_date-high = s_date-low.
ADD 1 TO s_date-high+4(2). "add 1 month
s_date-high+6(2) = '01'. "find first day
"go 1 day earlier :
SUBTRACT 1 FROM s_date-high.
APPEND s_date.
START-OF-SELECTION.
07-21-2010 4:14 PM
Moderator message - Please do not ask or answer basic questions - thread locked Rob