Fonction SAP BS01_SALESDOCUMENT_CREATE - Creation of a Sales Document with BOS

Paramètre Reférence Type Long. Valeur par déf. Facultatif Description
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 Business object
COSTINGVARIANT ESLL-KLVAR C 4 X Cost Estimate Number for Cost Est. w/o Qty Structure
INT_NUMBER_ASSIGNMENT BAPIFLAG-BAPIFLAG C 1 SPACE X Internal Item Number Assignment
LOGIC_SWITCH BAPISDLS u 5 SPACE X Internal Control Parameter
SALESDOCUMENT BAPIVBELN-VBELN C 10 X Sales Document Number
SALES_HEADER_IN BAPISDHD1 u 918 Document Header Data
SALES_HEADER_INX BAPISDHD1X u 120 X Checkbox for header data
SENDER BAPI_SENDER u 10 X Logical system - Sender
TESTRUN BAPIFLAG-BAPIFLAG C 1 X Test run

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

Paramètre Reférence Long. Facultatif Description
EXTENSIONIN BAPIPAREX 990 X Customer Enhancment Import
RETURN BAPIRET2 548 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_CONTRACT_IN BAPICTR 129 X Contract Data
SALES_CONTRACT_INX BAPICTRX 28 X Checkbox: Contract Data
SALES_ITEMS_IN BAPISDITMBOS 1267 X Item Data
SALES_ITEMS_INX BAPISDITMXBOS 167 X Checkbox Item Data
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_SERVICES BAPISDESLLCBOS 554 X Services
SALES_SERVICES_COND BAPIBOSCD 296 X Service Line Conditions
SALES_SERVICES_COST_ITEMS BAPIBOSCOST 444 X Communication Fields: Sales Document Item With BOS & Costing
SALES_SERVICES_COST_MODEL BAPIBOSCOSTMODEL 36 X Communication Fields: Sales Document Item With BOS & Costing
SALES_SERVICES_MODEL_VAL BAPIBOSCOSTMODEL_CHARA_VALUE 311 X BOS ECP : Structure for Characteristic Value Assignment
SALES_SERVICES_TEXT BAPIESLLTX 158 X Text for Service Line
SALES_TEXT BAPISDTEXT 160 X Texts

Functionality
Using this method you can create customer sales and distributiondocuments.
The minimum input parameters for this are:

  • Order header data (via the structure SALES_HEADER_IN) and

  • Partner data (via the table SALES_PARTNERS)

  • You provide the item data via the table SALES_ITEMS_IN.
    There are two ways to assign the item numbers:
    • Manual - you complete the relevant fields

    • Automatic - the relevant fields remain blank or 0. The item number is
    • in this case assigned according to the customizing settings.
      If they are configurable items you have to provide configuration datain the following tables:
      • SALES_CFGS_REF

      • SALES_CFGS_INST

      • SALES_CFGS_PART_OF

      • SALES_CFGS_VALUE

      • Via the structure BAPICCARD, credit card data can be transferred - thisis data on card identification and on authorization that took place onan external system.
        After creation of the sales order has been effected, you get back thedocument number (field SALESDOCUMENT) and details via the participatingpartner (via the structures SOLD_TO_PARTY, SHIP_TO_PARTY andBILLING_PARTY).
        Errors that may arise are notified via the parameter RETURN.

        Description
        The parameter contains the number of the generated sales document.

        Description
        This parameter controls program behavior if an error arises. Till now,an error caused the BAPI to terminate. This meant if you created anorder with several items and one item was incorrect, the system did notcreate the order..
        By using this parameter, you can create an order even if an item isincorrect.

        Value range
        Space = If any error occurs during processing the program terminates
        immediately and the sales document is not saved.
        P = If an error occurs you can save the sales document. Incorrect
        items are not processed, however the system logs them.
        R = As P, however the sales document is not saved.

        Default
        Space

        Description
        The paramater contains the business object.

        Value range

        • BUS2030 for customer inquiries

        • BUS2031 for customer quotations

        • BUS2032 for sales orders

        • BUS2096 for service entry sheets (debit memo requests)
        • Description
          The parameter activates internal provision of the item number.Sometimes the SAP System has to internally provide an item number, forinstance, for articles when a BOM is exploded in an order.
          &EXAMPLE&
          You have to create an order with two items each with schedule line. Todo this you enter item numbers 10 and 20 in the fields SALES_ITEM_INand SALES_SCHEDULES_IN.
          If the article in item 10 contains a sales BOM, you can trigger it. Inthis case the system creates a sub-item with item number 20. This meansthat the reference from the schedule line to the item is lost.
          Therefore, the item number has to be provided internally.

          Default
          Space: the system tries to create the order with external item numbers.

          Description
          This parameter controls internal program behavior. It is intended to beused to switch off certain processing if data is to be copied externally.
          Example
          Pricing is performed by SPE (Sales Pricing Engine). The results have tobe copied to the sales document. SAP System should not perform pricing.
          This is also valid for SCE (Sales Configuration Engine)

          Value range
          PRICING = G
          The results of external pricing are copied by item. SAP System performspricing by item using Pricing Type G.

          Default
          Space

          Notes
          You can only copy external pricing terms if you use external provisionof the item number.

          Description
          This parameter is for entering a document number if the number isprovided externally.

          Default
          Space = Internal provision of document number.

          Description
          This parameter contains the data from the sales document header.
          Information on the individual parameters is contained in the relevantdata element documentation in the ABAP Dictionary.

          Description
          You use this parameter for the following two activities:

          • Control of the processing functionality by the value in field
          • UPDATEFLAG (change pointer).
            You can enter the following:
            ' ': Create a new sales document
            I : Create a new sales document
            U : Change an existing sales document
            D : Delete an existing sales document
            • Control of field entry by check box fields

            • If you set field UPDATEFLAG, the system only copies those fields fromthe parameter ORDER_HEADER_IN that have an 'X' in the check box.

              Description
              The parameter is a test switch. If you set the switch the system doesnot save the document.

              Value range
              Space = Document is saved
              X = Document is not saved

              Default
              Space

              Description
              This table collects the messages that occur on creating a salesdocument.

              Structure
              TYPE ,,,,Message type: S Success, E Error, W Warning, IInformation
              ID ,,,,Message ID
              NUMBER ,,,,Message number
              MESSAGE ,,Message text
              LOG_NO ,,,,Application log: Log number
              LOG_MSG_NO ,,Application log: sequence number of message
              MESSAGE_V1 ,,Message variable
              MESSAGE_V2 ,,Message variable
              MESSAGE_V3 ,,Message variable
              MESSAGE_V4 ,,Message variable
              PARAMETER ,,Parameter name
              ROW ,,,,Row in parameter
              FIELD ,,,,Field in parameter
              SYSTEM ,,,,System (logical syste) from which message comes.

              Description
              The table contains credit card data, and data for identification andauthorization.
              For a currency-related conversion of the amount field, you have tospecify the currency.

              Description
              This paramater contains condition data.

              Value range
              On entering the fields COND_VALUE and CURRENCY differentiate betweenthe following cases:

              • The calculation rule for the condition is in percent.

              • In this case, leave the fieldd CURRENCY blank, and enter the percent tothe correct decimal place.
                Example: You enter 20% as 20,0000 in field COND_VALUE.
                • The calculation rule for the condition is not in percent.

                • In this case field COND_VALUE is a currency amount field. To obtain thecorrect conversion, you have to enter field CURRENCY or CURRENCY_ISO.The amount must be entered to the correct decimal place.
                  If you do not enter the field CURRENCY or CURRENCY-ISO, the systemassumes the entry is a percentage. However, if the condition type isnot percent, the system calculates the wrong amount.

                  Description
                  This parameter contains the item entry data from the sales document.
                  Information on the individual parameter fields is contained in therelevant data element documentation in the ABAP Dictionary.

                  Description
                  You use this parameter for the following two activities:

                  • Control of the processing functionality by the value in field
                  • UPDATEFLAG (change pointer).
                    You can enter the following:
                    ' ': Create a new sales document item
                    I : Create a new sales document iem
                    U : Change an existing sales document item
                    D : Delete an existing sales document item
                    • Control of field entry by check box fields

                    • If you set field UPDATEFLAG, the system only copies those fields fromthe data parameter that have an 'X' in the check box.

                      Description
                      You enter the partners, such as sold-to party, ship-to party, usingthis table parameter. You can do this on header or item level.
                      You must at least enter a sold-to party on header level. The systemdetermines the other partner functions automatically.
                      You can enter different addresses in the structure. If you do this, youhave to specify the language.

                      Description
                      This parameter contains the scheduling data.
                      Information on the individual parameter fields is contained in therelevant data element documentation in the ABAP Dictionary.
                      Description
                      You use this parameter for the following two activities:
                      Control of the processing functionality by the value in fieldUPDATEFLAG (change pointer).
                      You can enter the following:
                      ' ': Create new schedule lines
                      I : Create new schedule lines
                      U : Change existing schedule lines
                      D : Delete existing schedule lines
                      Control of field entry by check box fields
                      If you set field UPDATEFLAG, the system only copies those fields fromthe data parameters that have an 'X' in the check box.
                      Value range
                      Default

                      Description
                      The table contains the services and outline layouts.
                      A line is marked as an outline line using field OUTL_IND. You assignservice lines to outline lines using fields PCKG_NO (of service line)and SUBPCKG_NO (of outline line).
                      The outline hierarchy is generated using fields LINE_NO and HI_LINE_NO.Field HI_LINE_NO refers to the field LINO_NO of the superior outline inthe hierarchy.
                      Information on individual parameter fields is contained in the relevantdata element documentation in the ABAP Dictionary.

                      Description
                      You transmit service line text in the table. You can transmit:

                      • the valid text type in field TEXT_ID, such as service line text

                      • a SAPscript format key in field TEXT_FORM

                      • the actual text line in field TEXT_LINE

                      • If TEXT_ID is empty the system always generates a line text. IfFORMAT_COL is empty, the system assigns the default format key *.

                        Description
                        The table contains the services and outline layouts for the salesdocument.
                        A line is marked as an outline line using field OUTL_IND. You assignservice lines to outline lines using fields PCKG_NO (of service line)and SUBPCKG_NO (of outline line).
                        The outline hierarchy is generated using fields LINE_NO and HI_LINE_NO.Field HI_LINE_NO refers to the field LINO_NO of the superior outline inthe hierarchy.
                        Information on individual parameter fields is contained in the relevantdata element documentation in the ABAP Dictionary.

1472384BOS SD BAPIs/function modules and CAM addresses (1)