SAP Function SD_SALESDOCUMENT_CREATE - Creating a Sales and Distribution Document

Parameter Reference Type Length Default Optional Text
BEHAVE_WHEN_ERROR BAPIFLAG-BAPIFLAG C 1 SPACE X Error Handling
BINARY_RELATIONSHIPTYPE BRELTYP-RELTYPE C 4 SPACE X Binary Relationship Type (Private)
BUSINESS_OBJECT BAPIUSW01-OBJTYPE C 10 SPACE X Business Object
CALL_ACTIVE CHAR4 C 4 SPACE X
CONVERT_PARVW_AUART BAPIFLAG-BAPIFLAG C 1 SPACE X Conversion of Partner Function and Order Type
INT_NUMBER_ASSIGNMENT BAPIFLAG-BAPIFLAG C 1 SPACE X Internal Item Number Assignment
LOGIC_SWITCH BAPISDLS u 5 SPACE X Internal Control Parameter BAPISDLS
SALESDOCUMENT BAPIVBELN-VBELN C 10 X Sales and Distribution Document Number
SALES_HEADER_IN BAPISDHD1 u 918 Document Header Data
SALES_HEADER_INX BAPISDHD1X u 120 X Header Data Checkboxes
SENDER BDI_LOGSYS u 10 X Logical System - Sender
STATUS_BUFFER_REFRESH BAPIFLAG-BAPIFLAG C 1 'X' X Initialization of Status Buffer
TESTRUN BAPIFLAG-BAPIFLAG C 1 X Test Run

Parameter Reference Type Length Text
SALESDOCUMENT_EX BAPIVBELN-VBELN C 10 Number of Generated Document
SALES_HEADER_OUT BAPISDHD u 817 BAPI Structure of VBAK with English Field Names
SALES_HEADER_STATUS BAPISDHDST u 97 BAPI Structure of VBUK with English Field Names

Parameter Reference Length Optional Text
BATCH_CHARC BAPIBTSEL 293 X BAPI Transfer Structure Selection Data CRM -> ERP
BUSINESS_EX BAPISDBUSI 672 X BAPI Structure of VBKD with English Field Names
CAMPAIGN_ASGN BAPISDCA 52 X BAPI Structure for Table CMPB_ASGN
CONDITIONS_EX BAPICOND 336 X Communication Fields for Maintaining Conditions in the Order
CONDITIONS_KONV_EX KONV 272 X Conditions (Transaction Data)
EXTENSIONEX BAPIPAREX 990 X Reference Structure for BAPI Parameters ExtensionIn/ExtensionOut
EXTENSIONIN BAPIPAREX 990 X Customer Enhancment Import
INCOMPLETE_LOG BAPIINCOMP 122 X Communication Fields: Incompletion
ITEMS_EX BAPISDIT 1408 X Structure of VBAP with English Field Names
PARTNERADDRESSES BAPIADDR1 1574 X BAPI Reference Structure for Addresses (Org./Company)
PARTNERS_EX BAPISDPART 180 X BAPI Structure of VBPA with English Field Names
RETURN BAPIRET2 548 X Return Messages
SALES_CCARD BAPICCARD 268 X Credit Card Data
SALES_CFGS_BLOB BAPICUBLB 256 X Configuration: BLOB Internal Data (SCE)
SALES_CFGS_INST BAPICUINS 233 X Configuration: Instances
SALES_CFGS_PART_OF BAPICUPRT 123 X Configuration: Part-of Specifications
SALES_CFGS_REF BAPICUCFG 397 X Configuration: Reference Data
SALES_CFGS_REFINST BAPICUREF 20 X Configuration: Reference Item / Instance
SALES_CFGS_VALUE BAPICUVAL 276 X Configuration: Characteristic Values
SALES_CFGS_VK BAPICUVK 55 X Configuration: Variant Condition Key
SALES_CONDITIONS_IN BAPICOND 336 X Conditions
SALES_CONDITIONS_INX BAPICONDX 46 X Conditions Checkbox
SALES_CONTRACT_IN BAPICTR 129 X Contract Data
SALES_CONTRACT_INX BAPICTRX 28 X Checkbox: Contract Data
SALES_ITEMS_IN BAPISDITM 1622 X Item Data
SALES_ITEMS_INX BAPISDITMX 195 X Item Data Checkboxes
SALES_KEYS BAPISDKEY 189 X Output Table of Reference Keys
SALES_PARTNERS BAPIPARNR 664 X Document Partner
SALES_SCHEDULES_IN BAPISCHDL 198 X Schedule Line Data
SALES_SCHEDULES_INX BAPISCHDLX 109 X Checkbox Schedule Line Data
SALES_SCHED_CONF_IN BAPISCHDL2 91 X Schedule Line Data Confirmation
SALES_TEXT BAPISDTEXT 160 X Texts
SCHEDULE_EX BAPISDHEDU 344 X Struture of VBEP with English Field Names
TEXTHEADERS_EX BAPISDTEHD 385 X BAPI Structure of THEAD with English Field Names
TEXTLINES_EX BAPITEXTLI 232 X BAPI Structure for STX_LINES Structure

Functionality
You can use this method to create SD documents with items, schedulelines, and item conditions.
You must specify order header data (using structure ORDER_HEADER_IN) andpartner data (using table ORDER_PARTNERS) as input parameters.
Use table ORDER_ITEMS_IN to specify item data. You can carry out theitem number assignment manually by filling the appropriate fields, orthe system executes it automatically based on the Customizing settingsif you leave the corresponding fields initial. If you decide to usemySAP ERP for the item number assignment, no schedule lines orconditions can be specified since there is no recognizable correlationbetween them and the item.
If the items are configurable, you must specify the configuration datain tables ORDER_CFGS_REF, ORDER_CFGS_INST, ORDER_CFGS_PART_OF,ORDER_CFGS_VALUE and ORDER_CFGS_BLOB.
You can use structure SALES_SCHEDULE_IN to transfer the schedule linedata.
To specify document conditions for creation, you can use structureSALES_CONDITIONS_IN.
You can use structure SALES_CCARD to transfer credit card data,including both data for card identification and data on an authorizationthat took place in an external system.
Once the SD document has been created successfully, you receive thedocument number (field SALESDOCUMENT_EX).
The system uses the RETURN parameter to notify you of any errors thatoccurred.
Using checkboxes:
Each component of an SD document can be created with or withoutcheckboxes. If you want to use checkboxes, the system only copies fieldswith a value other than SPACE. If you do not want to use checkboxes (theUPDATEFLAG field must be I), the system only copies fields whose valueis 'X'. This way, any fields that were assigned default values by thesystem can be reset to SPACE.

Notes
If you do not want object references to be written, you must initializethe following fields (parameters):
BINARY_RELATIONSHIPTYPE
SALES_HEADER_IN-REFOBJECTTYPE
SALES_HEADER_IN-REFOBJECTKEY
SALES_HEADER_IN-REFDOCTYPE
If item conditions are specified (SALES_CONDITIONS_IN), we recommendspecifying a price date in the header (SALES_HEADER_IN, PRICE_DATE),since the BAPI does not know whether or not the price date will bedetermined automatically. A date might be required so that the conditionrecords can be read successfully.

93091Information about the BAPIs in Sales and Distribution
517767Generate test data for function modules
700795Enhancement category of BAPI enhancement structures
585906ISAWAC31 SP3: Ordering with sales quantity > 1000
368218BAPI saves incorrect document
532913Memory bottleneck internal table FPLT_COND
513301Tax code is not filled
449068Allowed pricing types BAPISDLS-PRICING IV
375016Permitted pricing types for BAPISDLS-PRICING
410907Allowed pricing types BAPISDLS-PRICING III
413658Missing conditions with CREATE BAPI
400295No transfer of product short text
399243Online store with IPC: Error with quotation creation
396596Export tables for SD_SALESDOCUMENT_CREATE
360364Tax calculatn during transfer of documents CRM> R/3
302894Processing of schedule lines in the BAPI