Create sales order with BAPI_SALESDOCU_CREATEFROMDATA1 or BAPI_SALESORDER_CREATEFROMDAT2

  BAPI

OverView

You can use BAPI_SALESDOCU_CREATEFROMDATA1 or BAPI_SALESORDER_CREATEFROMDAT2 to use when creating purchase order slip with add-on program. Batch input is also possible, but you can control according to customization, Controlling tabbing is quite difficult, so if you want to make it simple, use these BAPIs. In this article, the sample code that can be registered by entering at least this is described, but the required items may differ depending on the customization, so change it according to your own environment and requirements. Would like to have.

Sample Code:BAPI_SALESDOCU_CREATEFROMDATA1

Sample Code:BAPI_SALESORDER_CREATEFROMDAT2

Summary

There is no big difference between these BAPIs, only the structure they use. BAPI_SALESDOCU_CREATEFROMDATA1 is older and BAPI_SALESORDER_CREATEFROMDAT2 is newer. If you think about the future, it is better to develop a program that uses BAPI_SALESORDER_CREATEFROMDAT2. In addition, the external and internal formats must be taken into consideration when using BAPI. For example, in the above example, the unit of quantity is fixed to’ST’, but’PC’ is a value that would come from outside. Be careful to set the value after converting from external to internal if necessary. Other than that, the same thing can be said for dates and items, so let’s consider it when developing.

LEAVE A COMMENT