Skip to Content
author's profile photo Former Member
Former Member

Performence?? pulling billing # with sales doc #, taking too much time???

Hi Experts,

Am looing to pull vbrp-vbeln i.e. billing doc #, based on the VGBEL i.e. sales doc #

i.e.

select single * from vbrp into wa_vbrp

where vgbel = wa_vbap-vbeln

and posnr = wa_vbap-posnr.

but, as there is no secondary index in vbrp for vgbel and there r tonns of recs in vbrp, its taking too much time?

so, wht is the alternative that i can find billing doc # with my sales doc #?

thanq

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 29, 2008 at 03:08 PM

    Mr. Srinivas,

    Just a suggestion, if you need only the header details, then why not extract data from VBRK (header for billing doc) & VBAK (header for sales doc). These 2 tables contain only single line per billing or sales doc & hence the performance should be better.

    If my suggestion is not what you are looking for, then apologies for the same.

    Regards,

    Vivek

    Alternatively as Mr. Eric suggests, you can use VBFA

    VBFA-VBELN = VBRK-VBELN

    VBFA-VBELV = VBAK-VBELN

    Logic is VBFA-VBELN is the subsequent document & VBFA-VBELV is the preceding document.

    Hope it helps. (but be sure, the document created after sales order is billing document, there might be cases where there could be delivery documents after sales order & before billing document, so be careful)

    Edited by: Vivek on Jan 29, 2008 11:11 PM

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 29, 2008 at 03:04 PM

    hi Srinivas,

    you can try to select from VBFA (SD Document Flow), that might be faster.

    hope this helps

    ec

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.