Quantcast
Viewing latest article 2
Browse Latest Browse All 9080

Is it correct - For All Entries syntax

Hello Experts,

 

To begin with I have written a for all entries query in a way ( which is new to me ) and hence want to get opinion on the same.

Just to mention before judging, the RESULTS are correct with this syntax.

 

Scenario: Dealing with PO + MRP tables - EKPO, MDKP, MDTB

Lets say I have 1 internal table with T_PO_MRP wherein I have somehow collected data in 4 columns - MATNR,DISPO,DELNR,DELPS.

 

SELECT 

               mdkp~matnr

               mdkp~plwrk

                   ******              

                mdtb~delps

               mdtb~umdat

               mdtb~dat00

              INTO TABLE t_mrpdetail

              FROM mdkp

              INNER JOIN mdtb

            ON  mdkp~dtnum = mdtb~dtnum

         FOR ALL ENTRIES IN t_po_mrp

          WHERE  mdkp~dtart = c_dtart

          AND    ( ( mdkp~matnr = t_po_mrp-matnr AND mdkp~dispo = t_po_mrp-dispo ) )

          OR

          ( mdtb~delnr = t_po_mrp-delnr

           AND mdtb~delps = t_po_mrp-delps ) ) "from PO and MRP tables

          AND    mdkp~plwrk = p_plwrk

          AND    mdkp~plscn = c_plscn.

 

So basically, I am using 2 different key combination in FOR ALL entries syntax.

 

Question: is it expensive DB query? If yes, then i have to break it to 2 MDTB queries, wont that be more expensive?

Is this kind of query allowed in ABAP - plz remember, I am getting correct data from this query.

 

just fyi, I am taking care of the null COLUMNs in the internal table by passing '*' to them before for all entries.

 

ABAP Experts, plz let me know you inputs.

 

ags.


Viewing latest article 2
Browse Latest Browse All 9080

Trending Articles