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

dates in selection screen

Former Member
0 Likes
891

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
Read only

Former Member
0 Likes
847

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

regards

shiba dutta

6 REPLIES 6
Read only

Former Member
0 Likes
847
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

Read only

Former Member
0 Likes
847

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.

Read only

Former Member
0 Likes
848

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

regards

shiba dutta

Read only

Former Member
0 Likes
847

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

Read only

Former Member
0 Likes
847

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.

Read only

Former Member
0 Likes
847

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.