01-30-2015 8:51 AM
Hi,
When i traced the coding below, i am waiting too much.. How can i write this join ? Can you help me ?
BR
SELECT SINGLE b~psmng FROM resb AS a
INNER JOIN afpo AS b ON a~aufnr = b~aufnr
INTO gt_data-stoktanuretim
WHERE a~werks EQ p_werks
AND a~matnr EQ gt_data-matnr
AND a~aufnr NE space
AND a~kdauf EQ gt_data-kdauf
AND a~kdpos EQ gt_data-kdpos.
01-30-2015 10:53 AM
What are you trying to extract, you seem to already have SO, so a simple
select SINGLE psmng
FROM AFPO
WHERE kdauf EQ gt_data-kdauf
AND kdpos EQ gt_data-kdpos.
Could suffice?
Regards,
Raymond
01-30-2015 9:10 AM
Hi Gulsah,
I hope for this case, it is not required to use inner join concept, since we are fetching single entry.. First fetch the value from RESB Table and then fetch from AFPO Table. Try Select UP TO 1 rows instead of select single.
Regards
Rajkumar Narasimman
01-30-2015 9:13 AM
Hi,
I would suggest to get the aufnr values from RESB table into an internal table (since WHERE condition involves the fields taken only from the table RESB) and write another query using FOR ALL ENTRIES to fetch the value of the field psmng from the table AFPO.
I am not saying that for al entries works better than the join but you can see if it results in imporvement in performance.
Hope this helps,
~Athreya
01-30-2015 10:53 AM
What are you trying to extract, you seem to already have SO, so a simple
select SINGLE psmng
FROM AFPO
WHERE kdauf EQ gt_data-kdauf
AND kdpos EQ gt_data-kdpos.
Could suffice?
Regards,
Raymond
01-30-2015 11:45 AM