Hi experts!
Select join is a statement in which it is recommended to use when accessing tables on header and item level. It is said that it will optimize database access but i am encountering a problem in which my where clauses don't actually get the correct data.
My code is below:
SELECT-OPTIONS: s_fkdat FOR likp-fkdat OBLIGATORY,
s_vstel FOR likp-vstel,
s_vbeln FOR likp-vbeln,
s_tknum FOR vttk-tknum,
s_knkli FOR likp-knkli.
SELECT a~vbeln
a~fkdat
a~vstel
a~knkli
a~kdgrp
b~vgbel
b~lgmng
b~aufnr
b~pstyv
b~charg
INTO CORRESPONDING FIELDS OF TABLE it_likp
FROM likp AS a
INNER JOIN lips AS b ON a~vbeln EQ b~vbeln
WHERE a~fkdat IN s_fkdat
AND a~vstel IN s_vstel
AND a~vbeln IN s_vbeln
AND a~knkli IN s_knkli
AND a~kdgrp EQ '01'
AND b~vbeln IN s_vbeln
AND b~pstyv EQ 'KLN'
OR b~pstyv EQ 'ZANN'.
It doesn't filter the correct date (s_fkdat) when inputted on the selection screen. For example i inputed the date as this month, it still gets data from other months as supposed to only this month. As far as I know, a lot of people have been encountering this problem. What is the cause for this?
Thanks,
Alex