SAP BAPI_SALESORDER_CREATEBOS Function Module for Create Sales Order with BOS
BAPI_SALESORDER_CREATEBOS is a standard bapi salesorder createbos SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Create Sales Order with BOS processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.
See here to view full function module documentation and code listing for bapi salesorder createbos FM, simply by entering the name BAPI_SALESORDER_CREATEBOS into the relevant SAP transaction such as SE37 or SE38.
Function Group: 2032001
Program Name: SAPL2032001
Main Program: SAPL2032001
Appliation area: V
Release date: 25-Jun-2001
Mode(Normal, Remote etc): Remote-Enabled
Update:

Function BAPI_SALESORDER_CREATEBOS pattern details
In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.CALL FUNCTION 'BAPI_SALESORDER_CREATEBOS'"Create Sales Order with BOS.
EXPORTING
* SALESDOCUMENTIN = "Sales Document Number
* COSTINGVARIANT = "Costing Variant
ORDERHEADERIN = "Document Header Data
* ORDERHEADERINX = "Checkbox for header data
* SENDER = "Logical system - Sender
* BINARYRELATIONSHIPTYPE = ' ' "Binary Relationship Type (Private)
* INTNUMBERASSIGNMENT = ' ' "Internal item number assignment
* BEHAVEWHENERROR = ' ' "Error Handling
* LOGICSWITCH = "Internal control parameter
* TESTRUN = "Simulation mode
IMPORTING
SALESDOCUMENT = "Number of Generated Document
TABLES
* RETURN = "Return Messages
* ORDERCFGSPARTOF = "Configuration: Part-of Specifications
* ORDERCFGSVALUE = "Configuration: Characteristic values
* ORDERCFGSBLOB = "Configuration: BLOB internal data (SCE)
* ORDERCFGSVK = "Configuration: Variant condition key
* ORDERCFGSREFINST = "Configuration: Reference item / instance
* ORDERCCARD = "Credit Card Data
* ORDERTEXT = "Texts
* ORDERKEYS = "Output Table of Reference Keys
* EXTENSIONIN = "Customer Enhancment Import
* ORDERSERVICES = "Services
* ORDERITEMSIN = "Item Data
* ORDERSERVICESTEXT = "Service Texts
* ORDERSERVICESCOND = "Service Conditions
* ORDERCOSTITEMS = "Communication Fields: Sales Document Item With BOS & Costing
* ORDERCOSTMODEL = "Communication Fields: Sales Document Item With BOS & Costing
* ORDERMODELVALUE = "BOS ECP : Structure for Characteristic Value Assignment
* PARTNERADDRESSES = "BAPI Reference Structure for Addresses (Org./Company)
* ORDERITEMSINX = "Checkbox Item Data
ORDERPARTNERS = "Partner Data
* ORDERSCHEDULESIN = "Schedule Lines
* ORDERSCHEDULESINX = "Checkbox Structure: Schedule Lines
* ORDERCONDITIONSIN = "Conditions
* ORDERCFGSREF = "Configuration: Reference data
* ORDERCFGSINST = "Configuration: Instances
IMPORTING Parameters details for BAPI_SALESORDER_CREATEBOS
SALESDOCUMENTIN - Sales Document Number
Data type: BAPIVBELN-VBELNOptional: Yes
Call by Reference: No ( called with pass by value option)
COSTINGVARIANT - Costing Variant
Data type: ESLL-KLVAROptional: Yes
Call by Reference: No ( called with pass by value option)
ORDERHEADERIN - Document Header Data
Data type: BAPISDHD1Optional: No
Call by Reference: No ( called with pass by value option)
ORDERHEADERINX - Checkbox for header data
Data type: BAPISDHD1XOptional: Yes
Call by Reference: No ( called with pass by value option)
SENDER - Logical system - Sender
Data type: BAPI_SENDEROptional: Yes
Call by Reference: No ( called with pass by value option)
BINARYRELATIONSHIPTYPE - Binary Relationship Type (Private)
Data type: BAPIRELTYPE-RELTYPEDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
INTNUMBERASSIGNMENT - Internal item number assignment
Data type: BAPIFLAG-BAPIFLAGDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
BEHAVEWHENERROR - Error Handling
Data type: BAPIFLAG-BAPIFLAGDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
LOGICSWITCH - Internal control parameter
Data type: BAPISDLSOptional: Yes
Call by Reference: No ( called with pass by value option)
TESTRUN - Simulation mode
Data type: BAPIFLAG-BAPIFLAGOptional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for BAPI_SALESORDER_CREATEBOS
SALESDOCUMENT - Number of Generated Document
Data type: BAPIVBELN-VBELNOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for BAPI_SALESORDER_CREATEBOS
RETURN - Return Messages
Data type: BAPIRET2Optional: Yes
Call by Reference: Yes
ORDERCFGSPARTOF - Configuration: Part-of Specifications
Data type: BAPICUPRTOptional: Yes
Call by Reference: Yes
ORDERCFGSVALUE - Configuration: Characteristic values
Data type: BAPICUVALOptional: Yes
Call by Reference: Yes
ORDERCFGSBLOB - Configuration: BLOB internal data (SCE)
Data type: BAPICUBLBOptional: Yes
Call by Reference: Yes
ORDERCFGSVK - Configuration: Variant condition key
Data type: BAPICUVKOptional: Yes
Call by Reference: Yes
ORDERCFGSREFINST - Configuration: Reference item / instance
Data type: BAPICUREFOptional: Yes
Call by Reference: Yes
ORDERCCARD - Credit Card Data
Data type: BAPICCARDOptional: Yes
Call by Reference: Yes
ORDERTEXT - Texts
Data type: BAPISDTEXTOptional: Yes
Call by Reference: Yes
ORDERKEYS - Output Table of Reference Keys
Data type: BAPISDKEYOptional: Yes
Call by Reference: Yes
EXTENSIONIN - Customer Enhancment Import
Data type: BAPIPAREXOptional: Yes
Call by Reference: No ( called with pass by value option)
ORDERSERVICES - Services
Data type: BAPISDESLLCBOSOptional: Yes
Call by Reference: Yes
ORDERITEMSIN - Item Data
Data type: BAPISDITMBOSOptional: Yes
Call by Reference: Yes
ORDERSERVICESTEXT - Service Texts
Data type: BAPIESLLTXOptional: Yes
Call by Reference: Yes
ORDERSERVICESCOND - Service Conditions
Data type: BAPIBOSCDOptional: Yes
Call by Reference: Yes
ORDERCOSTITEMS - Communication Fields: Sales Document Item With BOS & Costing
Data type: BAPIBOSCOSTOptional: Yes
Call by Reference: Yes
ORDERCOSTMODEL - Communication Fields: Sales Document Item With BOS & Costing
Data type: BAPIBOSCOSTMODELOptional: Yes
Call by Reference: Yes
ORDERMODELVALUE - BOS ECP : Structure for Characteristic Value Assignment
Data type: BAPIBOSCOSTMODEL_CHARA_VALUEOptional: Yes
Call by Reference: Yes
PARTNERADDRESSES - BAPI Reference Structure for Addresses (Org./Company)
Data type: BAPIADDR1Optional: Yes
Call by Reference: Yes
ORDERITEMSINX - Checkbox Item Data
Data type: BAPISDITMXBOSOptional: Yes
Call by Reference: Yes
ORDERPARTNERS - Partner Data
Data type: BAPIPARNROptional: No
Call by Reference: Yes
ORDERSCHEDULESIN - Schedule Lines
Data type: BAPISCHDLOptional: Yes
Call by Reference: Yes
ORDERSCHEDULESINX - Checkbox Structure: Schedule Lines
Data type: BAPISCHDLXOptional: Yes
Call by Reference: Yes
ORDERCONDITIONSIN - Conditions
Data type: BAPICONDOptional: Yes
Call by Reference: Yes
ORDERCFGSREF - Configuration: Reference data
Data type: BAPICUCFGOptional: Yes
Call by Reference: Yes
ORDERCFGSINST - Configuration: Instances
Data type: BAPICUINSOptional: Yes
Call by Reference: Yes
Copy and paste ABAP code example for BAPI_SALESORDER_CREATEBOS Function Module
The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.| DATA: | ||||
| lt_return | TYPE STANDARD TABLE OF BAPIRET2, " | |||
| lv_salesdocument | TYPE BAPIVBELN-VBELN, " | |||
| lv_salesdocumentin | TYPE BAPIVBELN-VBELN, " | |||
| lv_costingvariant | TYPE ESLL-KLVAR, " | |||
| lt_ordercfgspartof | TYPE STANDARD TABLE OF BAPICUPRT, " | |||
| lt_ordercfgsvalue | TYPE STANDARD TABLE OF BAPICUVAL, " | |||
| lt_ordercfgsblob | TYPE STANDARD TABLE OF BAPICUBLB, " | |||
| lt_ordercfgsvk | TYPE STANDARD TABLE OF BAPICUVK, " | |||
| lt_ordercfgsrefinst | TYPE STANDARD TABLE OF BAPICUREF, " | |||
| lt_orderccard | TYPE STANDARD TABLE OF BAPICCARD, " | |||
| lt_ordertext | TYPE STANDARD TABLE OF BAPISDTEXT, " | |||
| lt_orderkeys | TYPE STANDARD TABLE OF BAPISDKEY, " | |||
| lt_extensionin | TYPE STANDARD TABLE OF BAPIPAREX, " | |||
| lt_orderservices | TYPE STANDARD TABLE OF BAPISDESLLCBOS, " | |||
| lt_orderitemsin | TYPE STANDARD TABLE OF BAPISDITMBOS, " | |||
| lv_orderheaderin | TYPE BAPISDHD1, " | |||
| lt_orderservicestext | TYPE STANDARD TABLE OF BAPIESLLTX, " | |||
| lt_orderservicescond | TYPE STANDARD TABLE OF BAPIBOSCD, " | |||
| lt_ordercostitems | TYPE STANDARD TABLE OF BAPIBOSCOST, " | |||
| lt_ordercostmodel | TYPE STANDARD TABLE OF BAPIBOSCOSTMODEL, " | |||
| lt_ordermodelvalue | TYPE STANDARD TABLE OF BAPIBOSCOSTMODEL_CHARA_VALUE, " | |||
| lt_partneraddresses | TYPE STANDARD TABLE OF BAPIADDR1, " | |||
| lt_orderitemsinx | TYPE STANDARD TABLE OF BAPISDITMXBOS, " | |||
| lv_orderheaderinx | TYPE BAPISDHD1X, " | |||
| lv_sender | TYPE BAPI_SENDER, " | |||
| lt_orderpartners | TYPE STANDARD TABLE OF BAPIPARNR, " | |||
| lt_orderschedulesin | TYPE STANDARD TABLE OF BAPISCHDL, " | |||
| lv_binaryrelationshiptype | TYPE BAPIRELTYPE-RELTYPE, " SPACE | |||
| lt_orderschedulesinx | TYPE STANDARD TABLE OF BAPISCHDLX, " | |||
| lv_intnumberassignment | TYPE BAPIFLAG-BAPIFLAG, " SPACE | |||
| lv_behavewhenerror | TYPE BAPIFLAG-BAPIFLAG, " SPACE | |||
| lt_orderconditionsin | TYPE STANDARD TABLE OF BAPICOND, " | |||
| lv_logicswitch | TYPE BAPISDLS, " | |||
| lt_ordercfgsref | TYPE STANDARD TABLE OF BAPICUCFG, " | |||
| lv_testrun | TYPE BAPIFLAG-BAPIFLAG, " | |||
| lt_ordercfgsinst | TYPE STANDARD TABLE OF BAPICUINS. " |
|   CALL FUNCTION 'BAPI_SALESORDER_CREATEBOS' "Create Sales Order with BOS |
| EXPORTING | ||
| SALESDOCUMENTIN | = lv_salesdocumentin | |
| COSTINGVARIANT | = lv_costingvariant | |
| ORDERHEADERIN | = lv_orderheaderin | |
| ORDERHEADERINX | = lv_orderheaderinx | |
| SENDER | = lv_sender | |
| BINARYRELATIONSHIPTYPE | = lv_binaryrelationshiptype | |
| INTNUMBERASSIGNMENT | = lv_intnumberassignment | |
| BEHAVEWHENERROR | = lv_behavewhenerror | |
| LOGICSWITCH | = lv_logicswitch | |
| TESTRUN | = lv_testrun | |
| IMPORTING | ||
| SALESDOCUMENT | = lv_salesdocument | |
| TABLES | ||
| RETURN | = lt_return | |
| ORDERCFGSPARTOF | = lt_ordercfgspartof | |
| ORDERCFGSVALUE | = lt_ordercfgsvalue | |
| ORDERCFGSBLOB | = lt_ordercfgsblob | |
| ORDERCFGSVK | = lt_ordercfgsvk | |
| ORDERCFGSREFINST | = lt_ordercfgsrefinst | |
| ORDERCCARD | = lt_orderccard | |
| ORDERTEXT | = lt_ordertext | |
| ORDERKEYS | = lt_orderkeys | |
| EXTENSIONIN | = lt_extensionin | |
| ORDERSERVICES | = lt_orderservices | |
| ORDERITEMSIN | = lt_orderitemsin | |
| ORDERSERVICESTEXT | = lt_orderservicestext | |
| ORDERSERVICESCOND | = lt_orderservicescond | |
| ORDERCOSTITEMS | = lt_ordercostitems | |
| ORDERCOSTMODEL | = lt_ordercostmodel | |
| ORDERMODELVALUE | = lt_ordermodeltalue | |
| PARTNERADDRESSES | = lt_partneraddresses | |
| ORDERITEMSINX | = lt_orderitemsinx | |
| ORDERPARTNERS | = lt_orderpartners | |
| ORDERSCHEDULESIN | = lt_orderschedulesin | |
| ORDERSCHEDULESINX | = lt_orderschedulesinx | |
| ORDERCONDITIONSIN | = lt_orderconditionsin | |
| ORDERCFGSREF | = lt_ordercfgsref | |
| ORDERCFGSINST | = lt_ordercfgsinst | |
| . " BAPI_SALESORDER_CREATEBOS | ||
ABAP code using 7.40 inline data declarations to call FM BAPI_SALESORDER_CREATEBOS
The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.| "SELECT single VBELN FROM BAPIVBELN INTO @DATA(ld_salesdocument). | ||||
| "SELECT single VBELN FROM BAPIVBELN INTO @DATA(ld_salesdocumentin). | ||||
| "SELECT single KLVAR FROM ESLL INTO @DATA(ld_costingvariant). | ||||
| "SELECT single RELTYPE FROM BAPIRELTYPE INTO @DATA(ld_binaryrelationshiptype). | ||||
| DATA(ld_binaryrelationshiptype) | = ' '. | |||
| "SELECT single BAPIFLAG FROM BAPIFLAG INTO @DATA(ld_intnumberassignment). | ||||
| DATA(ld_intnumberassignment) | = ' '. | |||
| "SELECT single BAPIFLAG FROM BAPIFLAG INTO @DATA(ld_behavewhenerror). | ||||
| DATA(ld_behavewhenerror) | = ' '. | |||
| "SELECT single BAPIFLAG FROM BAPIFLAG INTO @DATA(ld_testrun). | ||||
Search for further information about these or an SAP related objects