05-13-2015 10:14 AM
SELECT posnr matnr shkzg bdmng meins aufnr
INTO TABLE gt_resb
FROM resb
FOR ALL ENTRIES IN gt_afih
WHERE aufnr = gt_afih-aufnr." AND
"werks = gt_afih-werks and
"posnr NE '0000'.
IF sy-subrc EQ 0.
ENDIF.
Above query is taking too much time.
Please suggest alternative tables from which I can get same data..
Thanks.
Darshan.
05-13-2015 10:21 AM
Hi Darshan,
This query will take much time why because you are not giving primary key in the where conidtion,
If you want to select the data with the same fields which you are mentioning in the where condition better to consult basis people and is there any possibility create secondary index and do the query as
below . then your queryu will run fast.
SELECT posnr matnr shkzg bdmng meins aufnr
INTO TABLE gt_resb
FROM resb
FOR ALL ENTRIES IN gt_afih
WHERE aufnr = gt_afih-aufnr
%_HINTS ORACLE 'INDEX("RESB" "RESB~INDEX NAME")'.
Regards
Mani
05-13-2015 10:24 AM
Hi Darshan,
In RESB table, create the index for AUFNR field.
I suggest to use inner join instead of For all entries
If you are using For all entries, make sure there is no duplication records in gt_afih table.
Regards
Rajkumar Narasimman
05-13-2015 10:26 AM
Hi Darshan,
First Select RSNUM from table AFKO and then pass RSNUM of AFKO in RSEB table .
I think , it is helpful.
Regards,
Nilesh Patel
05-13-2015 10:42 AM
Read 187906 - Performance: Customer developments in PP and PM
Incorrect:
SELECT FROM resb WHERE AUFNR = ...
Correct:
SELECT rsnum FROM afko WHERE aufnr = <resb-aufnr>
SELECT ..... FROM resb WHERE rsnum = <afko-rsnum>
Hint: And focus on JOIN and not FOR ALL ENTRIES.
Regards,
Raymond
05-13-2015 11:25 AM
Thanks for help guys..
I really appreciate your help!!!!..
Thanks,
Darshan.