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: 

Select query using select options and parameters?

Former Member
0 Kudos

I have a7 select option i/p fields(selection criteria) out of which one is mandatory

select op 1

LTAK-BETYP


select op 2

LTAK-BENUM


select op 3

LTAK-BWLVS


select op 4

LTAK-TANUM


select op 5

LTAK-BDATU

mandatory
select op 6

LTAP-NLTYP


select op 7LTAP-GRETR

so i have written my query like

Select A B C D

from LTAK

into table lt_ltak

whereBDATU in so_BDATUandBETYP in SO_BETYPandBENUM in SO_BENUMandBWLVS in SO_BWLVSandTANUM in SO_TANUM.

So according the query above if the user gives mandatory field(bdatu) and any other fields from LTAK table it will work...

now the 2nd query

select X Y Z

from LTAP

into table lt_ltap

for all entries in LTAK

where lgnum = LT_LTAK-LGNUM and NLTYP IN SO_NLTYP and GRETR IN SO_GRETR.

My questions: Is  the 2nd query correct..

  • If the user provides NLTYP and BADTU only as i/p the will both query work? (assumption records are there for the i/p given)
  • If the user provides NLTYP and BADTU and GRETR only as i/p the will both query work? (assumption records are there for the i/p given)
1 REPLY 1

Former Member
0 Kudos

Hi,

Yes both your queries will work. Are you facing any problems? Post your code here if you see any problems.

Regards,

Shravan