Purpose
This document provides information on how the plant is being determined in Settlement Management/Agency Business (AB) documents.
Overview
In Settlement Management / Agency Business the need for plant data can be set in the settlement document type/billing document type customizing (field TMFK-WERKM). If plant is required in a certain business scenario, TMFK-WERKM must be set. Below you can find the customizing paths for the above field:
S/4HANA: SPRO: Logistics - General -> Settlement Management -> Settlement Documents -> Settlement Document Types -> All Document Types
ERP: SPRO: Logistics - General -> Agency Business -> Billing -> Billing Document Types
In case the above field was set, plant data will be required on item level for the creation of the settlement document.
If plant was not entered manually, or it could not be determined by the system from other data sources, the program will try to determine a plant from the following data sources, in the below sequence:
- Transfer Manager
- Plant data from the Customer material info record (CMIR)
- Supplying plant of the customer (store)
- Delivering plant from the customer master
- Delivering plant from the material master
- Plant, which is assigned to the company code in Settlement Management/AB customizing
In the "Plant determination logic" section you can find a detailed explanation how plant data can be determined in the corresponding transactions/customizing activities, which would be used by the system for plant determination.
Plant determination logic
Transfer Manager
You can use Transfer Manager to add custom logic for the plant determination and have the plant determined using KOMLFK and KOMLFP structures. For the plant determination, Transfer Event nr. 6F is being used and the plant value should be populated using target structure T001W_KEY.
You can find the customizing activity for Transfer Manager under the following paths in SPRO:S/4HANA: SPRO: Logistics - General -> Settlement Management -> Settlement Documents -> Specify Settings for Transfer Manager
ERP: SPRO: Logistics - General -> Agency Business -> Billing -> Transfer Rules
Plant data from the Customer material info record (CMIR)
Required data: customer number, material number, sales org.
DB table and field name: KNMT-WERKS
TCodes: VD51/VD52/VD53If purchasing org. data is also passed, then the plant number, which was derived from the CMIR can only be used, if the determined plant was assigned to the purch. org. as well (T024W-WERKS must be equal to KNMT-WERKS)
Supplying plant of the customer (store)
Required data: customer number, material number
DB table and field name: WRF3-LOCLB
TCodes: WB01/WB02/WB03Depending on material group assignment, there are two options for supplying plant maintenance:
material group was NOT assigned to the material
material group was assigned to the materialif material group was NOT assigned to the material
click on supplying plants:
maintain a valid supplying plant for the store:Please note, that if multiple valid supplying plants are available in the above transaction, than the system will take the plant information from the one with the highest priority.
if material group was assigned to the material
click on material groups:
select (or if necessary maintain) the relevant material group (the one, which is assigned to the corresponding material), then click on supplying plants:
maintain a valid supplying plant for the store:Delivering plant from the customer master
Required data: customer number, sales organization
DB table and field name: KNVV-VWERK
TCodes: XD01/XD02/XD03Sales area data – Shipping tab:
Delivering plant from the material master
Required data: material number, sales organization
DB table and field name: MVKE-DWERK
TCodes: MM01/MM02/MM03Sales: sales org 1 view:
Plant, which is assigned to the company code in Settlement Management/AB customizing
Required data: company code
DB table and field name: TMZWK-WERKS
Customizing path:S/4HANA: SPRO: Logistics - General -> Settlement Management -> Basic Settings -> Assign Company Code to Plant
ERP: SPRO: Logistics - General -> Agency Business -> Basic Settings -> Assign Company Code to Plant
Relevant program parts
Plant data is being checked in function module WLF_REGU_CHECK_WERKS.
If plant was entered manually, could not be determined by the program previously, nor it was populated thorugh Transfer Manager, the above described plant determination logic takes place in function module WLF_GET_DEFAULT_PLANT.