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

Reg: Date in Select-options

Former Member
0 Likes
705

Hello All,

I have a date field in the SSCRN as select-options.

Now I want to give a default value to the date-low and date-high.

Those default values must be :

1. For s_date-low the value must be the START DATE of the current Week ( MONDAY )

2. For S_date_high the value must be the END DATE of the Week ( SUNDAY )

Eg: today is 07.11.2007 then my s_date-low must be 05.11.2007 (Monday) and my s_date-high must be 11.11.2007 (Sunday).

Can anyone know how to pass these as default values ?

Regards,

Deepu.K

Hello All,

I have a date field in the SSCRN as select-options.

Now I want to give a default value to the date-low and date-high.

Those default values must be :

1. For s_date-low the value must be the START DATE of the current Week ( MONDAY )

2. For S_date_high the value must be the END DATE of the Week ( SUNDAY )

Eg: today is 07.11.2007 then my s_date-low must be 05.11.2007 (Monday) and my s_date-high must be 11.11.2007 (Sunday).

Can anyone know how to pass these as default values ?

Regards,

Deepu.K

4 REPLIES 4
Read only

Former Member
0 Likes
678

Hi,

this will solve your porblem..


SELECT-OPTIONS : s_date FOR sy-datum.
DATA : pdat LIKE sy-datum.

INITIALIZATION.
  CALL FUNCTION 'GET_WEEK_INFO_BASED_ON_DATE'
    EXPORTING
      date   = sy-datum
    IMPORTING
      monday = pdat.
  s_date-low = pdat.
  s_date-high = pdat + 6.
  APPEND s_date.

Read only

0 Likes
678

Hello Sudhakar and Rajesh,

Thanks for the help.

But I'm not able to award points for u as I'm unable to see the Radiobuttons for awarding.

Is the awarding procedure changed ?

Regards,

Deepu.K

Read only

Former Member
0 Likes
678

Check this code

report ztets.

SELECT-OPTIONS:

s_date for sy-datum.

data:

monday type sy-datum,

sunday type sy-datum.

INITIALIZATION.

CALL FUNCTION 'GET_WEEK_INFO_BASED_ON_DATE'

EXPORTING

DATE = SY-DATUM

IMPORTING

  • WEEK = WEEK

MONDAY = MONDAY

SUNDAY = SUNDAY

.

s_Date-low = monday.

s_Date-high = sunday.

append s_date.

Read only

Former Member
0 Likes
678

Hi Deepu,

Try the following code.

SELECT-OPTIONS : s_date FOR sy-datum.

DATA : l_date LIKE sy-datum.

DATA : h_date LIKE sy-datum.

INITIALIZATION.

CALL FUNCTION 'GET_WEEK_INFO_BASED_ON_DATE'

EXPORTING

DATE = SY-DATUM

IMPORTING

  • WEEK =

MONDAY = l_date

SUNDAY = h_date.

s_date-low = l_date.

s_date-high = h_date.

append s_date.

If it is usefull pls reward it.

Regards

Srimanta