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

Former Member
0 Kudos
140

Hi Experts,

Can u tell me that if We have a date type select-option, so in range of input field I want to display by default, date of first day of current month and in last input field date of last day of current month. How can we do that?

5 REPLIES 5

Former Member
0 Kudos
96

code your default values(what ever it may be)

in the event initialization

Former Member
0 Kudos
96

hi,

U can give it as

so_date-low = date default

so_date-high = date default

Former Member
0 Kudos
96

Example of a date calculation:

DATA: ultimo TYPE d.

ultimo = sy-datum.

ultimo+6(2) = '01'. " = first day of this month

ultimo = ultimo - 1. " = last day of previous month

http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb334a358411d1829f0000e829fbfe/content.htm

Former Member
0 Kudos
96

Hi Chaitanya kumar

REPORT zazudate .

SELECTION-SCREEN : BEGIN OF BLOCK bl1 WITH FRAME TITLE text-001.

SELECT-OPTIONS : sodate FOR sy-datum.

SELECTION-SCREEN : END OF BLOCK bl1.

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.

<b>Regards,

Azhar</b>

Former Member
0 Kudos
96

Hi,

Selection-screen begin of block b1 with frame title text-001.

select-options : so_pdate for cdhdr-udate.

selection-screen end of blok b1.

data : l_date type sy-datum.

INITIALIZATION.

CALL FUNCTION 'LAST_DAY_OF_MONTHS'

EXPORTING

day_in = sy-datum

IMPORTING

last_day_of_month = l_date.

  • EXCEPTIONS

  • DAY_IN_NO_DATE = 1

  • OTHERS = 2

.

move '01' to sy-datum+6(2).

so_pdate-low = sy-datum.

so_pdate-high = l_date.

append so_pdate.

if helpsssssssss...

REWARD.....

rgds

harris