Custom number ranges for serial numbers are helpful when users want to automatically create serial numbers for materials instead of barcode scanning or manually entering long, tedious numbers. By creating and implementing a custom number range, you ensure that any user who selects ‘Auto-Create’ serial numbers while performing business processes will input serial numbers that meet your specific serial number requirements. Your serial numbers will be consistent and easier to track.
In this blog, we will show how you can create a custom number range for serial numbers in your system. This demonstration will be done using the BAdI Internal Serial Number Assignment using Developer Extensibility (LOSN_SER_NUM_INT_CREATE) which is available for developer extensibility.
For more details on Developer Extensibility, see Developer Extensibility.
Note: Developer extensibility is only available in a 3-system landscape. For more information about system landscapes, see System Landscapes in SAP S/4HANA Cloud.
We will show you a basic implementation of this BAdI using ADT and then create custom serial numbers in the Manage Stock app by posting the initial entry of a serialized material and auto-creating the serial numbers for that material.
Example showing the assignment of automatically created serial numbers in the Mange Stock app.
To get started, create your own BAdI implementation in ADT. Right click on your package, select New > Other ABAP Repository Object.
Then, filter for “BAdI.” Select “BAdI Enhancement Implementation” and click Next.
Enter a name and description. In this example, I have entered the name “ZTESTIMPLEMENTATION” and the description “Test Creation of custom SN.” Next, search for the enhancement spot: LOSN_SERIAL_NUMBER_ASSIGNMENT.
Once the enhancement implementation is created, click on the button Add BAdI Implementation.
Enter the BADI Definition LOSN_SER_NUM_INT_CREATE and create an implementation name. I entered ”zBAdItestSN.” Click Add.
Next, enter a class name of your choosing in the Implementing Class field, and click on the Implementing Class hyperlink to create the class.
Enter the class details and click next.
Activate the class. Now go to the class and write your code in the method ' if_losn_ser_num_int_create~get_serial_number '.
In the following example case, we have used the code from the example implementation.
Save and activate.
Now login to your S/4 HANA Cloud, Public Edition system and open the Manage Stock app. Select a serialized material. Enter the quantity of materials which you would like to post for initial entry, navigate to the value help in serial numbers field and select “Auto-Create.” After posting, navigate to the Material Documents Overview app by clicking on the link of the success dialog. In the material document that you just created, you can view the serial numbers that were automatically created using the internal numbering system that you implemented.
For more information, see the SAP Help Portal: Extensibility for Serial Number Creation.
I hope this blog helps you to create your own custom serial numbers! If you liked it, please comment below!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
8 | |
8 | |
7 | |
4 | |
3 | |
3 | |
3 | |
2 | |
2 | |
2 |