Page tree
Skip to end of metadata
Go to start of metadata


The purpose of this page is to clarify the understanding of the system logic in a technical point of view about hte Posting and Clearing process.


The content of this page will provide debug tips and techinal information as internal tables involved in the posting and clearing process.

The main program for posting document is SAPMF05A.SAPMF05B is responsible for clearing the documents. But, as during the clearing a new document is created, SAPMF05B calls SAPMF05A.

So, before start your debug is important to identify if you are posting (SAPMF05A) or clearing (SAPMF05B) document.

The main internal tables used during the Posting and Clearing

  • KONTAB (clearing items): Collection of clearing postings without cash discount items.
  • KONTAB_1ST is the key structure used for summarization: AGZEI is a logical pointer from KONTAB to POSTAB (any number). Meaning:     1.In POSTAB: That the item has been cleared by item ... in KONTAB. 
  • POSTAB (open items): Responsible for store all open items selected to be processed. If you are selecting many line items to clearing this is not the best option for debug because it will be a massive work. POSTAB-WRBTR contains the value of the items in the payment currency. This is the amount used for clearing. This table is filled in  SAPMF05B in form POSTAB_DATEN (select open items and calculate amounts) Write BSEG from the open items (BSIS, BSIK, BSID) into POSTAB. Carry out currency translations. (Clearing in the transaction currency of the invoice does not require translation.) Determine due dates. Determine cash discounts.  
  • XBKPF (document header): Collects the headers of the new documents to be posted. 
  • XBSEG (document items): Collects the items of the new documents to be posted.


Internal Tables Flow during Clearing:


Setting Breakpoints using SE38 transaction


Program: SAPMF05B









AGZEI is a logical pointer from KONTAB to POSTAB (any number). Meaning that in POSTAB: That the item has been cleared by item ... in KONTAB.

If possible, two entries that belong together are merged.

Processing KONTAB:

  • Posting key is set and value dated.
    • All important fields in BSEG are set (amounts, organizational units, texts), BSEG-AUGBL is set to = '*', cash discount amounts are written to BSEG.
    • BSEG-NEBTR = NETTAB-NEBTR (payment amount) in first clearing item!
    • Transfer external account assignments for down payments/requests.
    • BSEG-XAUTO = 'X‘
    • Adjust withholding tax amounts
    • Save posting items in XBSEG. 

Program: SAPMF05A





Posting items filled from the items to be cleared (from table POSTAB)



Just specific fields are moved from POSTAB to KONTAB because in more than one item in POSTAB can be summarized in one line item in KONTAB. (For more details please check SAP Note 69767).

2 KONTAB items always arise for each open item in order to catch situations where the local and document currency have different +/- signs.



In the COLLECT KONTAB the append that follows has the following meaning: Per logical grouping (all fields the same in KONTAB_1ST) both an S and H entry are created. Reason: Due to collection, it may occur that an item - 1001 USD/ - 1799 DEM is added to an item with 1000 USD/1800 DEM. The result is an item with – 1USD / 1 DEM. This would be divided, and two postings would be created. Later, in KONTAB_VERDICHTEN, each pair is summarized if it does not look like the above example.


During KONTAB_VERDICHTEN  KONTAB is compressed. In KONTAB there are always pairs of items to be grouped, (usually one item with amount 0, and the real item).  The reason for this is that in certain constellations in different currencies, different +/- signs can appear, for example, with payment in third currency. These are grouped.



Program: SAPMF05A







Collects the items of the new documents to be posted.


 BSEG/XBSEG - Important fields to know:

    Contains the line item that is cleared so that any additional processing knows which items were cleared by this BSEG line. 
    Logical unit:                
    - First for open item selection:
       XAUSZ3-AGZEI  = KONTAB-AGZEI    (Which item was cleared and what information does it contain?)
    - Update task:
       XAUSZ3-AGZEI = BSEG-AGZEI.     (Pointer from XBSEG items to cleared items).
  • DMB**                        
    Different meaning depending on net/gross posting:
    Payment reference. In customer invoices, the customer should refer to this number when making payment. In vendor invoices, the vendor provides this number that we can refer to when making payment.
    Only filled in items created automatically; account assignment key. (compare table T030/T030W or. A: FBKP)


 ANZDown payment 
BNKBank Item

Cross company code clearing item

BSXStock posting from MM
KBSPurchase order with account assignment (expense posting from MM)
KDFExchange rate difference for open items
KDBExchange rate difference for foreign currency balances from valuation
KDWPayment difference for alternative currency
KDRExchange rate rounding differences MM
RDFRounding difference for national currencies

Tax exchange rate differences (alternative tax exchange rate)


Tax clearing items for down payments made gross


Cash discount paid - Customer takes cash discount

SKECash discount received - We claim cash discount when we make          payment
VSKCash discount lost (net procedure)
SKVCash discount clearing (net procedure)
 WRX GR/IR item

 Bill of exchange charges

 ZDI Payment difference according to difference reasons (Customizing): Small differences that fall within the tolerances set, and that are therefore automatically posted as an expense
 EGS, EGK Incoming invoice, G/L account/vendor item
 AGS, AGD Outgoing invoice, G/L account/customer item
 SAK G/L account posting
 DAS Differences from G/L account clearing
 QST Withholding tax
 VST, MWS, NAV Taxes


FBKP transaction:




Similar grouping to KTOSL:


TCorresponds to VST or MWS ... for taxes
S,DReversal as indicator for CO
DDiscount amount


    Partner business area. GSBER of business partner for domestic sales. Relevant for business area consolidation. Can be entered at header level and is inherited into the G/L account items not created automatically. Can also be overwritten individually in the item.
     Currency, and possibly amount, relevant for the payment program if payment is to be made in third currency. Entered in the invoice document.
     Invoice reference, but also used for

           -Link between down payment and down payment clearing (transfer posting) or 

           -Linking a partial payment or residual item for original invoice. REBZT is set to Z (partial payment), V (carry forward), U (transfer posting).


  • REBZT 

    ADown payment clearing: Partially cleared amounts for a down payment

    Credit memo: For invoice entry with explicit invoice reference


    For down payments on invoices: Invoice reference for invoice in payment request

    UTransfer posting of down payment (in credit memo created)
    VCarry forward
     Z Partial payment


    Special G/L indicator (determination of alternative reconciliation account – T074) ----> T074U- MERKP determines whether it is a statistical item (maintenance in transaction FBKP).

    Special G/L class (grouping of same UMSKZ ). Generally only important for screen control (T019). (maintenance in transaction: FBKP).

AAll types of down payments
WAll types of bills of exchange


Otherwise any, set to X for table T019


    Can be assigned if supported for the document type: Table: T003-XGSUB. If VBUND is entered in the vendor master record: Inherit VBUND in all items (for the evaluation). Problems occur if there are several vendors in one document (if accessed via ACC interface), then XGSUB decides the type of inheritance.
    (in RFOPS). Calculation of days in arrears: Relevant BLDAT, ZFBDT, and ZBDXP with X = 1, 2, 3. -VERZG = BLDAT – ZFBDT – ZBD1T - tolerance days. -If GT is 0, same formula with ZBD2T (if it exists) and overwrite VERZG. -If GT is 0, same formula with ZBD3T (if it exists) and overwrite VERZG. -End result = VERZG

For more details please check external wiki  How discount is granted during the clearing.


  • WRBTx, DMBTx, DMB2x, DMB3x whereby x = 1, 2, 3. Tax split amounts in open item (important for net documents)
  • WSKTO Cash discount agreed in open item in document currency, if fixed amount. In clearing document and cleared items: Cash discount taken.
  • XANET  'X'                                  =             Down payment in net procedure <>'X‘                              =             Down payment managed gross
  • XHRES Subledger accounts: Is the G/L account (reconciliation account) resident? XOPVW and XKRES are always set.
  • XKRES Line item display possible = BSIS/BSAS is updated, subledger: Always set
  • XOPVW: G/L accounts: Clearing possible, subledger: Always set


Use this structure to help you compose your contributions for WIKI and at the same time will ensure spelling and grammar.

  • No labels