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: 

sq01-default value

Former Member
0 Kudos
1,875

hi,

I have created a query in sq01.I would like to make the selet-option as parameter and assign it sy-datum value as default on selection screen. Is it possible???

6 REPLIES 6

anversha_s
Active Contributor
0 Kudos
278

hi,

check this sample code...

tables: mkpf.

data date like sy-datum.

data date1 like sy-datum.

select-options: s_date for mkpf-budat.

initialization.

CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'

EXPORTING

iv_date = sy-datum

IMPORTING

EV_MONTH_BEGIN_DATE = date

EV_MONTH_END_DATE = date1

.

s_date-option = 'EQ'.

s_date-sign = 'I'.

s_date-low = date.

s_date-high = date1.

append s_date.

so automattically,

low - 1st day of month.

high - last day of month.

chnge accoding to ur requirement.

rgds

anver

if helped mark points

Former Member
0 Kudos
278

open sq01

enter query name in rite area.

go to infoset query.

now u just see the right side window where all the select option come.

thee in option for giving it value in 3rd tab just put the value here.

0 Kudos
278

its taking a value.but i need it to be sy-datum so that everytime it changes according to current date. this is my requirement.is it possible.

0 Kudos
278

i don't think it is possible with that..

but u can make dynamic variant for dat field.

0 Kudos
278

Could you tell me how to do it.

Thanks

0 Kudos
278

sorry for late reply..

1st go to infoset query.

goto--->variant mantinance for tamplate.

Enter the values in the selection screen

2. Save the variant using the SAVE button

3. In the next screen for the date variable select the 'Selection variable' checkbox (L) and click on the button 'Selection variable' in the toolbar.

4. Now you will see this variable in the next screen with 3 types of buttons. Click on the middle button (ie. D - Dynamic date calculation).

5. Click on the down arrow button and select the option 'Current Date'.

6. Save the variant.

noq go to sq01 and run the query.

Kindly assign points if this is helpful.