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

FM to get all sales orders

Hi all,

Can you please help me to get the FM providing all sales order header details(VBAK) by giving input as VKORG(Sales Org.), AUART(Order type), ERDAT(Docu. Date).

Thanks!

Regards,

Manojkumar Nagarajan

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jul 05, 2012 at 04:45 AM

    Why do you want FM when you can directly fetch data from table VBAK?

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Manoj

      1. The condition "vbak~erdat LE sy-datum" won't filter any record. Why do you need such condition?

      2. The table vbak has an index on vbak~erdat (vbak~ERD). Hence, the selection based on vbak~erdat is fast.

      To fix your problem, ask your customer and re-check the business logic. "vbak~erdat LE sy-datum" is not a reasonable condition.

      Good Luck.

  • Posted on Jul 05, 2012 at 05:50 AM

    Hi Manoj ,

    SD_SELECT_SALES_DOCUMENTS can help you to get the sales order as you require .

    Remember few things :


    iv_trvog = '0' (0/1/2/3/4 for orders/inquiry/quotation/sch agreement/contract)

    iv_vboff = 'X' (X for Open Orders, for all Orders send IV_VBOFF blank)


    TABLES :


    t_vbmtv = i_final_orders (This table returns the Orders)


    Regards ,

    Yogendra Bhaskar

    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.