SAP Function BAPI_MATVAL_DEBIT_CREDIT - Debit/Credit Material

Parameter Reference Type Length Default Optional Text
DOC_TEXT BAPI_MATVAL_DEBI_CREDI_MISC-HEADER_TXT C 25 X Document Header Text
MATERIAL BAPI_MATVAL_KEY-MATERIAL C 18 Material Number
MATERIAL_EVG BAPIMGVMATNR_COPY u 82 X External Material Number and Version
POSTING_DATE BAPI_MATVAL_DEBI_CREDI_DATE u 15 Price Change Date
REASON_CODE BAPI_MATVAL_DEBI_CREDI_MISC-REASON_CODE C 3 X Account Assignment Reason
REF_DOC_NO BAPI_MATVAL_DEBI_CREDI_MISC-REF_DOC_NO C 16 X Reference Document Number
VALUATIONAREA BAPI_MATVAL_KEY-VAL_AREA C 4 Valuation Area
VALUATIONTYPE BAPI_MATVAL_KEY-VAL_TYPE C 10 Valuation Type

Parameter Reference Type Length Text
DEBITCREDITDOCUMENT BAPI_PRICECHANGE_DOCUMENT u 14 Debit/Credit Document

Parameter Reference Length Optional Text
MATERIAL_DEBIT_CREDIT BAPI_MATERIAL_DEBIT_CREDIT_AMT 31 Debit/Credit Amounts and Reference Quantities
RETURN BAPIRET2 548 Error Messages

Functionality
With this Business Application Programming Interface (BAPI), you candebit and credit materials retroactively and at the current date:

  • If you have activated the material ledger, you can debit and credit
  • materials independently of each another in up to three currencies orvaluations
    • If you have not activated the material ledger, you can debit and credit
    • materials only in the company code currency and with legal valuation.
      The system makes the following postings:
      • For materials with the standard price it posts the revaluation amount to
      • a price difference account.
        • For materials with average moving price it posts the revaluation amount
        • depending on the reference quantity to a price difference account or toa material stock account.
          &NOTE&
          You can define that the account determination is made independently ofthe price change reason. For additional information, see thedocumentation for Customizing of Materials Management under
          Valuation and Account Assignment -> Reasonsfor Price Changes.

          Example
          The reference quantity of a material that has been valuated with themoving average price amounts to 100 pieces, the inventory quantityamounts to 50 pieces with an inventory value of EUR 500 With asubsequent debit of 100 EUR, 50 EUR is posted to the inventory accountand 50 EUR to the price difference account.

          Notes
          The function of this BAPI corresponds to the function that is availableto you from the SAP Easy Access screen under Logistics ->Materials Management -> Valuation -> Change in Material Price ->Debit/Credit Material (transaction MR22).
          If you use this BAPI the system checks authorization object
          K_MLPR_VA with activity 44 (Mark).

          Description
          INCLUDE BAPI_PARAM_DEBCREDBEL OBJECT DOKU ID TX

          Description
          INCLUDE BAPI_PARAM_BELKPFTEXT OBJECT DOKU ID TX

          Description
          INCLUDE BAPI_PARAM_MATNR OBJECT DOKU ID TX

          Description
          INCLUDE BAPI_PARAM_EXTMATNR OBJECT DOKU ID TX

          Description
          INCLUDE BAPI_PARAM_PRSAEND OBJECT DOKU ID TX

          Description
          INCLUDE BAPI_PARAM_KONTGRD OBJECT DOKU ID TX

          Description
          INCLUDE BAPI_PARAM_REFBELNR OBJECT DOKU ID TX

          Description
          INCLUDE BAPI_PARAM_BWKRS OBJECT DOKU ID TX

          Description
          INCLUDE BAPI_PARAM_BWART OBJECT DOKU ID TX

          Description
          INCLUDE BAPI_PARAM_MENGE_DIFF OBJECT DOKU ID TX

          Description
          INCLUDE BAPI_PARAM_RETRN OBJECT DOKU ID TX