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: 

dates in selection screen

Former Member
0 Kudos
148

Hallow I doing a program with dates but I wont to change my declaration to the dates like sap standard (block with today ,current month ,current year …)

How can I do it

This is my old declaration I can to change it or I need to do new

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-t01.

SELECT-OPTIONS so_date FOR sy-datum OBLIGATORY.

SELECTION-SCREEN END OF BLOCK b2.

Thanks

1 ACCEPTED SOLUTION

Former Member
0 Kudos
104

SELECT-OPTIONS so_date FOR sy-datum OBLIGATORY default sy-datum.

regards

shiba dutta

6 REPLIES 6

Former Member
0 Kudos
104
TABLES : VBAK.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-t01.

SELECT-OPTIONS :so_date FOR VBRK-ERDAT OBLIGATORY.

SELECTION-SCREEN END OF BLOCK b2.

regards,

vijay

Former Member
0 Kudos
104

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-t01.

SELECT-OPTIONS so_date FOR sy-datum <b>default sy-datum</b> OBLIGATORY.

SELECTION-SCREEN END OF BLOCK b2.

Former Member
0 Kudos
105

SELECT-OPTIONS so_date FOR sy-datum OBLIGATORY default sy-datum.

regards

shiba dutta

Former Member
0 Kudos
104

hi,

adding the addition default sy-datum will default the date to the current date.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-t01.

SELECT-OPTIONS so_date FOR sy-datum default sy-datum OBLIGATORY.

SELECTION-SCREEN END OF BLOCK b2.

Regards,

Richa

Former Member
0 Kudos
104

hope this is what is your requirement

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-t01.

select-options: s_budat for anek-budat obligatory.

SELECTION-SCREEN END OF BLOCK b2.

at selection-screen.

concatenate sy-datum+0(4) sy-datum+4(2) sy-datum+6(2) into s_budat-low.
append   s_budat-low.

Former Member
0 Kudos
104

hi,

did not get ur question but i think u wanna show current date as default so here is the code for that just change the select options to the following.

SELECT-OPTIONS so_date FOR sy-datum OBLIGATORY default sy-datum.