Ansicht
Dokumentation

EXIT_SAPLWN01_003 -

EXIT_SAPLWN01_003 -

General Material Data   BAL Application Log Documentation  
This documentation is copyright by SAP AG.
SAP E-Book

Functionality

Component "EXIT_SAPLWN01_003" is used to influence the distribution of income at Tax code and Plant level after the condition record has been evaluated.

If you want to change the business volume data or income for the condition record, you should not use this user exit. Instead, you should use the component intended for it.

Input parameters

  • I_ARRANGEMENT: Arrangement data
  • I_SETTLEMENT_VALUES: Settlement data for the condition record
  • I_VARIABLE_KEY : Variable key for the condition record
  • I_CONDITION_RECORD: Condition record (item data) for the condition record
  • I_CONDITION_SCALE: Scale level used (if condition is scaled)
  • I_T6B1: Arrangement type
  • T_VARIABLE_KEY: Table of variable keys for the arrangement
  • T_CONDITION_RECORD: Table of all condition records (item data) for the arrangement
  • T_CONDITION_SCALE: All scale levels for the arrangement (if the condition records are scaled)

Output parameters

  • E_SETTLEMENT_VALUES : Settlement data for the condition record
The user exit must contain statement E_SETTLEMENT_VALUES = I_SETTLEMENT_VALUES (see input parameter "I_SETTLEMENT_VALUES").
  • T_SETTLEMENT_VALUES_MWSKZ: Settlement data at Tax code level
If a settlement type does not refer to the plant level, an item is created in the settlement documents for each entry in this table.
  • T_SETTLEMENT_VALUES_WERKS: Settlement data at Plant level (including tax codes)
Data is only entered for this parameter for settlement type at plant level. In the case of a settlement type at plant level, an item is created in the settlement documents for each entry in this table.
  • T_ERROR_MESSAGES: Messages for inclusion in the list log
Message types "E" and "A" terminate settlement of the arrangement.

Example

Initial situation: In the company code, tax processing with "Jurisdiction Codes" is not active. Settlement and distribution of business volume take place at plant level.

Business volume is generated as follows:

  • Plant 1, 100,000 DM for tax code V1
  • Plant 1, 50,000 DM for tax code V2
  • Plant 2, 200,000 DM for tax code V1
  • Plant 3, 50,000 DM for tax code V2

The total business volume for the condition record is therefore 400,000 DM. A condition of 2% for business volume over 250,000 results in an income of 8,000 DM.

This data is recorded at condition level in parameter "I_SETTLEMENT_VALUES".

The data is distributed at the levels "Tax code" and "Plant" (at tax code level proportional to business volume, at plant level proportional to business volume, rather than equal distribution.

The following data results for the Tax code level (table "T_SETTLEMENT_VALUES_MWSKZ"):

  • Tax code V1, condition basis 300,000 DM, proportional income 6,000 DM
  • Tax code V2, condition basis 100,000 DM, proportional income 2,000 DM

The following data results for the Plant level (table "T_SETTLEMENT_VALUES_WERKS"):

  • Plant 1, tax code V1, 100,000 DM, proportional income 2,000 DM
  • Plant 1, tax code V2, 50,000 DM, proportional income 1,000 DM
  • Plant 2, tax code V1, 200,000 DM, proportional income 4,000 DM
  • Plant 3, tax code V2, 50,000 DM, proportional income 1,000 DM

Note that the allocation of incomes involving interval scales, for example, is a lot more complicated.

Procedure

  • At the start, make sure you include statement "E_SETTLEMENT_VALUES = I_SETTLEMENT_VALUES". If you do not, the changes will not be transferred.

There should generally not be any changes to parameter "E_SETTLEMENT_VALUES". Other components are available if you want to do this. Tables "T_SETTLEMENT_VALUES_MWSKZ" and "T_SETTLEMENT_VALUES_WERKS" can be changed.

As programming errors in this user exit usually have extremely serious effects, a consistency check is carried out subsequently on the changed data.
  • You cannot change the condition record number (E_SETTLEMENT_VALUES, T_SETTLEMENT_VALUES_WERKS, T_SETTLEMENT_VALUES_MWSKZ).
  • The status (E_SETTLEMENT_VALUES-LISTST) determines whether the condition record data is transferred to the settlement documents. You can reset the status. However, you cannot set the status to the following values:
"F" (settlement document created without errors)
"G" (settlement document posted successfully)

Condition records with status lower than "E" (distribution of income successful over tax code or plant) or "H" (condition record settled without settlement document) are not transferred to the settlement document.

If a condition record cannot be processed successfully, settlement accounting is terminated for the arrangement.

  • All data records in table "T_SETTLEMENT_VALUES_MWSKZ" contain a tax code, but not a plant.
  • All data records in table "T_SETTLEMENT_VALUES_WERKS" contain a tax code and plant.
  • The total of all fields of structure "T_SETTLEMENT_VALUES_WERKS" with fixed tax codes must correspond to the total data record in table "T_SETTLEMENT_VALUES_MWSKZ".
  • The total of all fields of structure "T_SETTLEMENT_VALUES_MWSKZ" must correspond to the total value of structure "E_SETTLEMENT_VALUES".

Features

In company codes that calculate tax using "Tax Jurisdiction Codes", business volume is always updated with the tax code for non-taxable transactions of the company code. As a result, table "T_SETTLEMENT_VALUES_MWSKZ" contains a single entry.

Error handling

You can define your own messages in table "T_ERROR_MESSAGES". These are included in the list output.

You can use subprogram "ERROR_MESSAGES" to do this (see section on subprograms).

Alternatively, you can trigger one of the following exceptions:

  • ERROR_MSG_SETTLEMENT_VALID
  • ERROR_MSG_SETTLEMENT_INVALID

With exception "ERROR_MSG_SETTLEMENT_VALID", data is transferred from the user exit. With exception "ERROR_MSG_SETTLEMENT_INVALID", the data is not transferred from the user exit.

Please note that messages of type "E" or "A" generated during processing of a condition record always leads to settlement of the condition record, and therefore the arrangement, being terminated.

Subprograms

There are two subprograms in Include "LXWNXF00"

  • "FORM ERROR_MESSAGE": Transfer of a message to the message table (field "P_KNUMH" is blank: global message for arrangement; indicator selected in field "P_KNUMH": message relates to particular condition record).
  • FORM ERROR_MESSAGE: Transfer of a message from function module to the message table
CALL FUNCTION "EXAMPLE"
...
EXCEPTIONS
EXAMPLE = 1.
IF SY-SUBRC <> 0.
PERFORM ERROR_MESSAGE_APPEND_SY
TABLES T_ERROR_MESSAGES
USING I_VARIABLE_KEY-KNUMH.
ENDIF.

Technical note

To improve performance, tables "T_SETTLEMENT_VALUES_MWSKZ" and "T_SETTLEMENT_VALUES_WERKS" are sorted binarily by fields "KNUMH" "KOPOS" "MWSKZ" "WERKS", with field "WERKS" being blank in table "T_SETTLEMENT_VALUES_MWSKZ". The tables must subsequently be sorted again.

Table "T_VARIABLE_KEY" is sorted in ascending order by fields "KVEWE" "KOTABNR" "KSCHL" "VAKEY" "DATBI" "KAPPL", and not by condition record number "KNUMH". Table "T_CONDITION_RECORD" is sorted by fields "KNUMH" "KOPOS" ("KOPOS" is always "01" for subsequent settlement, at the time when this documentation was written). Table "T_CONDSCALE" is sorted by fields "KNUMH" "KOPOS" "KLFN1" (Caution: "KLFN1" is not numbered sequentially).

The content of these tables MUST NOT be changed.






BAL_S_LOG - Application Log: Log header data   ROGBILLS - Synchronize billing plans  
This documentation is copyright by SAP AG.

Length: 9243 Date: 20240419 Time: 185315     sap01-206 ( 110 ms )