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

Problem when creating a sales order with reference by BAPI

I am facing one problem when creating Sales Order.

<b>The scenario is like this while creating SO With reference to an Order type, a new SO will be automatically created with a diff order Type</b>.

I am using "BAPI_SALESORDER_CREATEFROMDAT2".

I am calling this BAPI in USEREXIT_REFRESH_DOCUMENT.

Am I using the right exit to call this Bapi ?

<b>Problems are like :

1. Ref Sales Order creating without Sales Unit .

2. "Object Status does not exist" error msg is coming for Header and Item level(when clicking the status tab and then object status pushbutton).</b> But if testing the bapi from SE37 in test sequence....no such problem persists.

As for example in case of sales unit,in the debugging mode i have seen that BAPI uses a perform to fill the values in the VBAP structure.But after that when it come back to the main program VBAP remains blank.This ocuurs when the BAPI is called from the exit whereas if tested from SE37, VBAP retains the value.

Can u suggest in this ? This is very very urgent............

Thx in Adv.........................

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Jun 24, 2007 at 09:58 AM

    Hi,

    Instead of direct call of this BAPI in your user exit try to create an update FM that will call this BAPI in update task. If V1 update fails try V2 update.

    Call your function in the following way:

    CALL FUNCTION 'ZUPDATE' IN UPDATE TASK...

    and when the main program calls COMMIT WORK your FM will be started.

    Of course BAPI_SALESORDER_CREATEFROMDAT2 must not call COMMIT WORK, otherwise you will get a shotdump.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Lets think about a scenario......i am using a exit userexit_save_document in MV45AFZZ.After that commit work is called to save the sales order.If i call a custom function module in update task (in which bapi_salesorder_createfromdat2 is called),then i need not call bapi_transaction_commit and SAP will use the commit work(that is called after the exit as mentioned above) to save bothe sales order.

      Is this what you mean?

      Thanks in advance for your sincere help....

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.