on 11-29-2007 1:26 PM
Hi,
I have the following code: -
SELECT vbelv "Delivery
posnv "Delivery Item
rfmng "GR Qty
plmin "Sign
INTO TABLE t_gr
FROM vbfa
FOR ALL ENTRIES IN t_deliveries
WHERE vbelv EQ t_deliveries-vbeln
AND posnv EQ t_deliveries-posnr
AND vbtyp_n EQ c_goods_receipt.
The internal table t_deliveries has a single entry. The table VBFA has 5 records for the delivery/item.
When the SQL is executed it returns 4 records. If I amend the code to use the following it returns the 5 records. Has anybody had a similar issue.
LOOP AT t_deliveries INTO st_deliveries.
SELECT vbelv "Delivery
posnv "Delivery Item
rfmng "GR Qty
plmin "Sign
APPENDING TABLE t_gr
FROM vbfa
WHERE vbelv EQ st_deliveries-vbeln
AND posnv EQ st_deliveries-posnr
AND vbtyp_n EQ c_goods_receipt.
ENDLOOP.
you probably have 2 records in VBFA matching your criteriasthe for all entries statement eliminates double records matching those criterias. try use a more qualified key then it will work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
FOR ALL Entries can fatch only the unique rows from the table. So, check in the VBFA for the your inputs and the output fields, you will have only 4 unique records. That's why it is picking up only 4 records.
Try to include one more fields which makes every row as a unique row.
Regards,
Naimesh Patel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
99 | |
9 | |
8 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.