Skip to Content
avatar image
Former Member

BAPI extension for sales order creation

Hi Everyone,

We have a requirement to create sales order upload program.

Normally we can create using "BAPI_SALESORDER_CREATEFROMDAT2".

But we have a requirement to update below mentioned data when we create sales order.

1. Name of Requisitioner/Requester (EBAN - AFNAM)

2.Purchasing Group (EBAN - EKGRP)

3. Price in Purchase Requisition (EBAN - PREIS).

But we dont have feasibility to update this through BAPI, So we are thinking of BAPI extension.

Please help us how to proceed with this.

We also tried this with BDC but since table control is there its not working.

Add comment
10|10000 characters needed characters exceeded

  • Of course you cannot update these fields because they are not part of the sales order. EBAN is the purchase requisition table. You might want to clarify what is it that you are trying to achieve exactly.

  • Former Member Jelena Perfiljeva

    Actually we are trying to create third party sales order.

    in this process when we give PLANT and hit enter then it will take us to to another screen where we have to give the above mentioned field values.

    These three fields are mandatory and due to this even through "BAPI_SALESORDER_CREATEFROMDAT2", It is not getting successful(Sales order is not getting created).

  • Get RSS Feed

3 Answers

  • Oct 31, 2016 at 12:26 PM

    So you call BAPI_SALESORDER_CREATEFROMDAT2 and you want to change some values in the generated PR?

    You could either call BAPI_PR_CHANGE on the generated PRs with, or use user exit USEREXIT_MOVE_FIELD_TO_ME_REQ of include MV45AFZB before PR creation to change the required fields value. (I'm afraid a BAdI like ME_PROCESS_REQ_CUST is not called outside of enjoy transactions and BAPI)


    Add comment
    10|10000 characters needed characters exceeded

  • Nov 02, 2016 at 04:07 PM

    I suspect the items you've mentioned can be configured to be populated automatically (see this post). We use third-party orders but I don't recall such manual step in our process. We have a routine for price calculation.

    Otherwise Google -> BAPI third party order and you'll find some posts that suggest using EXTENSIONIN and mention some related SAP notes. You might want to search Notes as well since there might be newer ones. And there are many SCN posts on using doing BAPI extension in general, look it up.

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 31, 2016 at 11:01 AM

    Create a custom bapi ZBAPI. In that BAPI, call the standard bapi "BAPI_SALESORDER_CREATEFROMDAT2". If you get sales order number as output, then call the BAPI "BAPI_TRANSACTION_COMMIT". After commit bapi has been executed successfully, manually update the above mentioned tables.

    Add comment
    10|10000 characters needed characters exceeded

    • OP clearly stated it's "upload program". This is likely just a standalone ABAP report. There is no indication anywhere in the post that any kind of interface (like RFC, web service and such) or any special functionality is needed.

      From what I see, this does not even call for a special custom FM, much less a custom BAPI (surely you must understand the difference). What you are suggesting is a layer of complexity that is not necessary at all based on the OP.