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-options

Former Member
0 Likes
571

In select-options, how to get the default values as current month first date and last date by default?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
544

Hi Savitha,

In the Initialization part,

give

use fm ISB_GET_FIRST_DAY to get the first day,

and LAST_DAY_OF_MONTHS for the last day.

s_month-low = month_first_day.

S-month-high = month_last_day.

S_Month-options = 'BT'.

s_month-sign = 'I'.

append s_Month.

Clear s_month.

4 REPLIES 4
Read only

Former Member
0 Likes
545

Hi Savitha,

In the Initialization part,

give

use fm ISB_GET_FIRST_DAY to get the first day,

and LAST_DAY_OF_MONTHS for the last day.

s_month-low = month_first_day.

S-month-high = month_last_day.

S_Month-options = 'BT'.

s_month-sign = 'I'.

append s_Month.

Clear s_month.

Read only

Former Member
0 Likes
544

Hi savita,

Add the event "INITIALIZATION" to you report. Here you can code for example (suppose your select option is se_date):

se_date-sign = 'I'.

se_date-option = 'BT'.

se_date-low = <first date of month>.

se_date-high = <lastt date of month>.

APPEND se_date.

Regards,

john.

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
544

Hi,

Here is the saqmple code.

INITIALIZATION.

  • Setting the date

PERFORM f101_default_values.

FORM f101_default_values.

MOVE: sy-datum0(4) TO s_sdate-low0(4),

'01' TO s_sdate-low+4(2),

'01' TO s_sdate-low+6(2).

MOVE: sy-datum0(4) TO s_sdate-high0(4),

'12' TO s_sdate-high+4(2),

'31' TO s_sdate-high+6(2).

ENDFORM. " f101_default_values

Kindly reward points by clicking the star on the left of reply,if it helps.

Read only

Former Member
0 Likes
544

Savita,

I am not sure whether u would be able to use the function module ISB_GET_FIRST_DAY!.

But u can see the possiblity of using the following Code:

select-options: soDate for sy-datum.

initialization.

data: lowDate type sy-datum,

diff(2).

CALL FUNCTION 'LAST_DAY_OF_MONTHS'

EXPORTING

DAY_IN = sy-datum

IMPORTING

LAST_DAY_OF_MONTH = soDate-high

  • EXCEPTIONS

  • DAY_IN_NO_DATE = 1

  • OTHERS = 2

.

diff = soDate-high6(2) - ( soDate-high6(2) - 1 ).

if ( strlen( diff ) eq 1 ).

concatenate soDate-high+0(6) '0' diff into lowdate.

else.

concatenate soDate-high+0(6) diff into lowdate.

endif.

soDate-low = lowDate.

soDate-sign = 'I'.

soDate-option = 'BT'.

append soDate.

Thanks

Kam

Note : allot points for all worth ful psotings

Message was edited by: Kam