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 statment-

Former Member
0 Likes
482

Dear all,

Kindly check these select staments. it is correct or not.

SELECT * FROM mkpf appending CORRESPONDING FIELDS OF TABLE itab

WHERE budat IN s_budat AND

blart = 'WE'.

SELECT * FROM mseg APPENDING CORRESPONDING FIELDS OF TABLE itab

FOR ALL ENTRIES IN itab

WHERE mblnr = mkpf-mblnr AND

matnr IN s_matnr.

SELECT * FROM ekpo INTO corresponding field of table itab

FOR ALL ENTRIES IN itab

WHERE ebeln = mseg-ebeln

AND ebelp = mseg-ebelp.

SELECT * FROM rseg INTO corresponding field of table itab

FOR ALL ENTRIES IN itab

WHERE ebeln = ekpo-ebeln AND

ebelp = ekpo-ebelp.

Regards,

Abhay.

4 REPLIES 4
Read only

Former Member
0 Likes
463

These SELECTs are not correct. Here you are using FOR ALL ENTRIES clause. You are trying to extract data from sap tables for all entries of ITAB. But here you need to add condition for ITAB entries in WHERE field. Else it will serve no purpose. Presently it is not clear why are you using FOR ALL ENTRIES clause as it is not been used in SELECTs.

This link shwos usage of FOR ALL ENTRIES clause with example.

http://www.howforge.com/select-for-all-entries-in-abap-4

Read only

Former Member
0 Likes
463

Hi

Instead of appending you can use into itself,i think that will be better.

Reward if useful.

Regards

Shibin

Read only

Former Member
0 Likes
463

hi,

I have checked your all the select statement,

only the first is working but all other are giving error.

Dharmishta

Read only

Former Member
0 Likes
463

Hi Abhay,

Try using select stmts mentioned below.I have been using them for long time n they work properly.Just make the changes by seeing the stmts below.

Reward if useful.

Thanks.

SELECT NAME1 LIFNR INTO TABLE I_TAB2 FROM LFA1 FOR ALL ENTRIES IN I_TAB1 WHERE LIFNR = I_TAB1-F4.

When using for all entries ,no need to write into corresponding fields of table...

SELECT MATNR AEDAT EBELP EBELN NETPR INTO TABLE I_TAB FROM EKPO FOR ALL ENTRIES IN I_TAB1 WHERE EBELN = I_TAB1-F5.

Try this one n these will be working.