Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Select-option query

Former Member
0 Likes
747

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

7 REPLIES 7
Read only

Former Member
0 Likes
715

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á

Read only

Former Member
0 Likes
715

U can use fm HR_JP_MONTH_BEGIN_END_DATE to get first and last day of month

Read only

Former Member
0 Likes
715

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_lastdate

After 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

Read only

Former Member
0 Likes
715

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.

Read only

Former Member
0 Likes
715

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

Read only

0 Likes
715

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.

Read only

Former Member
0 Likes
715

Hi All,

Thanks for your time and suggestions,the problem is resolved.

Regards,

Naveen