‎2007 Jun 15 3:25 PM
SELECT vbeln
fkimg
INTO TABLE i_fkimg
FROM vbrp
FOR ALL ENTRIES IN invtab1
WHERE vbrp~vbeln = invtab1-vbeln
AND vbrp~pstyv = 'TAQ'.
I AM RUNNING THIS QUERY BUT WHAT IT IS DOING IS THAT IN CASE FOR AN ORDER IF FOR TWO CONSECUTIVE LINE ITEMS IF THE VALUE OF FKIMG IS SAME
ITS IS PICKING ONLY ONE VALUE OUT OF THE TWO
I JUST WANTED TO KNOW WHETHER ITS IS DUE TO THE PARTNER FUNCTION(~) THAT WE ARE USING OR SOME OTHER ISSUE.
BECAUSE I NEED ALL THE VALUES.
‎2007 Jun 15 3:28 PM
Yes - FOR ALL ENTRIES eliminates duplicates.
You can avoid this by adding posnr to your internal table.
Rob
Message was edited by:
Rob Burbank
‎2007 Jun 15 3:28 PM
Yes - FOR ALL ENTRIES eliminates duplicates.
You can avoid this by adding posnr to your internal table.
Rob
Message was edited by:
Rob Burbank
‎2007 Jun 15 3:30 PM
means its due to FOR ALL ENTRIES it is not taking duplicate values not due to the partner function.
am i getting you correctly.??
if thats the case then my problem is solved..:)
‎2007 Jun 15 4:08 PM
‎2007 Jun 15 3:30 PM
Hello,
This is due to the error in the select query.
Whenever u use the for all entries u need to select all the key fields table.
This is the prerequiste of the FOR ALL ENTRIES
Check this.
SELECT vbeln posnr " Check here
fkimg
INTO TABLE i_fkimg
FROM vbrp
FOR ALL ENTRIES IN invtab1
WHERE vbrp~vbeln = invtab1-vbeln
AND vbrp~pstyv = 'TAQ'.
Vasanth
‎2007 Jun 15 3:31 PM
Hi,
3 major drawbacks of the "for all entries" clause:
1. duplicate rows are automatically removed
2. if the itab used in the clause is empty , all the rows in the source table will be selected .
3. performance degradation when using the clause on big tables.
So you need to use the Joins instead of the For all entries
Regards
Sudheer
‎2007 Jun 15 3:59 PM
Hi
Change ur code like this
SELECT vbeln
fkimg
INTO TABLE i_fkimg
FROM vbrp
FOR ALL ENTRIES IN invtab1
WHERE vbeln = invtab1-vbeln
AND pstyv = 'TAQ'.
Reward me if its helpful
Regards
Ravi