Batch management [rev]


  1. Batch management 
    • Batch level definition
    • Batch number assignment 
    • Batch Master Data
    • Batch status management 
  2. Business Processes
    • Batch creation process
    • Check change document ( MSC4N )
    • Mass processing ( MSC5N )
    • Batch Derivation
    • Batch Determination 
    • Work in process batches 
  3. Documentary batch 
  4. Batch Information Cockpit
  5. Electronic Batch Record
  6. Batch management Configuration in SAP
  7. SAP Global Batch Traceability (SAP GBT)
  8. FAQ
    • Active Ingredient management  with QM application 
    • Recurring inspection and expiration date
    • How to search batches on the basis of remaining shelf life in the batch determination?
  9. DEV
  10. Additional information 
    • 2312940 - Value of Characteristic LOBM_RLZ cannot be explained during batch determination
    • 2773759 - How to archive batch master data
    • 48460 - Leading zeros for internal batch number
    • 2849194 - It is not possible to maintain the Batch Shelf Life in hours in the material master
    • 2590439 - Batch determination Selection criteria in production / process order not correct
    • 1898563 - Batch determination return restricted batch

Batch management

What is a Batch? 

A definition from ExxonMobil Aviation: A batch is the specific quantity of a material produced in a single manufacturing process, i.e., under the same conditions, thus featuring identical properties. Each batch of material is given a batch number. Each batch of material is tested with regard to relevant characteristics to ensure it meets the values or within the range for those characteristics.

A batch is defined as a partial quantity of a product or material with homogeneous characteristics. A batch of material can either be purchased from a vendor (with a vendor batch number) or produced internally. 

What is the Batch level?

Specify whether the batch number for the material is unique in one plant, or in all plants.
  • Client level: The same batch number can not be used for\ different materials or different plants (You cannot assign the same batch number for different materials).
  • Material number level: a material can have the same batch number in different plants (One batch number cannot have different specifications in different plants)
  • Plant and material combination level: the plant and material combination have unique batch numbers (The batch number is only known in the plant in which it was created if the stock is transferred to another plant, the batch is unknown in the recipient plant and the system does not adopt any data. You have to recreate and specify the batch in the receiving plant; that is, the same batch number may have different specifications in several plants)

Batch number assignment

Number range object BATCH_CLT (internal and external).
SAP enhancement SAPLNOIZ can be used for an internal batch number assignment.
  • Automatic: EXIT_SAPLV01Z_001/EXIT_SAPLV01_Z_002
  • Manual: EXIT_SAPLV01Z_003/EXIT_SAPLV01Z_004, EXIT_SAPLV01Z_013 and EXIT_SAPMM07M_003 (inventory management, only for new batches) can be used to change the master data of a batch.

Batch Master Data

Activating Batch Management in the Material Master
  • The indicator for the material can be changed from “batch managed” to “non-batch managed” only if no stock exists for the current period and the previous period.
Batch master data
  • Date of manufacture
  • Available from 
  • Shelf-life expiration date (SD/QM)
  • Batch status: If the Batch restr. indicator is set, the batch is treated like
  • blocked stock in planning but can be selected by batch determination if the search
  • includes restricted-use batches.
  • Vendor batch
  • Texts
  • Classification
  • Changes 

Batch classification 

  • User-defined characteristics: Characteristics that do not reference table fields
  • Object Characteristics: Characteristics that refer to table fields.
  • Standard characteristics: These are Batch Management characteristics that are delivered in the SAP standard system. They are reference characteristics from tables MCHA and MCH1. All standard characteristics can be found in F4 help by specifying LOBM_*.
Classifying batch during goods movement: OMJJ

User Exits to fill free characteristics:
  • EXIT_SAPLV01Z_014(not called in MB* transactions, but in MIGO!)
  • EXIT_SAPMM07M_004(called in inventory management transactions and when posting goods movements via MB_CREATE_GOODS_MOVEMENT)

Batch status management 

Use this component to indicate whether a batch is usable or not. This allows us to prevent goods movements for batches that are not usable. We can use other characteristics that you have adapted to meet your requirements to display in detail the differences between the two statuses. 

Please, note that Status management automatically applies for all materials to be handled in batches.

The system uses an indicator in the batch master record to show batch status.
  • Status unrestricted = the batch can be used
  • Status restricted = the batch cannot be used 
The status is entered as a batch characteristic in Classification, which is then responsible for the selection of the batch during batch determination (reference characteristic LOBM_ZUSTD).

Define which status a newly created batch is to be given for each material type.

Make the settings for the initial status of a new batch in Customizing for Batch Management under Specify Batch Level and Activate Batch Status Management ( ber die Erweiterung SAPLV01D, die den Customer-Exit EXIT_SAPLV01D_001 enthält, können Sie die Definition des Initialzustands pro Werk und Materialart aus der Customizing- Einstellung überschreiben.).

You cannot change the status of a batch (unrestricted/restricted) in a goods movement, only with the following functions: by maintaining the batch master record manually or using the control function provided in the QM system. Field MCH*-DZUSTD Batch in Restricted-Use Stock.

When the batch status is changed, the GM takes place with the movement type 341/342 in order to place separately ( Restricted stock ).

Use a combination of availability check group (CH) and checking rules to control whether or not restricted batches are to be considered during the availability check.

Post a batch after quality inspection from the inspection stock to unrestricted-use or restricted-use stock, depending on the batch status. Batches can also be partially released.

Batch status can be changed in batch master transaction and via usage decision (transaction QA11).
There are two options to prevent restricted batches from being selected within batch determination:
  • insert characteristic LOBM_ZUSTD in batch class and selection class
  •  work with dynamic ATP check (scope of check – OVZ9)
Function modules:
  • VB_CHANGE_BATCH_STATUS
  • VB_CHANGE_BATCH_STATUS_STOCKS
  • VB_BATCH_DEFAULT_STATUS
Exit: EXIT_SAPLV01D_001 (determine the initial status of the batch)
Fields: TCUCH-KZDZV T001W-CHAZV (batch level on the plant)

Business Processes

Batch Derivation

It enables us to do transfer/ display for batch master data and classification data of the component batches of produced batches. Component batches may send data and produced batches may receive data.

The derivation can be called and used in all areas of Logistics at fixed times (for example, when posting goods receipts for production orders, when releasing process and manufacturing orders, when making the usage decision).
  1. Batch Where-Used List ->Make Settings for Batch Where-Used List :
  2. Transaction DVSP: activate batch derivation in the configuration settings.
  3. Add classification ( type 023 ) to the sender and receiver materials.
  4. Sender and receiver search strategies must be assigned to the derivation events in customizing
  5. Transaction DVS1: batch derivation settings for the sender material, including its characteristics.
  6. Transaction DVR1: batch derivation settings for receiver material, including its characteristics.
  7. Transaction DVMO: It creates the Batch Derivation Monitoring Report, which shows the status of batch derivations of different materials.
Transfer batch characteristics values from the sender material's batches to the receiver material's batches.

Business process
  • Create a production order for the receiver material while the system assigns the sender material  as one of the components
  • Release the production order
  • Goods receipt 
  • Batch derivation ( characteristics are transferred )
  • DVMO: Batch derivation monitoring 
Scenarios:
  • Pull Derivation (1 receiver: n senders)
  • Push derivation (1 sender n receivers)
BADI DERIVATION.

Batch creation process

  • in the Production Process: specific settings in batch management for existing production control profiles:
    • Automatic batch creation at order creation
    • Automatic batch creation at order release
    • No automatic batch creation in production/process order automatic batch creation at order creation
  • for Goods Movement (..for movement types)
    • Automatic/manual without check
    • For each material type, define whether a new batch can be created via the batch master creation transaction
  • In batch master record maintenance (Batch Management)
  • In purchase orders (Purchasing)
  • In results recording (Quality Management)

Create, change and delete (Batch deletion flag) manually 

Automatic Creation of a Batch in Goods Movement

Batch Traceability of Work in Process Batches

Transaction MB56

To set the initial parameters for recurring inspection, use Transaction QA07. A limitation exists on production orders with N:N batches.
The work in progress (WIP) batch is used to keep the batch traceability on a production order when several batches of raw material are consumed and several batches of a finished product are generated.

  1. Activate business functions: LOG_PP_WIP_BATCH and LOG_PP_WIP_BATCH_02.
  2. Activate the WIP batch functionality in configuration OMCWB
  3. Transaction OMT0: activate Original Batch Reference Material.
  4. Create a new confirmation profile (OPK0):
    • 8285 WIP Batch: Goods Receipts, 
    • 8290 WIP Batch: Goods Issues, and 
    • 295 WIP Batch: WIP Batch Entry
  5. Add a new user parameter  enter “CORUPROF” with the new profile
  6. Change a material master record (Work scheduling, Original batch -> Allowed)

Batch determination  - What is the right batch to pick up?

Determine an application first (SD/MM/PP/WM)

Search procedure
  • WM: Warehouse number/WM movement type
    • WM0001
  • PP and PP-PI combination: order type and plant from the transaction and then find a search procedure
    • .. CO01
  • MM: based on movement type.
    • ME01
  • SD: based on sales organization, distribution channel, division, and sales document type.
    • ...SD02

Search type => Condition type and table  =>.
A sort sequence is for choosing batches that meet user-defined sort criteria for characteristics.
Maintaining Condition Records
.. Batch number.

Function Module VB_BATCH_DETERMINATION

User Exit
  • EXIT_SAPLV01F_001
  • EXIT_SAPLV01F_002
BADI VB_BD_SELECTION

SD - batch determination 

Activate automatic batch determination for order or delivery item categories. Set indicator Auto batch determin for those order and delivery item categories for which you want batch determination to be triggered automatically.

Define Selection Classes
With the help of these selection classes, you define according to which criteria, that is, using which characteristics, batches are to be selected. Characteristics LOBM_RLZ and LOBM_LFDAT are an exception; they can be used for selection but not for classification.
  • LOBM_BWTAR valuation type (only if batches are unique at plant level)
  • LOBM_LFDAT delivery date
  • LOBM_LVORM deletion flag
  • LOBM_VERAB availability date
  • LOMB_VFDAT expiration date/Shelf life
  • LOBM_ZUSTD batch status
  • LOBM_QNDAT next inspection date
  • LOBM_RLZ remaining shelf life
Selection classes and sort rules can be transported provided that you use the same name to create the classes in the target system or target client.



Define Sort Rules

With the help of sort rules, you define according to which criteria, that is using which characteristics batches are to be sorted.
As a rule, all characteristics (this applies to standard characteristics as well as to user-defined characteristics) you want to use for selection must also be contained in the batch class. Characteristics LOBM_MENGE and LOBM_LGORT are an exception; they can be used for selection but not for classification.




Analysis
At the item level

We can see very detailed logs. 

Work-in-process batches 

WIP batch is used to maintain the batch traceability on a production order when several batches of raw materials are consumed and several batches of finished products are generated. 

MB56 is Batch where-used list. But it has limitations for process order when N:N.

Prerequisites
  • SFW5: LOG_PP_WIP_BATCH and LOG_PP_WIP_BATCH_02
  • OMCWB: WIP activation
  • OMTO: activating the original batch reference material 
  • OPKO:  Confirmation profile, areas 8285 and 8290, 8295
  • CO11N: user parameters 
  • MM02: Work scheduling ( OB management is allowed )
Business process
  • Create a production order with multiple components
  • Do confirmation 
  • Create a WIP batch 
  • Goods receipt
  • Monitoring ( BMBC )

Batch Information Cockpit

Transaction BMBC.

Documentary Batches

Documentary batches are intended for use in areas such as the automotive or consumer product industries. You use documentary batches to ensure that partial stocks of a material are traceable, without it being necessary to manage the stock of the material in batches.

Only use some of the current batch functions for documentary batches. You can use the batch where-used list (transaction MB56) and the batch master (MSC1N, MSC2N, and MSC3N).

Electronic Batch Record

Is it required to maintain a complete audit trail and record of all the batches used in the
entire logistics and supply chain to manufacture a product?

Transaction COEBR

Configuration 

SPRO: Logistics - General> Batch Management

Authorization objects

M_MATE_CHG: Create, change, display batch master record; display changes to batches 
M_MATE_ZST: Change batch status 
M_MATE_CHP: Batch record 
M_MATE_BWT: Changing the valuation type for a batch 

API
BAPI_BATCH_CREATE: This BAPI is used exclusively for creating new batches or for expanding existing batches by plant segments or storage location segments.
BAPI_BATCH_CHANGE: This BAPI is to be used exclusively for changing existing batches.
BAPI_BATCH_SAVE_REPLICA: This BAPI creates batches or changes existing batches. It combines the functions of the above-mentioned BAPIs.

Batch Master

BAdI BATCH_MASTER
It is called in MSC1N and MSC2N to validate user’s input.

EXIT_SAPLV01Z_013
It is called in Function Modules VB_CREATE_BATCH and VB_CHANGE_BATCH to set/change master data. It is also called in transaction MIGO.

EXIT_SAPMM07M_003
It is called in MM coding (MB1A, MB1B, MB1C, etc) but only for new batches.

Batch classification

EXIT_SAPLV01Z_012
It is called in Function Modules VB_CREATE_BATCH and VB_CHANGE_BATCH to determine whether classification and exits should be executed. In other words, it’s possible make the system ignore the classification routines. Just set the parameters TYPE_OF_CLASSIFYING and EXTENDED_CLASSIFYING accordingly.

EXIT_SAPLV01Z_014
It’s called in VB_CREATE_BATCH and VB_CHANGE_BATCH to set/change free characteristics. Free characteristics are those that do not begin with “LOBM_”.

EXIT_SAPMM07M_004
It is used to fill the classification data in MM transactions.

Batch numbering – internal

EXIT_SAPLV01Z_001
Replacement of the number range, decision for internal or external numbering.

EXIT_SAPLV01Z_002
Assignment of customer-specific batch number. Also used to assign an existing batch (allow_existing_batch) via VB_CREATE_BATCH.

EXIT_SAPMM07M_010
Called in MM coding to assign existing batches.

Batch numbering – external
EXIT_SAPLV01Z_003

Replacement of the number range, decision customer-specific check.

EXIT_SAPLV01Z_004
Check of batch number based on customer rules.

Batch status management

EXIT_SAPLV01D_001
Determination of the initial status of a batch.

SLED Management

BAdI VB_SLED_MANAGEMENT
It’s used to set VFDAT/HSDAT and switch off SLED management.

EXIT_SAPLVBMD_001
It has similar functionality as BAdI VB_SLED_MANAGEMENT

Batch Information Cockpit

BIC_ADDITIONAL_DATA
Add additional columns to selection result master and selection result stock.

BIC_FOLLOW_UP_ACTION
Allows defining actions for batches in the selection result (for example, change of batch status).

BIC_SELECTION
Definition of custom selection screen and selection logic.

Batch Where-Used List
BAdI VB_BWUL_EXPLOSION

Allows fine-tuning the selection for each object (batch, PO, production order).

BAdI VB_GET_POS_PLANT

Pre-determines plant for the selection screen of BWUL.

BAdI VB_GET_EXT_BATCHES
Allows reading external batches for a subcontracting process.

EXIT_SAPLCHVW_001
Allows filling additional columns into Batch Where-Used List.


Derivation
BAdI DERIVATION
Allows to activate/deactivate derivation during goods movement;
Allows to set parameter ‘current senders only’;
Changes BWUL explosion and BWUL result;
Changes values of derived fields/characteristics.

Batch determination

BAdI VB_BD_SELECTION
Can be used instead of the standard selection to select batches from stock. It’s important to point out that the standard batch selection won’t work after the BAdI activation.

BAdI VB_BD_SELECTION_CRITERIA
It is used to change the selection criteria (it will generate a new CUOBJ).

EXIT_SAPLV01F_001
It is used to change the selection criteria (will generate a new CUOBJ)

EXIT_SAPLV01F_002
Allows changing the communication structures BDCOM, KOMKH, KOMPH. These structures are used in function module VB_BATCH_DETERMINATION.

SAP Global Batch Traceability (SAP GBT)

SAP Global Batch Traceability (SAP GBT) can be used for (1) the analysis of the complete product network and the product distribution from the origin of the raw material throughout various stages of the production, (2) to trace a batch, across both SAP systems and non-SAP systems. 

The source system, for example, an SAP ERP system or a non-SAP inventory management system, records where-used data and transfers it to SAP Global Batch Traceability (SAP GBT).

SAP GBT can capture the following kind of data:
  • Where-used data, for example, the batch where-used data based on the material documents, production orders.
  • delta and full load via RFC
  • Master data ( batch master data with classification data, customer and vendor )
  • via IDocs
  • Organizational data
  • via RFC
  • Handling units 
  • SAP GBT can extract Batch Genealogy Data to Other Applications.

Table CHVW. SAP GBT transfer table is in use, reports. RFC, IDoc.

FAQ

How to search batches on the basis of remaining shelf life in the batch determination?

When you do batch determination in outbound delivery, you want to select the batches that within certain remaining shelf life, then how to realize it? 

The expiration date is not to be specified as a selection criterion in the strategy record, but it is to be calculated dynamically from the delivery date (from the sales order or the delivery) and a remaining shelf life specified in the selection criteria.

This results in: Required expiration date/SLED = delivery date + remaining shelf life in days

There are four important points:
  1. Add characteristic LOBM_VFDAT to the batch classes.
  2. Please note, the batch classes here mean the classes you assigned in material masters in MM01/MM02.
  3. Characteristics LOBM_RLZ and LOBM_LFDAT must not be included in the batch classes!
  4. Add characteristic LOBM_VFDAT, LOBM_LFDAT, and LOBM_RLZ to the selection classes.
  5. Please note, the selection classes here mean the classes you assigned in batch search strategies in VCH1/VCH2 or COB1/COB2 or MBC1/MBC2.
  6. Maintain a remaining shelf life in the selection criteria of batch search strategy. Relation operators (>, <, <=, >=) are also considered.
As of this release, the required minimum remaining shelf life and the planned delivery time from the stock transport order are taken into account in the batch determination process.
The user exit EXIT_SAPLV01F_002 can be used to reverse it to the normal logic.

SAP Notes and additional information

  • 33396 - Batch determination: Selection with remaining shelf life LOBM_RLZ
  • https://wiki.scn.sap.com/wiki/display/PLM/Debugging+Point+of+Batch+Determination

2312940 - Value of Characteristic LOBM_RLZ cannot be explained during batch determination

The batch determination is executed in transaction code VL02N for an outbound delivery that is created for a stock transfer order. In the selection criteria screen of batch determination, the value of characteristic LOBM_RLZ is not the same as the one defined in the selection class of the batch search strategy.

According to the SAP on-line documentation:

Minimum Remaining Shelf Life in Batch Determination from Stock Transport Order

As of SAP Enhancement Package 3 for SAP ERP 6.0 release, the required minimum remaining shelf life and the planned delivery time from the stock transport order are taken into account in the batch determination process.

Due to this logic change, if you have maintained the shelf life data in the material master, then the corresponding information will be copied to the stock transfer order when it is created.

It is possible to find the information in the database table field for the stock transfer order:
  • EKPO-MHDRZ Minimum Remaining Shelf Life
  • EKPO-IPRKZ Period Indicator for Shelf Life Expiration Date
  • EKPO-PLIFZ Planned Delivery Time in Days
Then during batch determination in the outbound delivery for the stock transfer order, the system will ignore the value of characteristic LOBM_RLZ set in the batch search strategy selection criteria, but will calculate the value of characteristic LOBM_RLZ as below:
LOBM_RLZ >= EKPO-MHDRZ + EKPO-PLIFZ (when EKPO-IPRKZ = D, when EKPO-IPRKZ is set to other period then the value of EKPO-MHDRZ will be converted to day first)

This is the standard shelf life calculation logic for stock transport order.

Resolution
If it is still expected that the defined value of LOBM_RLZ in the batch search strategy can be used in the batch determination process in the outbound delivery, then, it is possible to use userexit EXIT_SAPLV01F_002 to delete the transferred fields from stock transport order.

When batch determination function module VB_BATCH_DETERMINATION is called, it will follow its regular process to use the value defined in the batch search strategy to carry out the selection process.

2773759 - How to archive batch master data

Using archiving object MM_SPSTOCK to archive the batch master data.

48460 - Leading zeros for internal batch number

No conversion exit is defined for the batch number domain, as is the case for the material number, for example.
A conversion exit like this converts the numeric number that is entered into a number with leading zeros and it stores this number on the database.

Caution: In S/4, use the following BAdIs (enhancement spot: LOBM_BATCH_EXT) instead of this modification:
  • LOBM_BEFORE_BATCH_NUMBER_INT
  • LOBM_AFTER_BATCH_NUMBER_INT

2849194 - It is not possible to maintain the Batch Shelf Life in hours in the material master

As an alternative solution, a batch characteristic can be created to maintain the hours (transaction CT04). After that, it must be assigned to the batch class (transaction CL02).

Then, the characteristic will be available in the batch classification (Transaction MSC1N).

Finally, the batch search strategy must be adapted to identify the characteristic "hour" during tha batch determination according to the process used:

a) MBC2 - Inventory Management.
b) COB2 - Production/Process Orders.
c) VCH2 - Sales and Distribution.
d) LS52 - Warehouse Management.

2590439 - Batch determination Selection criteria in production / process order not correct

Use User Exit PPCO0013 (EXIT_SAPLCOMK_008 ), this exit allow to change the priority of batch determination and use the selection criteria from batch search strategy with higher priority. Please see documentation of the user exit in SMOD for further details.

1898563 - Batch determination return restricted batch

Add characteristic LOBM_ZUSTD to batch and selection class if you want to select batches based on status also.

Change batch class

Call MSC3N for the effected batch
Choose tab 'classification'
Note the assigned batch class
Call CL02
Choose tab 'Char'
Add characteristic LOBM_ZUSTD
To update the existing batches, run report ZVBRECLB, see note 78235
Change selection class

Display the Batch search strategy for the relevant area (*)
Choose the selection criteria
Note the assigned selection class
Call CL02 for this selection class
Choose tab 'Char.'
Add characteristic LOBM_ZUSTD
Save
Call batch search strategy change transaction(*)
Make sure LOBM_ZUSTD = initial (not restricted)
Save
 

(*)
For Inventory Management : MBC2
For Production / Process Order: COB2
For Sales and Distribution: VCH2
For Warehouse Management:LS52

Comments