Skip to Content
0
Former Member
Jul 12, 2012 at 07:04 PM

Select query using select options and parameters?

17 Views

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 7 LTAP-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)