Application Development 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: 

SELECT OPTIONS PROB

Former Member
0 Kudos

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

3 REPLIES 3

Former Member
0 Kudos

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

bbalci
Contributor
0 Kudos

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.

Former Member
0 Kudos

Moderator message - Please do not ask or answer basic questions - thread locked Rob