Fonction SAP BS01_SALESORDER_CREATE - Sales Order: Create 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)
INT_NUMBER_ASSIGNMENT BAPIFLAG-BAPIFLAG C 1 SPACE X Internal Item Number Assignment
LOGIC_SWITCH BAPISDLS u 5 SPACE X Internal Control Parameter
ORDER_HEADER_IN BAPISDHD1 u 918 Document Header Data
ORDER_HEADER_INX BAPISDHD1X u 120 X Checkbox for header data
SALESDOCUMENT BAPIVBELN-VBELN C 10 X Sales Document Number
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
ORDER_CCARD BAPICCARD 268 X Credit Card Data
ORDER_CFGS_BLOB BAPICUBLB 256 X Configuration: BLOB internal data (SCE)
ORDER_CFGS_INST BAPICUINS 233 X Configuration: Instances
ORDER_CFGS_PART_OF BAPICUPRT 123 X Configuration: Part-of Specifications
ORDER_CFGS_REF BAPICUCFG 397 X Configuration: Reference data
ORDER_CFGS_REFINST BAPICUREF 20 X Configuration: Reference Item / Instance
ORDER_CFGS_VALUE BAPICUVAL 276 X Configuration: Characteristic values
ORDER_CFGS_VK BAPICUVK 55 X Configuration: Variant Condition Key
ORDER_CONDITIONS_IN BAPICOND 336 X Conditions
ORDER_ITEMS_IN BAPISDITMBOS 1267 X Item Data
ORDER_ITEMS_INX BAPISDITMXBOS 167 X Checkbox Item Data
ORDER_KEYS BAPISDKEY 189 X Output Table of Reference Keys
ORDER_PARTNERS BAPIPARNR 664 X Document partner
ORDER_SCHEDULES_IN BAPISCHDL 198 X Schedule line data
ORDER_SCHEDULES_INX BAPISCHDLX 109 X Checkbox Schedule Line Data
ORDER_SERVICES BAPISDESLLCBOS 554 X Services
ORDER_SERVICES_COND BAPIBOSCD 296 X Service Line Conditions
ORDER_SERVICES_TEXT BAPIESLLTX 158 X Service Line Texts
ORDER_TEXT BAPISDTEXT 160 X Texts
RETURN BAPIRET2 548 Return Messages

Functionality
You can use this function module to create customer orders that containa BOS.
You must enter at least the following as input parameters:

  • Order header data (via structure ORDER_HEADER_IN) and

  • Partner data (via table ORDER_PARTNERS)

  • You enter the item data via table ORDER_ITEMS_IN.
    There are two options for assigning item numbers:
    • Manually - you fill the appropriate fields.

    • Automatically - the appropriate fields remain initial (blank). Item
    • number assignment then takes place according to the settings inCustomizing.
      If you are dealing with configurable materials, you must enter theconfiguration data in the following tables:
      • ORDER_CFGS_REF

      • ORDER_CFGS_INST

      • ORDER_CFGS_PART_OF

      • ORDER_CFGS_VALUE

      • Credit card data can be transferred via structure BAPICCARD; on the onehand credit card identification data and on the other hand data on anauthorization that has taken place in an external system.
        You can transfer BOS data for the order item in the following tables:
        • ORDER_SERVICES

        • ORDER_SERVICES_TEXT (service line texts)
          ORDER_SERVICES_COND (service line conditions)
          Customer fields in tables VBAK, VBAP, VBEP and ESLL can be transferredusing structure EXTENSIONIN.
          After the customer order has been created successfully. you receive itsdocument number (parameter SALESDOCUMENT). Any errors that occur arereturned via parameter RETURN.

          Notes
          Required entries:
          ORDER_HEADER_IN : DOC_TYPE Sales document type
          SALES_ORG Sales organization
          DISTR_CHAN Distribution channel
          DIVISION Division
          ORDER_PARTNERS : PARTN_ROLE Partner role, sold-to party
          PARTN_NUMB Customer number
          ORDER_ITEMS_IN : MATERIAL Material number
          TARGET_QTY Target quantity in sales unit of
          measure
          ORDER_SCHEDULES : REQ_QTY Order quantity in sales unit of
          measure
          You only have to maintain one quantity:
          target quantity or order quantity in sales unit of measure.
          Ship-to party:
          If you do not enter a ship-to party, the following applies:
          ship-to party = sold-to party
          Key words in German:
          The following key words have to be entered in German irrespective of
          the logon language:
          DOC_TYPE
          Sales document type, for example TALV for "Terminauftrag mit
          Leistungsverzeichnis" = standard order with BOS
          PARTN_ROLE
          Partner role, for example, WE for "Warenempfänger" = ship-to party

          Further information
          You can find further information in OSS. Note 93091 contains generalinformation on BAPIs in SD.

          Description
          This parameter contains the number of the SD document created.

          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 ORDER_ITEM_INand ORDER_SCHEDULES_IN.
          If the article in item 10 contains a sales BOM, you can trigger it. In
          this 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 the internal program behaviour. It is designedto switch off specific processes when data is to be transferredexternally.
          Examples: - Pricing has takes place with the SPE (Sales Pricing Engine).
          The results are to be transferred to the SD document.
          No pricing is to take place in the SAP System.
          - The same applies to the SCE (Sales Configuration Engine).

          Value range
          PRICING = G The results of external pricing are transferred item by
          item. In the SAP System, pricing is performed per item
          with the price determination type G.

          Default
          Space

          Note
          The external price conditions can only be used if external item numberassignment is being used.

          Description
          This parameter contains the SD document header data.
          You can find information on the meaning of the individual parameterfields in the appropriate data element documentation in the ABAPdictionary.

          Description
          This parameter is used for the following:

          • Control of the processing functions by the value in field UPDATEFLAG
          • (change indicator)
            ' ': Create a new SD document
            I : Create a new SD document
            U : Change an existing SD document
            D : Delete an existing SD document
            • Control of field entry by checkbox structures

            • If field UPDATEFLAG is set, only the fields of parameterORDER_HEADER_IN with an "X" in the checkbox strcutre are transferred.

              Description
              This parameter is used for entering a document number (externaldocument
              number assignment).

              Default
              Space = internal document number assignment

              Description
              This parameter is a test indicator.
              If the indicator is set, the document is not saved.

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

              Default
              Space

              Description
              If you have defined customer fields in the tables VBAK, VBAP, VBEP andESLL, you can read the data in these fields using this parameter.

              Further information
              You can find further information in note 143580.

              Description
              This table contains credit card data, identification and authorizationdata.
              You must enter the currency if you want the amounts in the amountfields to be converted correctly.

              Description
              Only relevant to configurable materials.
              You can find more information in the SAP Library under LO LogisticsGeneral -> LO Variant Configuration -> EDI for Configurable Materials.

              Description
              Only relevant to configurable materials.
              You can find more information in the SAP Library under LO LogisticsGeneral -> LO Variant Configuration -> EDI for Configurable Materials.

              Description
              Only relevant to configurable materials.
              You can gind more information in the SAP Library under LO LogisticsGeneral -> LO Variant Configuration -> EDI for Configurable Materials.

              Description
              Only relevant to configurable materials.
              You can gind more information in the SAP Library under LO LogisticsGeneral -> LO Variant Configuration -> EDI for Configurable Materials.

              Description
              Only relevant to configurable materials.
              You can gind more information in the SAP Library under LO LogisticsGeneral -> LO Variant Configuration -> EDI for Configurable Materials.

              Description
              This parameter contains the condition data.

              Value range
              You should distinguish between the following cases when fieldsCOND_VALUE and CURRENCY are filled.

              • The calculation type for the condition is expressed as a percentage.

              • In this case, you should leave the CURRENCY field empty and enter thepercentage value to the correct number of decimal places.
                Example: a percentage of 20% has to be entered as 20,0000 in field
                COND_VALUE.
                • The calculation type for the condition is not a percentage.

                • In this case, field COND_VALUE is a currency quantity field. FieldCURRENCY or CURRENCY_ISO must be filled for a correct conversion. Youmust enter the amount to the correct number of decimal places.
                  If neither field CURRENCY nor field CURRENCY-ISO is filled, the systempresumes that you have entered a percentage.
                  If, however, the calculation type is not a percentage, an incorrectamount is entered.

                  Description
                  This parameter contains the item input data for the SD document.
                  You can find information on the meaning of the individual parameterfields in the appropriate data element documentation in the ABAPdictionary.

                  Description
                  This parameter is used for the following:

                  • Control of the processing functions by the value in field UPDATEFLAG
                  • (change indicator)
                    ' ': Create a new SD document item
                    I : Create a new SD document item
                    U : Change an existing SD document item
                    D : Delete an existing SD document item
                    • Control of field entry by checkbox structures

                    • If field UPDATEFLAG is set, only the fields of the data parameter withan "X" in the checkbox strcutre are transferred.

                      Description
                      You can enter partners such as the sold-to party and the ship-to partyusing this table parameter. You can do this on both header and itemlevel.
                      The minimum requirement is the entry of a sold-to party on headerlevel.
                      The further partner roles are then determined automatically.
                      You can also enter alternative addresses in the structure. The languagemust then also be entered.

                      Description
                      This parameter contains the schedule line data.
                      You can find information on the meaning of the individual parameterfields in the appropriate data element documentation in the ABAPdictionary.

                      Description
                      This parameter is used for the following:

                      • Control of the processing functions by the value in field UPDATEFLAG
                      • (change indicator)
                        ' ': Create new schedule lines
                        I : Create new schedule lines
                        U : Change existing schedule lines
                        D : Delete existing Schedule lines
                        • Control of field entry by checkbox structures

                        • If field UPDATEFLAG is set, only the fields of the data parameter withan "X" in the checkbox strcutre are transferred.

                          Description
                          This table contains services and outline layouts for the order.
                          You can define a line as an outline line using field OUTL_IND.
                          You can assign a service line to an outline line using fields PCKG_NO(service line) and SUBPCKG_NO (outline line).
                          The hierarchy for the outline is represented by fields LINE_NO andHI_LINE_NO. Field HI_LINE_NO links to field LINE_NO of the superioroutline.
                          You can change the subcontractor group via field BOSGRP.
                          You can assign a line type to the service line, for example, line typealternative line, informatory line, blanket line or basic line.
                          The assignment takes place via the following fields:

                          • Basic line

                          • 'X' in field BASIC_LINE
                            • Alternative line

                            • 'X' in field ALTERNAT
                              Link to the appropriate basic line in field BASLINE_NO
                              A reference to a basic line must exist for alternative lines.
                              • Blanket line

                              • 'X' in field INFORM
                                '1' in field QUANTITY
                                The quantity is always 1 for blanket lines.
                                • Supplementary line

                                • 'X' in field SUPP_LINE
                                  • Bidder line

                                  • 'X' in field BIDDER
                                    • Contingency line

                                    • 'X' in field EVENTUAL
                                      • Informatory line

                                      • 'X' in field INFORM
                                        • Internal line

                                        • 'X' im Feld BOSINTER
                                          You can find information on the meaning of the individual parameterfields in the appropriate data element documentation in the ABAPdictionary.

                                          Description
                                          This parameter contains the condition data for the service lines.

                                          Value range
                                          You should distinguish between the following cases when fieldsCOND_VALUE and CURRENCY are filled.

                                          • The calculation type for the condition is expressed as a percentage.

                                          • In this case, you should leave the CURRENCY field empty and enter thepercentage value to the correct number of decimal places.
                                            Example: a percentage of 20% has to be entered as 20,0000 in field
                                            COND_VALUE.
                                            • The calculation type for the condition is not a percentage.

                                            • In this case, field COND_VALUE is a currency quantity field. FieldCURRENCY or CURRENCY_ISO must be filled for a correct conversion. Youmust enter the amount to the correct number of decimal places.
                                              If neither field CURRENCY nor field CURRENCY-ISO is filled, the systempresumes that you have entered a percentage.
                                              If, however, the calculation type is not a percentage, an incorrectamount is entered.

                                              Description
                                              You can transfer the long text for the service line in this table:

                                              • text type LTXT for the long text in field TEXT_ID

                                              • the actual text line in field TEXT_LINE

                                              • Very long texts have to be transferred line by line since a maximum of132 characters is allowed per line.
                                                If FORMAT_COL is empty, the standard format key * is assigned.
                                                The package number (PCKG_NO) forms the link to the service line forwhich the text is to be entered.

                                                Description
                                                You can transfer the texts for the document item in the table:

                                                • the allowed text types in field TEXT ID

                                                • the actual text lines in field TEXT_LINE
                                                • Description
                                                  The messages that are displayed when the sales document is created arecollected in this table.

                                                  Sructure:
                                                  TYPE Message type: S Success, E Error, W Warning, I Information
                                                  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 varaible
                                                  MESSAGE_V2 Message variable
                                                  MESSAGE_V3 Message variable
                                                  MESSAGE_V4 Message variable
                                                  PARAMETER Parameter name
                                                  ROW Line in parameter
                                                  FIELD Field in parameter
                                                  SYSTEM System (logical system) from which the message originates