‎2018 May 03 7:51 AM
Hi All,
Below query is taking more time.
SELECT fkimg matnr werks edatu
FROM vbrp
INTO TABLE gt_vbrp
FOR ALL ENTRIES IN zimport_matnr
WHERE matnr = zimport_matnr-matnr
AND edatu >= zstart_edatu
AND edatu <= zend_edatu
AND fkimg > 0.
Can someone help in getting time reduced for the above query.
‎2018 May 03 10:16 AM
‎2018 May 03 10:16 AM
‎2018 May 03 11:04 AM
‎2018 May 08 11:30 AM
Good Luck. You need to change your requirement to read the VBRK record first as I stated previously. Going down this path will not get the results you want.
‎2018 May 03 12:52 PM
Dear Vidhya,
Try this,
Data: zimp_mat type zimport_matnr-matnr.
SELECT fkimg matnr werks edatu
FROM vbrp
INTO TABLE gt_vbrp
FOR ALL ENTRIES IN zimport_matnr
WHERE matnr = zimp_mat
AND edatu >= zstart_edatu
AND edatu <= zend_edatu
AND fkimg > 0.
‎2018 May 05 2:20 AM
Hi Vidyaprasanna,
However, check the possibility to retrieve using primary key.
Depends on the scenario implement ABAP Inner JOIN reading header Vs Item.
Also consider working with SAP transaction ST05 (SQL trace) and analysing the explain.
After that you can determine which secondary index is better for this scenario as well as If will be possible to implement %_HINTS...
Regards,
‎2018 May 05 3:27 AM
This is always going to take a long time as you are reading VBRP without the main key fields - VBELN and POSNR. You should look to read VBRK first based on some selections you can make and then read the VBRP for the records you retrieved. This will speed your selection considerably.
Never a good idea to read an item table before reading the header table. You should read HEADER then ITEM or both if you have a join and have fields to select records on.
Thanks
Phil Cooley
‎2018 May 07 2:42 AM