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

date

Former Member
0 Likes
1,373

Please use a more informative subject line in future

hi all,

in the selection screen i have to keep the select option for date

it should be as

the FROM date and TO date should set default as

From date should be 2 days before the sy-datum and

TO date should be sy-datum

for eg:

s_date: from 07/03/2009 to 09/03/2009

please help how to write code for this.

Edited by: Matt on Mar 9, 2009 10:21 AM

14 REPLIES 14
Read only

Former Member
0 Likes
1,346

Hi,

data w_Date like sy-datum.

initialization.
w_date = sy-datum - 2.
s_date-low = w_date.
s_date-high = sy-datum.
s_date-sign = 'I'.
s_date-option = 'BT'.
append s_date.

This works

Regards,

Siddarth

Read only

Former Member
0 Likes
1,346

hi,

Check this code snippet. Its as per your requirement.

SELECT-OPTIONS s_date FOR sy-datum.

DATA:
  w_date TYPE sy-datum .


INITIALIZATION.
  w_date = sy-datum.
  s_date-low = w_date - 02.
  w_date = sy-datum.
  s_date-high = w_date.
  APPEND s_date.

Thanks

Sharath

Read only

kamesh_g
Contributor
0 Likes
1,346

select-OPTIONS : s_date for sy-datum.

data w_Date like sy-datum.

initialization.

w_date = sy-datum - 2.

s_date-low = w_date.

s_date-high = sy-datum.

s_date-sign = 'I'.

s_date-option = 'BT'.

append s_date.

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
1,346

Hi,

Use:-


SELECT-OPTIONS : p_datum FOR sy-datum.

AT SELECTION-SCREEN OUTPUT.
  p_datum-high = sy-datum.
  p_datum-low = sy-datum - 2.

This will place the date values on the screen for range depending on the value of sy-datum.

Hope this helps you.

Regards,

Tarun

Read only

Former Member
0 Likes
1,346

HI,

Chcek this

TABLES PA0001.
SELECT-OPTIONS: S_DATE FOR PA0001-BEGDA.


INITIALIZATION.
S_DATE-SIGN = 'I'.
S_DATE-OPTION = 'BT'.
S_DATE-LOW = SY-DATUM - 1.
S_DATE-HIGH = SY-DATUM.
AppEND S_DATE.

Read only

Former Member
0 Likes
1,346

Hi,

You can use like this............

SELECT-OPTIONS sel_date FOR sy-datum.

DATA:

lv_date TYPE sy-datum .

INITIALIZATION.

lv_date = sy-datum.

sel_date-low = lv_date - 02.

lv_date = sy-datum.

sel_date-high = lv_date.

APPEND s_date.

Regards

Read only

Former Member
0 Likes
1,346

Hi Balaji,

Use below mentioned code for your requirement.

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

SELECT-OPTIONS: s_date FOR sy-datum.

SELECTION-SCREEN: END OF BLOCK blk1.

DATA:

c_date TYPE sy-datum .

INITIALIZATION.

w_date = sy-datum.

s_date-low = w_date - 02.

w_date = sy-datum.

s_date-high = w_date.

APPEND s_date.

Best Regards,

Deepa Kulkarni

Read only

matt
Active Contributor
0 Likes
1,346

Please use a more informative subject line in future

Read only

Former Member
0 Likes
1,346

Hi,

write like this way...

select-options:

s_date for sy-datum.

data

w_date like sy-datum.

initialization.

w_date = sy-datum.

w_date = w_date - 2.

s_date-low = w_date.

s_date-high = sy-datum.

append s_date.

Regards

Kiran

Read only

Former Member
0 Likes
1,346

Hi,

Balaji,

As i see all your threads are still opened from a very long time,

if you didnot get the answer for this thread atleast tell the requirements or if you have got an answer from any of the reply appreciate them by awarding them points and also

DONT FORGET TO CLOSE THE THREAD

Regards,

Siddarth

Read only

matt
Active Contributor
0 Likes
1,346

>

> Hi,

>

> Balaji,

> As i see all your threads are still opened from a very long time,

> if you didnot get the answer for this thread atleast tell the requirements or if you have got an answer from any of the reply appreciate them by awarding them points and also

> DONT FORGET TO CLOSE THE THREAD

>

> Regards,

> Siddarth

As a reminder - this is part of the Rules of Engagement.

Read only

Former Member
0 Likes
1,346

Hi,

Write like this

data: w_Date like sy-datum.

initialization.

w_date = sy-datum - 2.

s_date-low = w_date.

s_date-high = sy-datum.

s_date-sign = 'I'.

s_date-option = 'BT'.

append s_date.

Regards,

Jyothi CH.

Read only

Former Member
0 Likes
1,346

data: l_date like sy-datum.

INITIALIZATION.

l_date = sy-datum - 2.

s_date1-low = l_date.

s_date1-high = sy-datum.

s_date1-sign = 'I'.

s_date1-option = 'BT'.

APPEND s_date1.

Regards,

Joan

Read only

Former Member
0 Likes
1,346

Hi,

Check the below Link

http://help.sap.com/saphelp_47x200/helpdata/en/c0/98039be58611d194cc00a0c94260a5/frameset.htm

Hope this helps you.

Regards,

Anki Reddy