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

optional parameters on selection screen

Former Member
0 Likes
2,509

hi all,

in my program i have used 4 optional select options on selection screen.

these 4 parameters are used to fetch records from 4 different tables using an inner join.

the problem is if any one of these 4 is left blank by the user,then query fetches no record.

so whats the solution,do i have to query databese multiple times using if not initial condition or what??

Thanks

5 REPLIES 5
Read only

JozsefSzikszai
Active Contributor
0 Likes
1,133

hi kunal,

do you join 4 tables into one select, using the 4 select-options from the selection screen in the where clause?

if the answer if yes, than make the select options mandatory on the selection screen, otherwise pls. clarify what exactly you are doing.

thanks

ec

Read only

former_member253923
Participant
0 Likes
1,133

If field values are blank make it as "*" in your at selection event

Read only

varma_narayana
Active Contributor
0 Likes
1,133

Hii

Incase of the SELECT-OPTIONS : when they are not filled all the records are fetched .

Incase of the PARAMETERS : when they are not filled it will compare with the INITIAL VALUE like SPACE or 0. So it may not return data.

In ur Question you mentioned both..

Post the code if u dont get a solution from the Above explaination.

<b>Reward if Helpful..</b>

Read only

Former Member
0 Likes
1,133

oh well i know THAT problem

if you have a parameter optional, and leave it blank it´s of initial value then.

That means your select looks for the records which have initial state in THAT field.

most probably that is NOT what you want.

One way around this is not to use parameters, but Select options.

Look at the sap-help on select options, there is some addon statement, with which you can make Select options look like a parameter.

Read only

Former Member
0 Likes
1,133

Hi,

You need to use IN operator for the select query then if you left blank then it will pick all the records from the table,

if you want check before the select whether the select-option is initial or not then use the IF NOT INITIAL

Regards

Sudheer