‎2007 May 09 6:20 PM
hi
I have a selection screen where i have 5 select options. only 2 are obligatory. I need to get data from tables vbrk vbrp kna1 and some more.
my question is how to write the where condition, when joining these tables as the non-obligatory selections May or May not have data ( or 1-2 might have them )
thanks
‎2007 May 09 6:27 PM
if the selection parameters are select-options, u dont have to worry about that.
system will automatically take care of it...
sample..
where
vbeln in s_vbeln and
kunnr in s_kunnr.
if s_kunnr is blank..it will select for all kunnr, else, for the specified kunnr s only
‎2007 May 09 6:35 PM
thanks for ur quick reply.
so according to u the following code should work ?
SELECT *
FROM vbrk
INNER JOIN vbrp ON vbrkvbeln = vbrpvbeln
INNER JOIN kna1 ON vbrkkunag = kna1kunnr
INTO corresponding fields of TABLE itab
WHERE
vbrkvbeln in p_vbeln and vbrkkunag in p_kunag and vbrpmatnr in p_matnr and vbrpaugru_auft in p_augru and vbrk~fkdat in P_fkdat
i had one more question , one of the select options is date , so i need to get reports genrated within the 2 dates . how do i write it .
thanks again
‎2007 May 09 6:51 PM
‎2007 May 09 7:16 PM
Hi,
I think you should use s_fkdat.
Declare s_fkdat in selection screen like,
SELECT-OPTIONS: S_FKDAT FOR VBRK-FKDAT.
So that you can get data in the date range specified.
Thanks,
Veni.
‎2007 May 09 11:53 PM
thank you all for ur quick replies . i have given points for all. closing this thread.