Dec 12, 2020

How to place Equipment serial numbers into BAPI_PO_CREATE1 from internal number range

For some reasons business requires Material SNs related to equal Equipment number.

In this case you have to make some customizings:

Create new Equipment Category in OIET t-code (SPRO -- Plant Maintenance and Customer Service -- Master Data in Plant Maintenance and Customer Service -- Technical Objects -- Equipment -- Equipment Categories -- Define Number Ranges):


.. then in OIEN (or SPRO: Plant Maintenance and Customer Service -- Master Data in Plant Maintenance and Customer Service -- Technical Objects -- Equipment -- Equipment Categories -- Define Number Ranges) define group and NR for group:

.. assign group with NR to Equipment category:

.. create new serial number profile with equipment category X without warnings in t-code OIS2 (SPRO: Plant Maintenance and Customer Service -- Master Data in Plant Maintenance and Customer Service -- Technical Objects -- Serial Number Management -- Define Serial Number Profiles):

.. then inside the newly created profile define Serialization procedures, where you will generate SN,  with Equipment Requirement = 02 always with equipment: 


Create new material master with SN profile Z001, Serialization Level = 1 Keep equipment number and serial number synchronous:

From now you can assign SN to material numbers in ME21n by clocking the button 

The only problem is you are unable to use the same NR in BAPI_PO_CREATE1 function module.
Because you have to put serial numbers to SERIALNUMBER table parameter from EXTERNAL number range using NUMBER_GET_NEXT fm with EQUI_NR number range object. Else BAPI fals with error:
Equipment number XXXXXXXXXXXX not in external number interval

To resolve the issue you have to create another one Number Range Object (e.g. ZEQUI_NR) and create new EXTERNAL number range with the same values as it's for EQUI_NR internal number range.
Use ZEQUI_NR internal NR in 
NUMBER_GET_NEXT parameters.
For BAPI it will be proper external number.





No comments:

Post a Comment

Batch Split in IBD via BAPI_INB_DELIVERY_CHANGE

 Stolen from answers.sap.com REPORT z_delivery_batch_split. DATA :header_data LIKE bapiibdlvhdrchg,      header_control LIKE bapiibdlvhdr...