‎2007 Aug 28 11:32 AM
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
‎2007 Aug 28 11:36 AM
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
‎2007 Aug 28 11:36 AM
If field values are blank make it as "*" in your at selection event
‎2007 Aug 28 11:36 AM
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>
‎2007 Aug 28 11:38 AM
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.
‎2007 Aug 28 11:39 AM
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