2006 Dec 01 7:43 PM
Hello friends,
I amusing this select statement.
In my selection screen i have material number and the material number i am putting in the selection screen does not exist in my data base. So i am excepting it would not pull any results. However it is pulling all records. any suggestions,
SELECT awerks abudat agrund aism03 aaufnr arueck a~rmzhl
astzhl aerzet
bmatnr cverid INTO CORRESPONDING FIELDS OF TABLE itab FROM
afru AS a INNER JOIN afpo AS b ON
aaufnr = baufnr INNER JOIN
mkal AS c ON bmatnr = cmatnr
FOR ALL ENTRIES IN it_blpk
WHERE c~verid = it_blpk-verid
AND a~budat = it_blpk-budat
AND a~erzet = it_blpk-uzeit
and a~werks = it_blpk-werks
and b~matnr = it_blpk-matnr
and a~grund IN s_grund
and ( abudat >= cadatu
and abudat <= cbdatu )
and a~ism03 <> 0
and a~ile03 EQ 'STD'.
thanks ,
shejal.
2006 Dec 01 7:46 PM
Hi,
I believe the material number given in the selection screen is used in a different select statement that populates the internal table it_blpk..
ALso add this...
IF NOT it_blpk[] IS INITIAL.
SELECT awerks abudat agrund aism03 aaufnr arueck a~rmzhl
astzhl aerzet
bmatnr cverid INTO CORRESPONDING FIELDS OF TABLE itab FROM
afru AS a INNER JOIN afpo AS b ON
aaufnr = baufnr INNER JOIN
mkal AS c ON bmatnr = cmatnr
FOR ALL ENTRIES IN it_blpk
WHERE c~verid = it_blpk-verid
AND a~budat = it_blpk-budat
AND a~erzet = it_blpk-uzeit
and a~werks = it_blpk-werks
and b~matnr = it_blpk-matnr
and a~grund IN s_grund
and ( abudat >= cadatu
and abudat <= cbdatu )
and a~ism03 <> 0
and a~ile03 EQ 'STD'.
ENDIF.
Thanks,
Naren
2006 Dec 01 7:46 PM
Hi,
I believe the material number given in the selection screen is used in a different select statement that populates the internal table it_blpk..
ALso add this...
IF NOT it_blpk[] IS INITIAL.
SELECT awerks abudat agrund aism03 aaufnr arueck a~rmzhl
astzhl aerzet
bmatnr cverid INTO CORRESPONDING FIELDS OF TABLE itab FROM
afru AS a INNER JOIN afpo AS b ON
aaufnr = baufnr INNER JOIN
mkal AS c ON bmatnr = cmatnr
FOR ALL ENTRIES IN it_blpk
WHERE c~verid = it_blpk-verid
AND a~budat = it_blpk-budat
AND a~erzet = it_blpk-uzeit
and a~werks = it_blpk-werks
and b~matnr = it_blpk-matnr
and a~grund IN s_grund
and ( abudat >= cadatu
and abudat <= cbdatu )
and a~ism03 <> 0
and a~ile03 EQ 'STD'.
ENDIF.
Thanks,
Naren
2006 Dec 01 7:48 PM
Yes u r right, It_blpk was initial because I am usng the selecting criteria for it_blpk.
Thanks,
Shejal.
2006 Dec 01 7:46 PM
2006 Dec 01 7:48 PM
Hi,
Please ensure to check internal table it_blpk is not empty before select statement.
CHECK NOT it_blpk[] IS INITIAL.
...
Regards,
Ferry Lianto
2006 Dec 01 7:49 PM
Well, you're not showing the connection between what's on your selection screen (material no.) and the contents of it_blpk-matnr. Is this field always blank in the internal table?
Rob