Quantcast
Viewing all articles
Browse latest Browse all 3353

Re: Left Outer Join on internal table in ABAP

This approach will display left outer join using FOR ALL ENTRIES testedImage may be NSFW.
Clik here to view.

 

1 . Declare three internal tables - IT_LEFT and IT_RIGHT and IT_JOIN.

2.  Load IT_LEFT with the data in file.

3.  Select records from the DB Table into IT_RIGHT with a For All Entries(FAE) in IT_LEFT.

 

Now, IT_LEFT contains records from the External File,  and IT_RIGHT contains records from the DB Table which have a relation to certain records from IT_LEFT.

 

4. Build table IT_JOIN like given below:

               LOOP at IT_LEFT.

                    MOVE-CORRESPONDING IT_LEFT into IT_JOIN.

                    READ TABLE IT_RIGHT with KEY.. from IT_LEFT value.

                         IF SY-SUBRC = 0.

                              MOVE-CORRESPONDING IT_RIGHT into IT_JOIN.

                         ENDIF.

                    APPEND IT_JOIN.

                   ENDLOOP.

 

IT_JOIN will now contain the LEFT OUTER JOIN for IT_LEFT and IT_RIGHT.


Viewing all articles
Browse latest Browse all 3353

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>