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

Default value on Selection Screen

Former Member
0 Likes
22,216

Hi experts,

I want to put sy-datum + 1 as a default value on selection screen.

I tried this but it didnt work. Please help me.

DATA : tarih like sy-datum.

initialization.

tarih = sy-datum + 1.

SELECTION-SCREEN BEGIN OF BLOCK 3 WITH FRAME TITLE TEXT-002.

parameters : h_tarih like sy-datum obligatory default tarih.

SELECTION-SCREEN END OF BLOCK 3.

Thanks

1 ACCEPTED SOLUTION
Read only

vinod_vemuru2
Active Contributor
0 Likes
7,153

Hi,

Do it in INITIALIZATION event.

SELECTION-SCREEN BEGIN OF BLOCK 3 WITH FRAME TITLE TEXT-002.

parameters : h_tarih like sy-datum obligatory default tarih.

SELECTION-SCREEN END OF BLOCK 3.

INITIALIZATION.

h_tarih = sy-datum + 1.

In this case no need to have one more extra variable. U can directly assign to ur parameter.

In data declaration u can only default hard coded values. But not calculated values. This is because first selection screen will be triggered and later ur calculations. So at the time of selection screen is triggered ur variable dont have any value. Thats why it was not working. Change ur code to like above. It will work fine.

Thanks,

Vinod.

Edited by: Vinod Reddy Vemuru on Jun 27, 2008 12:37 PM

6 REPLIES 6
Read only

vinod_vemuru2
Active Contributor
0 Likes
7,154

Hi,

Do it in INITIALIZATION event.

SELECTION-SCREEN BEGIN OF BLOCK 3 WITH FRAME TITLE TEXT-002.

parameters : h_tarih like sy-datum obligatory default tarih.

SELECTION-SCREEN END OF BLOCK 3.

INITIALIZATION.

h_tarih = sy-datum + 1.

In this case no need to have one more extra variable. U can directly assign to ur parameter.

In data declaration u can only default hard coded values. But not calculated values. This is because first selection screen will be triggered and later ur calculations. So at the time of selection screen is triggered ur variable dont have any value. Thats why it was not working. Change ur code to like above. It will work fine.

Thanks,

Vinod.

Edited by: Vinod Reddy Vemuru on Jun 27, 2008 12:37 PM

Read only

Former Member
0 Likes
7,153

Hi,

Check the below codee....

SELECTION-SCREEN BEGIN OF BLOCK 3 WITH FRAME TITLE TEXT-002.

parameters : h_tarih like sy-datum obligatory .

SELECTION-SCREEN END OF BLOCK 3.

initialization.

h_tarih = sy-datum + 1.

Rgds,

Bujji

Read only

Former Member
0 Likes
7,153

DATA : tarih like sy-datum.

SELECTION-SCREEN BEGIN OF BLOCK 3 WITH FRAME TITLE TEXT-002.

parameters : h_tarih like sy-datum obligatory default tarih.

SELECTION-SCREEN END OF BLOCK 3.

at selection-screen output .

tarih = sy-datum + 1.

Try this...

Reward if useful...

Thanks,

Durai.V

Read only

Former Member
0 Likes
7,153

Hi,

Go to the variants.

If it is ECC6.0, select the date field.

F4 on selection variable -> select dynamic date calculation

F4 on Name of variable -> select from option availalbe and enter the no. of days.

Execute the prg with the variant.

Regards,

Subramanian

Edited by: Subramanian PL on Jun 27, 2008 12:09 AM

Read only

Former Member
0 Likes
7,153

sometime we shouldn't forget about 'append'

e.g.

INITIALIZATION.

   PNPBUKRS-SIGN = 'I'.

   PNPBUKRS-OPTION   = 'EQ'.

   PNPBUKRS-LOW   = 'ABCD'.

   append PNPBUKRS to PNPBUKRS.

Read only

Former Member
0 Likes
7,153

This message was moderated.