Application Development and Automation 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: 
Read only

select statement

Former Member
0 Kudos
404

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Kudos
372

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

5 REPLIES 5
Read only

Former Member
0 Kudos
373

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

Read only

0 Kudos
372

Yes u r right, It_blpk was initial because I am usng the selecting criteria for it_blpk.

Thanks,

Shejal.

Read only

Former Member
0 Kudos
372

Got it.

Read only

ferry_lianto
Active Contributor
0 Kudos
372

Hi,

Please ensure to check internal table it_blpk is not empty before select statement.

CHECK NOT it_blpk[] IS INITIAL.

...

Regards,

Ferry Lianto

Read only

Former Member
0 Kudos
372

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