2008 Dec 17 10:29 AM
Moderator message: do not post the same question in two forums. Duplicate (together with answers) deleted.
SELECT a~grant_nbr
a~zzdonorfy
a~company_code
b~language
b~short_desc
INTO TABLE i_gmgr_text
FROM gmgr AS a
INNER JOIN gmgrtexts AS b ON a~grant_nbr = b~grant_nbr
WHERE a~grant_nbr IN s_grant
AND a~zzdonorfy IN s_dono
AND b~language EQ sy-langu
AND b~short_desc IN s_cont.
How to use for all all entries in the above inner join for better performance?
then....
IF sy-subrc EQ 0.
SORT i_gmgr_text BY grant_nbr.
ENDIF.
IF i_gmgr_text[] IS NOT INITIAL.
* Actual Line Item Table
SELECT rgrant_nbr
gl_sirid
rbukrs
rsponsored_class
refdocnr
refdocln
FROM gmia
INTO TABLE i_gmia
FOR ALL ENTRIES IN i_gmgr_text
WHERE rgrant_nbr = i_gmgr_text-grant_nbr
AND rbukrs = i_gmgr_text-company_code
AND rsponsored_class IN s_spon.
IF sy-subrc EQ 0.
SORT i_gmia BY refdocnr refdocln.
ENDIF.
Edited by: Matt on Dec 17, 2008 1:40 PM
2008 Dec 19 11:18 AM
> As performance point of view innner join is not good. To improve performance you have to made two
> internal table.And make for all entries in the second internal table.like this
please stop writing nonsense recommendations! Did you ever test what you write ... I guess no.
.
2008 Dec 17 12:42 PM
Do not post the same question in two forums. Do surround your abap with tags.
Now. Why on earth do you think that "for all entries" is better performing that "inner joins".
( and anyone who just posts an answer, rewriting the posters code with "for all entries", will have their reply rejected, unless they justify why their code is better ).
2008 Dec 18 9:33 AM
> How to use for all all entries in the above inner join for better performance?
my best christmas recommendation for performance, simply ignore such recommendations.
And check the performance of your join!
Is the performance really low, if it is then there is probably no index support. Without indexes FOR ALL ENTRIES will be much slower.
Siegfried
2008 Dec 19 7:39 AM
2008 Dec 19 9:04 AM
As performance point of view innner join is not good. To improve performance you have to made two internal table.And make for all entries in the second internal table.like this
.
2008 Dec 19 11:18 AM
> As performance point of view innner join is not good. To improve performance you have to made two
> internal table.And make for all entries in the second internal table.like this
please stop writing nonsense recommendations! Did you ever test what you write ... I guess no.
.