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: 

how to set default value in select option for ABAP query

Former Member
0 Kudos

Hi experts,

What is the way to set up default values for select-options in ABAP query.

e.g.

I have one field 'Year' in my ABAP query selection screen.

I want value of current year to be appeared here whenever user execute report

Thanks in Advance

-Harkamal

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Harkamal,

execute your Query via SQ01. On Selection-Screen

goto save Variant. Mark your field

as selection variable an press Button election variable.

Take variable from TVARV and use it.

Than save the Variant.

Look at TVARV if the 'Year' is updated to the actualYear!

regards, Dieter

5 REPLIES 5

former_member181962
Active Contributor
0 Kudos

In Initialization event do this.

Initialization.

s_year-low = sy-datum+0(4).

s_year-sign = 'I'.

s_year-option = 'EQ'.

append s_year.

clear s_year.

Regards,

ravi

Former Member
0 Kudos

I m looking for only <b>ABAP Query</b> not the ordinary classical report.

As standard program was generated i cant modify this.

Please let me know the way to add default value for select ooptions in ABAP query only

0 Kudos

Sorry for that.

Check Srikrishna's answer in this link:

Regards,

Ravi

Former Member
0 Kudos

Former Member
0 Kudos

Hi Harkamal,

execute your Query via SQ01. On Selection-Screen

goto save Variant. Mark your field

as selection variable an press Button election variable.

Take variable from TVARV and use it.

Than save the Variant.

Look at TVARV if the 'Year' is updated to the actualYear!

regards, Dieter