‎2010 May 20 3:43 PM
Hi Experts,
I have a section in code due to which it takes longer time to execute. This select statement fetches single record from VBFA table without providing all the primary keys coz i dont have any other option. Due to this, processing takes longer time.
According to the code written, it needs to fetch VBELV field from VBFA for VBELN & POSNN provided.
select vbelv UP TO 1 ROWS
INTO VBFA-VBELV
FROM VBFA
WHERE VBELN = tvbdpl-VBELN
AND POSNN = tvbdpl-POSNR.
ENDSELECT.
I checked that it takes longer time for few document numbers not for all. I need to know why? Please help.
Thanks.
‎2010 May 20 3:59 PM
What type of document are you using in your WHERE (delivery, sales order)?? And what type of document are you trying to retrieve???
Rob
‎2010 May 20 4:02 PM
‎2010 May 20 6:45 PM
Hi
there is no index on vbeln from VBFA.
If you need to access at vbfa with vbeln after reading oss notes you can create an index VBELN
We have created this index without any problem( vbfa > 60.000.000 records)
Best regards
‎2010 May 20 6:53 PM
Sylvain - if you read the notes, why did you end up creating an index?
Rob
‎2010 May 21 7:37 AM
Hi Sylvain,
I didnt find any section in the note where we ned to create the index for VBFA.
Rob - I am using VL03N transaction, provind delivery, giving the output type and wana display the form. But I didnt understand why the performance not affecting for all documents. I encoutered the performance issue for few. And even those douments have not more that 5 material.
reagrds.
‎2010 May 21 7:46 AM
Hi,
I hope the purpose of your select statment based on VBFA is to get the preceeding document number (Sales order number). If you are looking for the reference document number, then fetching the fields VGBEL from LIPS will be helpful.
select vgbel
INTO <variable>
FROM LIPS
WHERE VBELN = tvbdpl-VBELN
AND POSNR = tvbdpl-POSNR.
ENDSELECT.
Regards
Vinod
‎2010 May 21 8:57 AM
Hello,
Generally if you are using some of the Key fields then the problem should not occur.
But try and use the function module "SD_VBFA_SINGLE_READ"
Since this is standard it should work efficiently and also please give input to field "I_VBTYP_N"
( Document category of subsequent document )
This will improve performance.
Regards,
Uday Desai.
‎2010 May 21 9:36 AM
Hi Uday
I am providing the below selection in the FM SD_VBFA_SINGLE_READ
I_VBELN 80593481
I_POSNN 000010
I_VBTYP_N J
But its not giving any output records. I think this Fm works well only if u provide all the selection entries. can you plz check at your end.
According to my senario i need to fetch VBELV.
Regards.
‎2010 May 21 9:42 AM
Hi Khan,
Have you tried the solution of using table LIPS (field : LIPS-VGBEL) instead of VBFA.
Regards
Vinod
‎2010 May 21 2:25 PM
Hi Vinod,
I tried it to search the entries in LIPS and got the same, But I didnt got the permission from my senior to change it for LIPS. They are keen to find some thing else. May be later i convince for this change
Regards,
‎2010 May 21 11:42 AM
Hello,
Yes. I realized this later that you won't get VBELV and that you are trying to find VBELV.
So please try this FM "WB2_VBFA_READ_WITH_VBELN". This will work
if you have VBELN and you don't know what is VBELV.
I had tried this on my system and it works well.
Hope this will solve the issue.
Regards,
Uday Desai.
‎2010 May 26 1:56 AM
Hi
We created following index in table VBFA.
MANDT / VBELN / POSNN
we think this index is useful not only the program but also other program.
Regards,
Gaito
‎2010 May 26 2:08 PM
Moderator message - If your question is answered, please assign po1nts and mark this as closed.
My 2 cents - wrong solution.
Rob