Ansicht
Dokumentation
CBIH_LB11_QTY_GET_STOCK_OUT - EHS: User Exit - Determine Stock Issue for Material
BAL_S_LOG - Application Log: Log header data BAL Application Log DocumentationThis documentation is copyright by SAP AG.
Use
This function module enables you to calculate the goods issue of materials or real substances to which a material is assigned.
Input
In the interface, an amount category and a measured value/reference value category are passed to the module. As an option, a start date and end date for the selection period and a key date can be passed. If these are not filled at the interface, the current system date is used.
A table of risk assessment header records for which the calculation is to be carried out is also passed. If it exists, a table of existing amount records is passed.
Output
If no new data could be calculated on the basis of the values passed, the E_FLG_NO_VALUES indicator is set to "X" (= true).
The newly calculated amount records with the goods issue data for the individual materials or real substances are returned in the E_QUANTITY_TAB table. Here, each amount record is assigned a header record of the risk assessment in the E_EXPOSURE_HEADER_TAB table.
If an error occurs in processing that does not lead to an exception handling being triggered, error information is returned to the calling program via the E_ERROR_STRUC structure.
Functionality
Processing is done in the following steps:
- Input check
- First the input parameters are checked. If the passed amount category, the measured value/reference value category, or the table for the risk assessment header records are empty, further processing is canceled. The passed data is also transferred to a local work table.
- Check for material or real substance
- A check is run on the passed agent type. The agent type must be a material or a real substance because executing a material movement determination only makes sense for these. If the agent type is not a material or a real substance, processing is ended without errors and no data is returned.
- Determine material assignment
- If the passed agent type is a real substance, for all passed specifications contained in the risk assessment header records, the material assignments are determined within the specification database and updated in the work table.
- If it is a material, only the local work table is updated.
- Entries in the work table for which no material exists - either directly or via an assignment - are deleted. If the work table is then empty, processing is ended without errors.
- Determine work area assignment and integration objects
- To determine the movement data for the material, both the assignment of the agent to the work area and the assignment of a storage location to the work area are used.
- The work area is assigned directly via the risk assessment header.
- The assignment of the storage location to the work area is made using the data integration function in the work area.
- The assignment data is transferred to the work table, entries with no assignment are deleted. If the work table is empty, further processing is ended without error messages.
- Determine RFC destination
- The module is prepared for a link to the material data via Remote Function Call (RFC). For this purpose, a check is made for each plant via an environment parameter whether a link has been set up via RFC. This means it is possible in principle to set up one Plant Maintenance system for each plant.
- Read material movement data
- Once all required data has been entered in the work table, the material movement data can be read.
- Prepare output
- Output is now prepared by writing the calculated data to the amount table for export. The following is important here:
- The link to its header record must be entered in the new amount record. To do this, the RECN of the relevant header record is transferred to the amount record as RECNROOT.
- A check must be made whether the unit of the calculated material stock has the same dimension as is set for the amount category (see Specify Measurement Items).
- If an amount record already exists for this measurement item, a follow-on record can be created. Here, a check is run to determine whether the start of validity of the existing record is not equal to the current key date and whether the end of validity is the 12/31/9999 ("high date"). Only if this is the case is a record split permitted and the SPLITTFLG indicator of the exported amount record can be set to true ("X").
- The final step checks whether the export table for amounts contains entries. If it does, the export indicator E_FLG_NO_VALUES is set to false (" ").
Prerequisites
So that the function module can be used it must be active in the system and be assigned to at least one measurement item in Customizing for Industrial Hygiene and Safety in the IMG activity Specify Measurement Items. When you edit the activity, also make sure that the dimension of the amount category matches the dimension in inventory management, and that the units of measurement for inventory management are contained in the dimension for the amount category.
Notes
If the function module was assigned as described in Customizing, it can be called from the Industrial Hygiene and Safety menu using Agents -> Amount Determination. Before determination is started, you must specify the amount category and the measured value/reference value category.
Further information
Parameters
E_ERROR_STRUCE_EXPOSURE_HEADER_TAB
E_FLG_NO_VALUES
E_QUANTITY_TAB
I_BEGIN_DATE
I_END_DATE
I_EXPOSURE_HEADER_TAB
I_LIMIT_TYPE
I_QUANTITY_TAB
I_QUANTITY_TYPE
I_VALIDATION_DATE
Exceptions
INTERNAL_ERRORPARAMETER_ERROR
Function Group
CBIH_LB11ROGBILLS - Synchronize billing plans RFUMSV00 - Advance Return for Tax on Sales/Purchases
This documentation is copyright by SAP AG.
Length: 7620 Date: 20240523 Time: 084708 sap01-206 ( 133 ms )