‎2007 Feb 23 12:40 PM
Hi All,
In select-options, how to get the default values as current month first date and last date by default?
Thanks in Advance,
Naveen
‎2007 Feb 23 12:43 PM
Hi!
Default previous month.
INITIALIZATION. "event
CONCATENATE sy-datum(6) '01' INTO s_budat-high.
SUBTRACT 1 FROM s_budat-high.
CONCATENATE s_budat-high(6) '01' INTO s_budat-low.
MOVE 'I' TO s_budat-sign.
MOVE 'BT' TO s_budat-option.
APPEND s_budat.
Actual month
INITIALIZATION. "event
CONCATENATE sy-datum(6) '01' INTO s_budat-low.
CALL FUNCTION 'LAST_DAY_OF_MONTHS'
IMPORTING day_in = sy-datum
EXPORTING last_day_of_month = s_budat-high.
MOVE 'I' TO s_budat-sign.
MOVE 'BT' TO s_budat-option.
APPEND s_budat.
Regards
Tamá
‎2007 Feb 23 12:44 PM
U can use fm HR_JP_MONTH_BEGIN_END_DATE to get first and last day of month
‎2007 Feb 23 12:47 PM
Hello,
1)first date of month is always 1.
set v_firstdate = sy-datum.
v_firstdate+6(02) = '01'. 2)for last date use this fm...
data : v_lastdate type sy-datum.
CALL FUNCTION <b>'LAST_DAY_OF_MONTHS'</b>
EXPORTING
DAY_IN = sy-datum
IMPORTING
LAST_DAY_OF_MONTH = v_lastdateAfter getting the first and last date.
In the Initailization event move the values to the select opions.
SELECT-OPTION: SO_DATE LIKE EKKO-AEDAT.
SO_DATE-sign = 'I'
SO_DATE-option = 'BT'.
SO_DATE-low = Lv_firstdate.
SO_DATE-option = Lv_lastdate.
Append so_date.Vasanth
‎2007 Feb 23 12:50 PM
Hi,
In the
INITIALIZATION.
CONCATENATE '01' sy-datum+4(2) sy-datum+0(4) INTO s_date-low
seperated by '/'.
Use FM RS_VARI_V_L_LAST_MONTH to get the last day of the month and pass it to s_date-high.reward points if this helps.
‎2007 Feb 23 1:10 PM
Hi All,
Thanks for the quick response. I tried implemting the ideas given by you guys ,In the debug mode i am able to see that sign,option,low,high values are getting assigned,but it is not showing on the selection-screen. Could you please help me with this.
Thanks
Naveen
‎2007 Feb 23 1:20 PM
U have to append S_DATE. So taht it will be seen.
SELECT-OPTIONS: fromdate FOR sy-datum.
DATA: v_low LIKE sy-datum,
v_high LIKE sy-datum.
INITIALIZATION.
CONCATENATE sy-datum+0(4) '01' sy-datum+4(2) INTO v_low.
CONCATENATE sy-datum+0(4) '28' sy-datum+4(2) INTO v_high.
fromdate-sign = 'I'.
fromdate-option = 'BT'.
fromdate-low = v_low.
fromdate-high = v_high.
APPEND fromdate.Reward if this oslves.
‎2007 Feb 23 1:27 PM
Hi All,
Thanks for your time and suggestions,the problem is resolved.
Regards,
Naveen