Ansicht
Dokumentation

ROIB_PHYINV_ALLOC - Allocate Physical Inventory

ROIB_PHYINV_ALLOC - Allocate Physical Inventory

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

Purpose

Physical inventory capture is on plant/material or plant/tank level. In case of commingled stock, the measured physical inventory to be partitioned by custody (own vs. third party) and by duty/valuation type (own taxed vs. untaxed).

Allocation process and rules define how the measured physical inventory must be partitioned. Here the book stock by valuation type is utilized in the allocation process.

The guiding allocation principle is:

  • Third party stocks must be allocated first, where physical stock is equal to book stock. This setting is done in customizing by assigning allocation method A to a valuation type which is assigned to the allocation schema (which in turn is assigned to a business location).
  • The remaining physical inventory is allocated by proration between other valuation types like tax, untax.

Integration

Prerequisites

  • Data must be available in physical inventory table (OIB_PHYINV) either from the Volume/Mass Reading or from the IDOC. Allocation report considers data from OIB_PHYINV and data from Gauge Reading App (Tables: OIB_TANKDIP, OII_DIP_PARAM, OII_DIP_QUAN).
  • Respective Plant and Material must have book stock with valuation types. (Table MATDOCOILEXTRACT)
  • BAdI Definition (OIB_UI_HPM_ETS_ALLOC_METH) is provided and you must implement the BAdI. Sample reference class (CL_SAMPLE_CALC_ALLOC_METH) is attached to the BAdI definition.
  • Allocation will run only for Plant which has partner role as ‘LG’ (Storage Location). (Table OIJRRA)
  • Allocation schema which is assigned to business location can be maintained in Customizing. You must assign allocation method to Valuation Type in Customizing under Industry Solutions OIL&GAS (Downstream) → HPM → Physical Inventory Capture → Allocation → Define Oil Schema.
  • Valuation types for material must have at least single allocation method ‘B’.
  • Schema must be assigned to business location. In transaction O402 under TSW General tab →Alloc Schema.
  • In a plant, if one material is assigned to different tanks, reading must be available for all tanks the allocation report to run.

Features

The report shows logs in ALV grid as output and write logs into application log (Tcode-SLG1).

The report provides the following simulation option on the selection screen:

  • If Test is selected, the report shows output in ALV before updating the database tables.
  • If Test is not selected, the report runs in production mode and all records get updated in the database tables and is shown in ALV grid as output.

Selection

Inputs required for the report are Plant, Material and Allocation Date.

Standard Variants

Output

All logs are displayed in ALV grid and update in application log as well. Allocation records get updated in respective database tables (OIB_TANK_ALLOCand OIJPHYINV).

Error Log

In all the below cases, allocation will not be executed for the plant and material combination. Error logs are provided in ALV. To view the full log text, click on the error log message displayed.

  • Physical inventory entries (volume/mass readings or tank dips) do not exist for allocation.
  • Book stock is not available for plant/material xxx/xxx combination for which physical inventory entries exist.
  • The allocated inventory could not be published to Inventory Planning Workbench. The generic storage location is not available for plant xxx.
  • The allocated inventory could not be published to Inventory Planning Workbench. Allocated inventory for location/material xxx/xxx is not available in Inventory Planning Workbench.
  • Material MAT1 is available only for valuation type TAX; MAT1 is assigned to business location LOC1 and LOC1 is assigned to the Allocation schema SCH01 which has Valuation Types TAX (Allocation Rule A), UNTAX (Allocation Rule B) & 3P1 (Allocation Rule A). As the material is not available for a valuation type with allocation rule B assignment (at least 1 valuation type must be available with assignment to B), the allocation cannot run.
  • For example, Book stock for GBA1-MAT1-TAX is 2000 BBL; Physical Inventory posted for GBA1-MAT1 is 3000 BBL. As no book stock is available for GBA1-MAT1-UNTAX (which has Allocation Rule B assigned) because MAT1 is not extended to UNTAX at all, the allocation cannot run

  • Allocation will be skipped for this combination with error log message “Allocation for Plant xxx, Material xxx was not done as Material has Valuation Types that do not have a single B allocation method”.

  • Material MAT1 is extended for valuation type TAX & 3P2; MAT1 is assigned to business location LOC1 and LOC1 is assigned with Allocation schema SCH01 which has Valuation Types TAX (Allocation Rule A), UNTAX (Allocation Rule B) & 3P1 (Allocation Rule A).
  • In this case, material has additional valuation types which are not in schema SCH01

  • Allocation will be skipped for this combination with error log message “Allocation for Plant xxx, Material xxx was not done as Material has Valuation Types that are not in Schema xxx assigned to TSW location xxx”.

  • Schema is not assigned for Business Location xxx for Plant xxx.
  • Allocation Method is not assigned for Valuation Type xxx for Material xxx and Plant xxx.
  • Partner roles ‘LG’ does not exist in OIJRRA table for plant xxx.
  • Material is not assigned to a business location.
  • New allocated inventories are not found for publishing data in Inventory Planning Workbench.

Activities

Example






PERFORM Short Reference   BAL Application Log Documentation  
This documentation is copyright by SAP AG.

Length: 6982 Date: 20240520 Time: 131042     sap01-206 ( 123 ms )