Sapass

 Simplify SAP R/3 development with Excel VBA/VB RFC  
Home> Bapi>CustomerContract



Index

CustomerContract

CustomerContract


The business object Customer contract is a customer outline
agreement against which materials or services are released through customer orders within a certain period.

Structure

A customer contract consists of items that contain the quantity of a material or a service to be purchased.


Comment
A customer contract can be used to adopt the agreed conditions in all relevant customer orders.


11-Dec-2005


Methods

Available Methods


  • ChangeFromData : Change Customer Contract [ BAPI_CUSTOMERCONTRACT_CHANGE ]
  • CreateFromData : Create Customer Contract [ BAPI_CONTRACT_CREATEFROMDATA ]

11-Dec-2005


ChangeFromData

ChangeFromData


Using this method, you can change or delete contracts.

You can change header data, item data, schedule line data, contract data and configuration data.

In general the following applies:

  1. Only enter fields that you want to change.

  2. Mark the fields you want to change with an X.
  3. Fill in the UPDATEFLAG field with a U.
  4. Always enter the key fields when making changes, including in the checkbox list.
  5. An exception is configuration. If you change this, you must fill it in completely.

  6. Enter quantities and dates under schedule line data.
  7. Possible update flags: U = change
    D = delete
    I = insert

    Example

    1. Delete complete contract

    2. Delete contract item
    3. Changes to contract
    4. Change configuration

      Notes

      1. Minimum entries required:
        You MUST enter the contract number in the SALESDOCUMENT structure.
        You must always enter key fields when you make a change.
        You must always enter the update indicator in the INQUIRY_HEADER_INX.
      2. Commitment control

      The BAPI does not carry out a database commit. This means that thecalling application must leave the commit in order to have changes madeto the database. BAPI_TRANSACTION_COMMIT is available for this purpose.


      11-Dec-2005


      CreateFromData

      CreateFromData


      You can create customer contracts using this method.

      You must enter at least header data (using the CONTRACT_HEADER_INstructure) and partner data (using the CONTRACT_PARTNERS table) as input parameters.

      You enter the item data in the CONTRACT_ITEMS_IN table. The item
      numbers can be assigned manually, by filling in the relevant fields, orautomatically in accordance with Customizing, by leaving the relevant fields blank or 0.

      In the case of configurable items, you must enter the configuration data in the CONTRACT_CFGS_INST, CONTRACT_CFGS_PART_OF and
      CONTRACT_CFGS_VALUE tables.

      Once the customer contract has been created successfully, you willreceive the document number (SALES DOCUMENT field). The RETURN parameter informs you of any problems that may have occurred.

      Notes

      1. Required entries:
        ORDER_HEADER_IN : DOC_TYPE Sales document type

        SALES_ORG Sales organisation
        DISTR_CHAN Distribution channel
        DIVISION Division
        ORDER_PARTNERS..: PARTN_ROLE Partner function, SP sold-to
        party
        PARTN_NUMB Customer number

        ORDER_ITEMS_IN..: MATERIAL Material number
      2. Ship-to party:
        If no ship-to party is specified, the ship-to party is the same as the sold-to party.
      3. Commitment Control:
        The BAPI does not carry out a database commit. This means that the
        calling application must leave the commit in order to have changes madeto the database. BAPI_TRANSACTION_COMMIT is available for this purpose.

      11-Dec-2005