10-10-2008 12:43 PM
Hi,
I have performance Problem in following Select Query :
SELECT VBELN POSNR LFIMG VRKME VGBEL VGPOS
FROM LIPS INTO CORRESPONDING FIELDS OF TABLE GT_LIPS
FOR ALL ENTRIES IN GT_EKPO1
WHERE VGBEL = GT_EKPO1-EBELN
AND VGPOS = GT_EKPO1-EBELP.
as per trace i have analysed that it is fetch the complete table scan from the LIPS table and table contants almost 3 lakh records.
Kindly Suggest what we can do to optimize this query.
Regards,
Harsh
10-10-2008 1:05 PM
It happens because LIPS doesn't have an index to VGBEL (and VGPOS).
Since I think you cannot use VBFA to make an alternative selection you probably have to create an index in LIPS with field MANDT-VGBEL (or vgbel and vgpos, but vgbel is enough I think).
Regards,
Valter Oliveira.
10-10-2008 1:05 PM
It happens because LIPS doesn't have an index to VGBEL (and VGPOS).
Since I think you cannot use VBFA to make an alternative selection you probably have to create an index in LIPS with field MANDT-VGBEL (or vgbel and vgpos, but vgbel is enough I think).
Regards,
Valter Oliveira.
10-10-2008 1:08 PM
types: begin of line,
vbeln type lips-vbeln
posnr type lips-posnr
lfimg type lips-lfimg
vrkme type lips-vrkme
vgbel type lips- vgbel
vgpos type lips-vgpos
end of line.
data: itab type standard table of line,
wa type line.
IF GT_EKPO1[] IS NOT INITIAL.
SELECT VBELN POSNR LFIMG VRKME VGBEL VGPOS
FROM LIPS INTO TABLE ITAB
FOR ALL ENTRIES IN GT_EKPO1
WHERE VGBEL = GT_EKPO1-EBELN
AND VGPOS = GT_EKPO1-EBELP.
ENDIF.
10-10-2008 1:14 PM
INTO CORRESPONDING FIELDS OF TABLE is not a performance problem ! You do what Yogesh proposed (it's better) but won't solve your problem tough.
Regards,
Valter Oliveira.
10-10-2008 2:17 PM
You should be able to use the sales document flow table (VBFA) to do this.
Rob
10-10-2008 7:03 PM
You should be able to use the sales document flow table (VBFA) to do this
Since we are dealing with non SD documents i'm not sure if you can, but I don't have a SAP system here to check it right now.
Regards,
Valter Oliveira.
10-10-2008 7:21 PM
>
> Since we are dealing with non SD documents i'm not sure if you can, but I don't have a SAP system here to check it right now.
Hmmm...
I missed the part about purchase orders, so maybe note 800219 is applicable.
Rob
10-14-2008 10:32 AM
Hi,
The comment made by Valter Oliveira is right. You have to create secondary index for LIPS
10-15-2008 12:23 PM
10-15-2008 6:43 PM
Harsh,
It sure would help others if you could mention how the issue was solved too. Now, thats the idea behind SDN, isnt it?
Regards,
Rashmi.