‎2007 Sep 26 6:07 AM
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.
‎2007 Sep 26 6:13 AM
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.
‎2007 Sep 26 6:13 AM
Hi
Instead of appending you can use into itself,i think that will be better.
Reward if useful.
Regards
Shibin
‎2007 Sep 26 6:23 AM
hi,
I have checked your all the select statement,
only the first is working but all other are giving error.
Dharmishta
‎2007 Sep 26 6:23 AM
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.