Skip to main content

Adding Custom Logic to SAP Batch Numbering System

The SAP Batch Numbering System is used to identify and track batches of products or materials that have been produced or received under similar conditions. Each batch is assigned a unique batch number that is used to record information such as the date of production, the production location, and the quality control test results.

The SAP Batch Numbering System is designed to provide a consistent and structured approach to batch numbering across all SAP modules. The system is based on a combination of alphanumeric characters and can be customized to meet specific business requirements.

One of the best ways to add custom logic to the SAP batch numbering system is using a user exit. I am going to discuss how we can add custom logic in the SAP batch numbering system using customer exit "SAPLV01Z".

Features of the Exit

  • Material specific or material type specific different number range can be assigned for automatic batch numbering system.
  • Automatically generated batch number can be changed with the custom numbering logic.

Components of the Exit

There are two function modules assigned to this user exit.


First function module is used to assign material specific or material type specific different number range assignment. Second function module can be used to add custom logic for the batch numbering system.

EXIT_SAPLV01Z_001

Importing parameters for this function module is X_BNCOM structure which is used to import the data for the object for which the batch number needs to be assigned.

For example: If we want to assign a batch number for a production order. X_BNCOM structure will import all the relevant data for that production order. We can use these data to identify our required production order for which we want to change the batch number using his exit.


There are quite a few changing parameters for this function module which give us the provision of assigning different number range for different material type or material itself.

To assign different number range for different material types or materials we need to execute below tasks.

  1. Assigning a new number range in the transaction "SNRO" for the object "BATCH_MAT" for the required material type.
  2. Then we can use this newly created number range for different materials

EXIT_SAPLV01Z_002

Importing parameters for this is same as for the previous function module. We can use this parameter for the same purpose we have mentioned earlier.

There is only one changing parameters for this function module which is NEW_CHARG. The purpose of this exporting parameter is to change the internally assigned batch number into custom one.


For example, suppose we want to assign a custom batch number at the time of production order release. We can assign automatic internal batch number to that production order using SAP standard functionality. After implementing that standard functionality, we can write a custom logic in this function module and assigned it to the changing parameter "NEW_CHARG".

As a result, SAP will assign an internal batch number at the time of production order release which will be replaced by the custom logic we have provided in this function module.

Consideration

To implement this user exit we must have to enable below functionality in the transaction code "OMCZ"





Comments

Popular posts from this blog

Adding New Input Fields to SAP Confirmations Screen (CO11N/COR6N) Without Coding

It is possible to add additional input fields in the SAP production order confirmation screen without coding. We can do this just adding fields to a structure which is included in AFRU table (Confirmation table). Process Steps Step 1:   Go to below customizing path. SIMG > Production > Shop Floor Control > Operations > Confirmation > Single Screen Entry > Define Single Screen Entry for Confirming Production Order Step 2:  Double click on the standard profile. Add "Customer Specific Fields of CI_AFRU" in the detail area. Step 3:  Go to default tab. Select an option from the "Customer Specific Fields" area. Then click on save button. Step 4:  Go to transaction code "SE11". Select database table and put "AFRU" and click on change button. Step 5:  Go to the include marked in the screenshot and double click on the data element of the include. Step 6:  Double click on "CI_AFRU". Step 7:  Click on "Yes" in the pop u...

SAP Production Order Confirmation Table List

SAP Production Order Confirmation is a process that enables companies to confirm the completion of production orders in the SAP system. The confirmation process allows companies to track and manage the progress of production orders, as well as record the actual quantities of materials used and the time taken to complete the production order. Production order confirmation tables are listed here. AFFW                     Goods Movements with Errors from Confirmation AFFWPRO           Log of deleted AFFW entries AFRC                     Incorrect cost calculations from confirmation AFRD                     Default values for collective confirmation AFRH                     Header information for confirmation pool AFRH_DEL ...

SAP Quality Management Transaction Codes

 SAP Quality Management transaction codes are listed here. Quality Management General Transaction Code List T-Codes Function Q000 Quality management QA00 Quality inspection QA01 Create Inspection Lot QA01A  Create Inspection Lot QA02 Change Inspection Lot QA02A  Change Inspection Lot QA03 Display inspection lot QA05 Job planning: Periodic inspection QA06 Job overview: Periodic inspection QA07 Trigger for recurring inspection QA07L  Deadline Monitoring Log QA08 Collective Processing of Insp. Setup QA09 No. range maintenance for insp.lots QA10 Trigger automatic usage decision QA10L  Log for Automatic Usage Decision QA11 Record usage decision QA12 Change usage decision with history QA13 Display usage decision QA14 Change UD witho...