Fonction SAP BAPI_CONTRACT_CREATE - BAPI to Create a Purchase Contract

Paramètre Reférence Type Long. Valeur par déf. Facultatif Description
HEADER BAPIMEOUTHEADER u 347 Header Data Outline Agreement
HEADERX BAPIMEOUTHEADERX u 54 X Header Data Change Parameter Outline Agreement
TECHNICAL_DATA BAPIMEOUTTECH u 4 X Technical Parameters for Outline Agreement BAPIs
TESTRUN BAPIFLAG-BAPIFLAG C 1 X Test Run
VENDOR_ADDRESS BAPIMEOUTADDRVENDOR u 1276 X Address Structure Vendor Address

Paramètre Reférence Type Long. Description
EXP_HEADER BAPIMEOUTHEADER u 347 Header Data Outline Agreement
PURCHASINGDOCUMENT BAPIMEOUTHEADER-NUMBER C 10 Purchasing Document Number

Paramètre Reférence Long. Facultatif Description
ACCOUNT BAPIMEOUTACCOUNT 420 X Account Assignment Data - Outline Agreement
ACCOUNTPROFITSEGMENT BAPIMEOUTPROFITSEGMENT 87 X Profitability Segment Calculation Outline Agreement
ACCOUNTX BAPIMEOUTACCOUNTX 50 X Change Parameter Account Assignment Outline Agreement
DELIVERY_ADDRESS BAPIMEOUTADDRDELIVERY 1301 X Delivery Address in Outline Agreement
EXTENSIONIN BAPIPAREX 990 X ExtensionIn
EXTENSIONOUT BAPIPAREX 990 X ExtensionOut
HEADER_TEXT BAPIMEOUTTEXT 139 X Header Text - Outline Agreement
HEAD_CONDITION BAPIMEOUTHEADERCOND 101 X Master Conditions in Outline Agreement (Header)
HEAD_CONDITIONX BAPIMEOUTHEADERCONDX 37 X Change Parameter Header Conditions Outline Agreement
HEAD_COND_SCALE_QUAN BAPIMEOUTSCALE 39 X Quantity Scale
HEAD_COND_SCALE_VAL BAPIMEOUTSCALEVALUE 46 X Value Scale
HEAD_COND_VALIDITY BAPIMEOUTHEADVALIDITY 26 X Header Conditions Validity of Outline Agreement
HEAD_COND_VALIDITYX BAPIMEOUTHEADVALIDITYX 13 X Change Parameter Header Condition Validity Outline Agreement
ITEM BAPIMEOUTITEM 1000 Item Data of Contract
ITEMX BAPIMEOUTITEMX 145 Item Data Change Parameter for Outline Agreement
ITEM_CONDITION BAPIMEOUTCONDITION 106 X Conditions Item Outline Agreement
ITEM_CONDITIONX BAPIMEOUTCONDITIONX 42 X Change Parameter - Master Conditions in Outline Agreement
ITEM_COND_SCALE_QUAN BAPIMEOUTITEMSCALEQUAN 44 X Quantity Scale
ITEM_COND_SCALE_VALUE BAPIMEOUTITEMSCALEVAL 51 X Value Scale
ITEM_COND_VALIDITY BAPIMEOUTVALIDITY 35 X Validity Periods of Conditions
ITEM_COND_VALIDITYX BAPIMEOUTVALIDITYX 20 X Change Parameter - Validity Periods for Conditions
ITEM_TEXT BAPIMEOUTITEMTEXT 144 X Text Data - Outline Agreement
PARTNER BAPIMEOUTPARTNER 41 X Partner Information for Outline Agreement
PARTNERX BAPIMEOUTPARTNERX 31 X Change Parameter Partner Outline Agreement
RETURN BAPIRET2 548 X Return Table

Functionality
You can use this function module to create purchase contracts.

Example
Sample Code

Notes
Restrictions in comparison with the transaction Create Contract (
ME31K):

  • Master conditions:

  • During the creation of outline agreements, just one time period can bespecified per variable key. This means that a period can be specifiedfor the document header (i.e. condition table A019), for each item (i.e.condition table A016), and for each item/plant combination (i.e.condition table A068).
    • Scales are not supported during the creation of outline agreements.

    • Volume rebate conditions in outline agreements are not taken into
    • account.
      • No subitems (e.g. inclusive/exclusive bonus quantity, display,
      • etc.) are taken into account.
        • The control key for quantity management in procurement
        • (EKPO-SSQSS) and the certificate category (EKPO-ZGTYP) are onlytaken into account to a certain extent: this information is copied fromthe reference contract or the material master record, but cannot bechanged and no checks are carried out for these two fields.
          • The revision level (EKPO-REVLV) is not changeable because various
          • quality management routines were not implemented.
            • Version management (Document Change M

            • anagement) is not supported.
              • External services (planned and unplanned services) are not
              • supported.
                • Creation of configurations is not supported.
                • Further information
                  When a purchase contract is created (activity 01), the followingauthorization objects are checked:

                  • M_RAHM_BSA Document type in contract

                  • M_RAHM_EKG Purchasing group in contract

                  • M_RAHM_EKO Purchasing organization in contract

                  • M_RAHM_WRK Plant in contract
                  • Description
                    The parameter contains the header data of the purchase contract.

                    Description
                    Uniquely identifies an instance of thebusiness object BUS2014
                    (purchase contract).

                    Description
                    Uniquely identifies an instance of thebusiness object BUS2014
                    (purchase contract).

                    Default
                    The parameter is mandatory.

                    Description
                    This parameter contains the header data of the purchase contract.

                    Description
                    The following fields can be populated:

                    • MESSAGING_APPL: Selection of application for message output

                    • NO_MESSAGING: No message determination

                    • NO_MESSAGE_REQ: Without message output

                    • NO_AUTHORITY_CHECK: Do not carry out authorization check
                    • Value range
                      MESSAGING_APPL can have the following instances:

                      • A: Automatic determination of application

                      • B: Scheduling agreement output without schedule lines or contract

                      • C: Output scheduling agreement schedule lines (not relevant to purchase
                      • contracts)
                        • N: No message output

                        • The parameters NO_MESSAGING, NO_MESSAGE_REQ und NO_AUTHORITY_CHECK canbe:
                          • 'X' active

                          • or
                            • ' ' inactive.
                            • Description
                              The parameter TestRun is used in the writing BAPIs (CreateXXX andChangeXXX) to check the information on the instance prior to actualcreation of the object instance in the database. In the process, thecreation of the object instance is only simulated and the data is notupdated.

                              Value range
                              The parameter can have the following instances:

                              • 'X' describes the simulation mode

                              • ' ' describes the update run
                              • Description
                                The parameter specifies a vendor address that differs from the one inthe master record.

                                Description
                                The parameter contains the account assignment data for a contract item.

                                Value range
                                It is necessary to populate the item number ITEM_NO and the number ofthe account assignment SERIAL_NO because otherwise an assignment betweendatabase information (EKKN) and BAPI interface is not possible.

                                Description
                                Profitability segment information (CO-PA)
                                A new profitability segment is always created. In the process, a checkis made against the specified characteristics and characteristic valuesof the controlling area.

                                Description
                                Change parameter of account assignment data per contract item.

                                Description
                                Delivery address of contract item

                                Value range
                                Mixing of the delivery address data via the Change method istechnically not possible. To do this, use the API of Central AddressManagement BAPI_ADDRESS_CHANGE.

                                Description
                                INCLUDE BAPI_CONTRACT_SAG_MEANING OBJECT DOKU ID TX

                                Default
                                INCLUDE BAPI_CONTRACT_SAG_MEAN_DEF1 OBJECT DOKU ID TX

                                Description
                                INCLUDE BAPI_CONTRACT_SAG_MEANING OBJECT DOKU ID TX

                                Default
                                INCLUDE BAPI_CONTRACT_SAG_MEAN_DEF1 OBJECT DOKU ID TX

                                Description
                                This parameter contains the long texts of the contract header.

                                Default
                                The TEXT_ID field must always start with K. If you use adifferent value, it is automatically corrected by the BAPI.
                                Example:

                                • TEXT_ID,,,,= 'K03'

                                • TEXT_FORM,, = '*'

                                • TEXT_LINE,,,,= 'Hello World'

                                • DELETE_IND.
                                • Description
                                  INCLUDE BAPI_CONTRACT_SAG_KOND_KOPF OBJECT DOKU ID TX

                                  Description
                                  The parameter contains the change parameter for the master conditions ofthe contract header.

                                  Description
                                  INCLUDE BAPI_CONTRACT_SAG_KOND_KOPF OBJECT DOKU ID TX

                                  Description
                                  INCLUDE BAPI_CONTRACT_SAG_KOND_KOPF OBJECT DOKU ID TX

                                  Description
                                  INCLUDE BAPI_CONTRACT_SAG_KOND_KOPF OBJECT DOKU ID TX

                                  Description
                                  The parameter contains the change parameter for the validity period ofthe header master conditions.

                                  Description
                                  The parameter contains the general item data for a purchase contractinstance.

                                  Default
                                  The parameter is mandatory.

                                  Description
                                  The parameter contains the change parameter for the general item data ofa purchase contract instance.

                                  Default
                                  The parameter is mandatory.

                                  Description
                                  INCLUDE BAPI_CONTRACT_SAG_KOND_POSI OBJECT DOKU ID TX

                                  Description
                                  The parameter contains the change parameter for the item masterconditions.

                                  Description
                                  INCLUDE BAPI_CONTRACT_SAG_KOND_POSI OBJECT DOKU ID TX

                                  Description
                                  INCLUDE BAPI_CONTRACT_SAG_KOND_POSI OBJECT DOKU ID TX

                                  Description
                                  INCLUDE BAPI_CONTRACT_SAG_KOND_POSI OBJECT DOKU ID TX

                                  Description
                                  The parameter contains the change parameter for the validity period ofthe item master conditions.

                                  Description
                                  The TEXT_ID field must always start with K. If you use adifferent value, it is automatically corrected by the BAPI.
                                  Example:

                                  • ITEM_NO = '00010'

                                  • TEXT_ID = 'K03'

                                  • TEXT_FORM = '*'

                                  • TEXT_LINE = 'Hello World'

                                  • DELETE_IND
                                  • Description
                                    The parameter contains the partner data for a purchase contract. You canspecify the partners at the following levels:

                                    • Purchasing organization

                                    • Purchasing organization and plant

                                    • Purchasing organization, plant, and vendor subrange
                                    • Value range
                                      Key fields are: partner role, plant, and vendor subrange.

                                      Description
                                      The parameter contains the change parameter for the partner data for apurchase contract.

                                      Default
                                      Key fields are: partner role, plant, and vendor subrange.

                                      Description
                                      With this parameter, messages regarding exception situations or successmessages are returned to the calling program.
                                      Currently, it is only possible to assign the messages for the followingstructures/tables:

                                      • Header data HEADER

                                      • Item data ITEM

                                      • Account assignment data ACCOUNT

1548033Authorization check on transaction code ME32K
1327694Dump Type conflict in MM-PUR BAPIs
1046794FAQ: BAPI for outline agreement