Ansicht
Dokumentation

FKK_SAMPLE_0020 - Example 0020: Transfer Complete Document/Clearing w/o Document Number

FKK_SAMPLE_0020 - Example 0020: Transfer Complete Document/Clearing w/o Document Number

CL_GUI_FRONTEND_SERVICES - Frontend Services   rdisp/max_wprun_time - Maximum work process run time  
This documentation is copyright by SAP AG.
SAP E-Book

Functionality

The function modules called up at event 0020 enable additional action to be initiated where a document is posted in Contract Accounts Receivable, and open items are cleared at the same time (either fully or in part). All document data except the document number and all data on the cleared items is available at this event.

Dependencies

If the additional action also necessitates knowing the document number, this can be determined via a function module to event 0030.

There are two events - the reason being that once the document number has been assigned, the corresponding number range is blocked and is therefore unavailable to other users. This block remains in place until the document is posted. The period during which the block holds should be kept to a minimum, and to this end you should avoid time-consuming actions between the time the document numbers are assigned and the time the document is posted.

Since all kinds of additional action can be initiated at event 0020, (and this action may be time-consuming) this event is processed prior to document number assignment. At this event, you can carry out all preparations for updating further data, and have this data recorded in internal tables. At event 0030, the only data that is normally added to these internal tables is the document number.

Event 0010 exists alongside event 0020 and is processed in place of 0020 if no items are cleared. Check whether there are additional actions to be triggered at this event (0010) too.

If internal tables are constructed for Event 0020 and these tables form the basis for database operations (DELETE, INSERT, UPDATE) that are initiated via PERFORM ON COMMIT, you need to define a function module for Event 0090 in which the tables internal to the program are reset using REFRESH. Event 0090 is processed if an application program runs ROLLBACK WORK. Prior to the ROLLBACK WORK, the function module FKK_ROLLBACK_POSTING_MEMORY must be called up by the application program. This function module processes event 0090 (among others).

You do not need the function module for event 0090 if the REFRESH of the tables is ensured via a PERFORM ON ROLLBACK.

Programming Notes

The line items are exported to the tables T_FKKOP (open items), T_FKKOPK (G/L items) and T_FKKOPW (repetition specifications). The clearing information is exported to table T_FKKCL. If any clearing is reset (reversal of clearing document, clearing reset), you can find the items with the old clearing information in table T_FKKRAP.

Table T_FKKRAP only contains the part of the information on the items for which clearing was reset and the information is summarized via subitems (field OPUPZ).

For all non-statistical items affected, the details can be read in table T_FKKRAP_DETAIL if required.

This table is sorted by document number (OPBEL), repetition (OPUPW), item number (OPUPK), and subitem (OPUPZ).

When you post reversals and returns, and when you reset clearing, new items are generated in the old clearing document. These are cleared immediately either by the reversal or reset document. The clearing reason used is transferred to the parameter I_AUGRD.

Do not change the content of the tables exported, nor the way they are sorted, otherwise inconsistent data may be updated. If necessary, copy the data for additional processing to your own internal tables.

In table T_FKKCL the following fields are of particular interest if you want to establish whether an item is cleared fully or in part:

- BETRW Gross amount of item
- SKTPZ Cash discount percentage rate agreed
- FAEDS Due date for cash discount
- FAEDN Due date net
- SKTOW Possible discount amount (SKTOW = BETRW * SKTPZ / 10000)
- NETTW Net amount of item (NETTW = BETRW - SKTOW)

- XAKTP "X" Item(s) taken into account
- XAKTS "X" Cash discount amount specified taken into account
- AUGBW Clearing amount assigned (gross)
- ASKTW Cash discount amount assigned
- SKTPA Accepted cash discount percentage rate (normally identical
to SKTPZ)

For statistical receivables (identified by T_FKKCL-STAKZ = "X") the item is deleted without a subsequent posting if you set the indicator T_FKKCL_XCLON = "X".

For example, a budget billing receivable is canceled without the system posting a budget billing. Similarly, a statistical charge request is canceled without the system generating an actual charge receivable and the resulting revenue.

Parameter I_PROCESS indicates special posting processes.

  • 1,,Reversal
  • 2,,Reset clearing
  • 3,,Returns

If clearing is reset, parameter I_PARTIAL_RESET indicates that only a partial reset has been carried out.

If you want to create other documents for event 0020 by calling up FKK_CREATE_DOC_ADDITIONAL, make sure that the parameter I_ADD_DOC is not set. Otherwise an additional document is created and recursive calls are not permitted during the creation of additional documents.





Parameters

I_ADD_DOC
I_AUGRD
I_AUGVD
I_FKKKO
I_FKKKO_REV
I_LAST_OPK_FROM_CALLER
I_LAST_OP_FROM_CALLER
I_PARTIAL_RESET
I_PROCESS
I_PYLOT_ADJUSTED
I_UPDATE_TASK
T_FKKCL
T_FKKOP
T_FKKOPK
T_FKKOPK_NDTAX
T_FKKOP_DP
T_FKKRAP
T_FKKRAP_DETAIL

Exceptions

Function Group

FKML

CL_GUI_FRONTEND_SERVICES - Frontend Services   PERFORM Short Reference  
This documentation is copyright by SAP AG.

Length: 6147 Date: 20240523 Time: 083737     sap01-206 ( 127 ms )