Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

VBFA table access

Former Member
0 Likes
2,131

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.

13 REPLIES 13
Read only

Former Member
0 Likes
1,750

What type of document are you using in your WHERE (delivery, sales order)?? And what type of document are you trying to retrieve???

Rob

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,750

There are many OSS notes available for this query, check notes like [Note 103218 - Performance of document flow, File VBFA|https://service.sap.com/sap/support/notes/103218]

Regards,

Raymond

Read only

0 Likes
1,750

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

Read only

0 Likes
1,750

Sylvain - if you read the notes, why did you end up creating an index?

Rob

Read only

0 Likes
1,750

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.

Read only

0 Likes
1,750

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

Read only

Former Member
0 Likes
1,750

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.

Read only

0 Likes
1,750

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.

Read only

0 Likes
1,750

Hi Khan,

Have you tried the solution of using table LIPS (field : LIPS-VGBEL) instead of VBFA.

Regards

Vinod

Read only

0 Likes
1,750

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,

Read only

Former Member
0 Likes
1,750

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.

Read only

Former Member
0 Likes
1,750

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

Read only

0 Likes
1,750

Moderator message - If your question is answered, please assign po1nts and mark this as closed.

My 2 cents - wrong solution.

Rob