Fonction SAP BAPI_SALESDOCU_CREATEFROMDATA1 - Creating a Sales and Distribution Document

Paramètre Reférence Type Long. Valeur par déf. Facultatif Description
BINARY_RELATIONSHIPTYPE BRELTYP-RELTYPE C 4 'VORL' X Binary Relationship Type (Private)
INT_NUMBER_ASSIGNMENT BAPIFLAG u 1 SPACE X Internal Item Number Assignment
SALESDOCUMENT BAPIVBELN-VBELN C 10 X Sales and Distribution Document Number
SALES_HEADER_IN BAPISDHEAD1 u 768 Document Header Data
SALES_HEADER_INX BAPISDHEAD1X u 102 X Checkbox for Header Data
SENDER BDI_LOGSYS u 10 X Logical System - Sender

Paramètre Reférence Type Long. Description
SALESDOCUMENT_EX BAPIVBELN-VBELN C 10 Number of Generated Document

Paramètre Reférence Long. Facultatif Description
KEY_TABLE BAPISDKEY 189 X
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_VALUE BAPICUVAL 276 X Configuration: Characteristic Values
SALES_CONDITIONS_IN BAPICONDITION 248 X Conditions
SALES_ITEMS_IN BAPISDITEM 1131 X Item Data
SALES_ITEMS_INX BAPISDITEMX 149 X Item Data Checkboxes
SALES_PARTNERS BAPIPARTNR 594 X Document Partner
SALES_SCHEDULES_IN BAPISCHEDULE 182 X Schedule Line Data
SALES_SCHEDULES_INX BAPISCHEDULEX 105 X Checkbox Schedule Line Data

Functionality
Using this method, you can create sales documents with items, schedulelines and item conditons.
You must enter at least sales order header data (via structure ORDER_HEADER_IN), and partner data (via the table ORDER_PARTNERS) as inputparameters.
Enter the item data via the table ORDER_ITEMS_IN. You can enter theitem number manually, by filling out the relevant fields, orautomatically, corresponding to Customizing, by leaving the relevantfields blank. If you decide to enter the item number using R/3, youcannot enter any schedule lines or conditions, as these cannot belinked to the corresponding item. If you are dealing with configurableitems, you must enter the configuration data in the tablesORDER_CFGS_REF, ORDER_CFGS_INST, ORDER_CFGS_PART_OF, ORDER_CFGS_VALUEand ORDER_CFGS_BLOB.
Scheduling data can be published via the structure SALES_SCHEDULE_IN.
Document conditions to be created can be entered via the structureSALES_CONDITIONS_IN .
Credit card data can be published via the structure SALES_CCARD, cardidentification data on the one hand, and data regarding anauthorization which has taken place in an external system, on theother.
After you have created the sales document successfully, you willreceive the document number (SALESDOCUMENT_EX field).
Any errors that might occur are announced via the parameter RETURN.
Using the checkbox:
The individual components of a sales document can be generated with orwithout a checkbox. If you decide on the first possibility, only fieldswhich have unmatching SPACE are copied. In the second case (fieldUPDATEFLAG for checkbox must be 1), only fields which have an 'X' inthe box are copied. This allows fields which have been preassigned todefault values to be set on SPACE again.

Notes
If no object references are to be written, the following fields(parameters) should be initialized:
BINARY_RELATIONSHIPTYPE
SALES_HEADER_IN-REFOBJECTTYPE
SALES_HEADER_IN-REFOBJECTKEY
SALES_HEADER_IN-REFDOCTYPE
If item conditions (SALES_CONDITIONS_IN) are entered, then it isrecommended that you enter a pricing date in the headerSALES_HEADER_IN, PRICE_DATE), as the BAPI does not know whether apricing date is automatically determined. In order to be able to readthe condition record successfully, a date is necessary in certaincases.

Description
The parameter sends back the sales document number, which has beengenerated by the BAPI.

Description
This parameter contains the data for the sales document header.

Description
The Return code for the function module is sent back in this structure.
How the structure is organized
TYPE Declaration type: S Success, E Error, W Warning, I Information
CODE Notification code
MESSAGE Message type
LOG_NO Application log: Log number
LOG_MSG_NO Application log: Number of the message

Value range
If no error occurs, the Return parameter is blank. Otherwise, the
relevant error messages are issued with short text.

Description
This parameter contains the item input data for the sales document.

495964Check incorrect date in the BAPI