Fonction SAP BAPI_GRIRDOC_CREATEMULTIPLE - Clear GR/IR Clearing Account Directly

Paramètre Reférence Type Long. Valeur par déf. Facultatif Description
GRIRDOC_FLAGS BAPI_GRIRDOC_CHECKS u 5 X Indicator for GR/IR Clearing
GRIRDOC_SELECT BAPI_GRIRDOC_SELECT u 35 X Transfer Structure Selection Parameter for GR/IR Clearing Account
HEADER_TXT BAPI_INCINV_CREATE_HEADER-HEADER_TXT C 25 X Document Header Text
POSTING_DATE BAPI_INCINV_CREATE_HEADER-PSTNG_DATE D 8 Posting Date in the Document
REF_DOC_NO BAPI_INCINV_CREATE_HEADER-REF_DOC_NO C 16 X Reference Document Number
TESTRUN BAPIFLAG-BAPIFLAG C 1 ' ' X Switch to Simulation Mode for Write BAPIs

Paramètre Reférence Long. Facultatif Description
GRIR_MAINT_DOCUMENTS BAPI_GRIRDOC 14 GR/IR Clearing Account Return Structure
RETURN BAPIRET2 548 Return Messages

Functionality
You can use this method to clear a balance on the GR/IR clearing accountdirectly. A balance on the GR/IR clearing account occurs when there arequantity differences between goods receipt and invoice receipt for apurchase order.
You use structure GRIRDOC_SELECT to transfer the purchase order with thepurchase order number, item, and account assignment, and use additionalselection criteria to define which purchase order items you want toclear directly by using account maintenance.
You use structure GRIRDOC_FLAGS to specify whether you want to directlyclear a balance on the GR/IR account, differences in delivery costs, orboth. You can also specify whether you want to clear documents with adelivery surplus or an invoice surplus. If you want to clear documentsfor which you use automatic invoice creation, set the GRIRDOC_FLAGS-ERSfield to x.
You can use the TESTRUN parameter to specify whether the method is runin simulation mode. In this case, clearing of the GR/IR account is onlysimulated, which means that the data of the account maintenance documentis not written to the database.
The document number of the posted account maintenance document and thefiscal year are returned by the system as key fields of the document.

Return Messages
Messages are returned in the Return parameter. The return valuesand their meanings are described in the documentation for thisparameter.

Example
The following example shows which data you must enter when posting anaccount maintenance document for clearing the GR/IR clearing account.
You order 10m of a material at USD 10.00 per meter. On goods receipt,11m are posted. The invoice is for USD 100.00, for 10m of the material.
Enter the following data:

  • POSTING_DATE (Posting date of document): February 10, 2006

  • Structure GRIRDOC_SELECT:
    • PO_NUMBER (Purchase order number): 45....xxx

    • PO_ITEM (Item number of purchasing document): blank

    • SERIAL_NO (Sequence number of account assignment): blank

    • REF_DOC (Document number of a reference document): blank

    • REF_DOC_IT (Item of a reference document): blank

    • REF_DOC_YEAR (Fiscal year of the current period): blank

    • Structure GRIRDOC_FLAGS:
      • DEL_SURPLUS (Delivery surplus indicator): x

      • INV_SURPLUS (Invoice surplus indicator): blank

      • GR_CLEARNING (Clear GR/IR clearing account): x

      • DEL_COST_ACCOUNTS (Clear delivery costs accounts): blank

      • ERS (Evaluated receipt settlement): blank

      • For more information, see the parameter documentation.

        Description
        This parameter specifies which surplus type and which accounts you wantto clear. In addition, you can use this parameter to determine whetherevaluated receipt settlement is allowed.
        To specify which surplus type you want to clear, you use thedelivery surplus indicator (field DEL_SURPLUS) or the invoicesurplus indicator (field INV_SURPLUS). At least one of these twoindicators must be set.
        To specify which account you want to clear, you use the Clear GR/IRclearing account indicator (field GR_CLEARNING) or the Cleardelivery costs account indicator (field DEL_COST_ACCOUNTS). At leastone of these two indicators must be set.
        In addition, you can allow evaluated receipt settlement, by setting theindicator for this purpose (field ERS).
        INCLUDE BAPI_DATAELEMENT OBJECT DOKU ID TX

        Value range
        Blank = Indicator is not set.
        x = Indicator is set.

        Description
        This structure contains the selection parameters for the accountmaintenance document.
        The PO_NUMBER field (purchase order number) is required. If theSERIAL_NO field (sequence number of account assignment) containsentries, the PO_ITEM field (item number of purchasing document) mustalso be filled.
        In addition, you can fill out the following fields:

        • REF_DOC (Document number of a reference document)

        • REF_DOC_IT (Item of a reference document)

        • REF_DOC_YEAR (Fiscal year of the current period)

        • INCLUDE BAPI_DATAELEMENT OBJECT DOKU ID TX

          Description
          If a document header text is entered, this is saved in the accountmaintenance document.
          For information about the meaning of the document header text, see thedata element documentation: Document Header Text.

          Description
          For information about the meaning of this import parameter, see the dataelement documentation: Posting Date in the Document.

          Description
          If the reference document number is entered, this is saved in theaccount maintenance document.
          For information about the meaning of the reference document number, seethe data element documentation: Reference Document Number
          .

          Description
          This parameter specifies whether the clearing of the GR/IR account orthe delivery costs accounts is to run in simulation mode at first. Ifthis indicator is set, the clearing of the account is only simulated,which means that the data of the account maintenance document is notwritten to the database.

          Value range
          Blank = Document is saved.
          x = Document is not saved.

          Description
          After one or more account maintenance documents have been postedsuccessfully, the document number of the account maintenance documents(field GR_IR_ACCOUNT_DOC) and the fiscal year (field FISC_YEAR) aretransferred in this structure.
          INCLUDE BAPI_DATAELEMENT OBJECT DOKU ID TX

          Description
          INCLUDE BAPI_TABLE OBJECT DOKU ID TX

          Value range
          Type,, ID,, Number,, Message
          S,, CKMLGRIR,, 009,, No data selected, check the selection parameters
          Messages from other function modules or programs may also occur.