Wednesday, March 9, 2011

Serial Number Generation

Requirement: Generate serial numbers, used for the purpose of identification of a specific line item/custom field in a table (enhanced or created) and so on. I do not seek to elaborate on where serial numbering can be of use, only because doing it would project a wrong impression of gross under-usage.

SAP's documentation of an object for serial number maintenance goes like this "A number range object defines the characteristic attributes of commercially-related number range intervals, e.g. the length of the numbers, the division in subobjects, etc. A number range object is uniquely identified by its name. For example : MATERIALNR is the name of the number range object which defines the attributes of the material master number range interval".
Transactions: SNRO
Tables Affected: NRIV (Number Range Intervals)


Running the above transaction, takes us to the below screen.

I have created a data element in DDIC. This would be the object name for which the number generation happens. (It can also be the field of a table. The data element here is purely for the purpose of illustration).



The next screen requires us to enter the short text, long text, number length domain and warning percentage under specifications for customization. (Typically 10%). We might be inclined to enter the data element's name for which the Number Range Object is being created.
However, if the domain of the data element, does not have a value table, it is bound to give a message "Domain XYZ of Data Element ABC does not have value table". The best thing here is to leave the field "Subobject Data Element" BLANK. 


Defining the Number Range.

Click on Edit Intervals to maintain the range.
Choosing the checkbox makes it external numbering. "The number range intervals are not included in automatic recording of customizing changes.  Transport of all the changes made within number range interval maintenance must be triggered manually."
The current number at any point can be reset as shown below.

Function Modules to determine the serial number:
  1. CVFA_NUMBER_DRAW_FROM_NUMRANGE
  2. NUMBER_GET_NEXT

 
 
 

Rule Modeler for Automatic Routing of Cases






















Thursday, February 24, 2011

Cutom T-code creation for table maintenance.

My on-site coordinator wanted me to create z-tcodes for a few custom tables. I must accept, that it was the first time i was creating a transaction code for table maintenance. And i find it fair to presume, not everyone would be knowing the process - hence this post. (Hope you are fine with the justification, even if you are not - i care little :P. Okay, getting on with the post...)
Steps
1. Generate Table Maintenance for the TABLE.
2. View for the table must be created. (A maintenance view).
3. Table Maintenance Generator Activity (again) - this time for the VIEW.
4. Go to SE93.
5. Type in the z-tcode of your choice and click on create/press F5.
6. Choose the last option (Parameter transaction) and key in a description for the T-Code.
7. Fill in the required fields as illustrated below. (Of course, the name of the table-view will differ).

8. Check for inconsistencies.
9. You are good to go 
10. Smile please


Error issued when planned orders are changed "MRP controller does not exist in plant"

As has been the case with the previous three posts, this one was an issue I faced and managed to resolve.
I wanted to check a particular functionality on a custom module pool screen after changing planned order quantities from MD12. However when i tried saving after making changes, i got the following error.
Moving to the second tab "Assignment" gave me this, and i was thrown out of the transaction - ruthlessly (dramatic enough?)
Determined to find the cause, i made some assumptions which were right on target.
A validation has been performed on the combination of MRP Controller and Plant, when the save button is clicked and hence the error.

However, if there was no link connecting the MRP controller 001 with the plant PT01, how was the planned order created in the first place using transaction MD11?

The logical implication to follow was that the MRP controller initially belonged to plant PT01, and planned orders were created. (Above is the screenshot of transaction OMD0 where the connection between plants and MRP controllers is made). Later on, the controller moves to another plant or is removed from the system. And when attempts are made to change the previously created planned orders, the error is thrown. Savvy?

To ensure that these assumptions do not go wayward, the following was performed. Creation of the MRP controller 001 in the plant PT01 using the OMD0 transaction.

These values go and sit in table T024D which is meant for MRP controllers created in the SAP system.


This in-turn creates a customizing request which can be accessed using SE09/SE10.



Friday, February 11, 2011

Serial Numbers for Invoices

In case of invoices, serial numbers can come from the sales order, or the delivery, or the material document etc. depending on the flow strategy of the company that is creating the invoices. As such, SAP provides us with a function module that can be used for getting serial numbers for the invoices from wherever required. So, the first step when getting serial numbers should be knowing where the serial numbers will be assigned to materials, that is, sales orders, deliveries, material documents, or any of the other documents that are related to invoices.

The function module name is GET_SERNOS_OF_DOCUMENT.
The most important Import parameter here is KEY_DATA, which contains information on where the serial numbers are stored, and numbers of orders, deliveries, invoices etc.

We'll discuss a few fields in that structure here:
TASER - Table for Serial Numbers
This field will contain the name of the table which indicates where the serial numbers come from. For example, SER01 is for serial numbers from delivery, SER02 is for serial numbers from maintenance contract (SD), SER03 is for serial numbers from goods movements and so on.

LIEF_NR - Delivery
As is evident from the name, this field will contain the delivery number for the invoice concerned. This needs to be filled when TASER = 'SER01'. The other field to be filled with this is POSNR - Delivery Item. A point to be noted here is that since delivery number and item number are filled, a dummy document number has to be passed in field SDAUFNR.

MBLNR - Number of Material Document
This will be filled when TASER = 'SER03', i.e. we are getting serial numbers based on material document. The other fields accompanying this field is MJAHR - Material Document Year, ZEILE - Item in Material Document.

PPAUFNR - Order Number
This will be filled when TASER = 'SER02', i.e. SD Order based serial numbers. The other field to be filled with this is PPOSNR - Order Item Number.

Filling up the above fields and passing to the function module will return the serial number(s) through the table parameter SERNOS, which has the same structure as KEY_DATA import structure. The field SERNR contains the serial numbers.

Thursday, February 3, 2011

Production Planning - Planned orders and backflushing: REM

Planned orders - Material Requirement Planning:
Often, on the shop floor, there are certain materials which fall short. The first step towards ensuring that the procurement of a plant material for a certain quantity for a specific date occurs on time is the planned order.
Table - PLAF
Field - PLNUM.
Transaction to create a planned order - MD11.
Related tables - KBKO (Changes are reflected here when values of PSTTR, PEDTR are changed via MD12).
Planned orders, as is usually the case are connected with other related modules, the most striking being Inventory Management.
The question is, what is done after the materials are bought? When it is made available.
Backflushing comes into the picture. SAP glossary states that "The goods issue posting for backflushed components is performed automatically at the time of order completion confirmation".
Transaction - MFBF, MF70.


There is another case when there is a physical withdrawal for an order - Non-manual posting of issue of components is needed here.

The clerk working in the shopfloor in the REM industry would be acquainted (repetitive manufacturing)with some of these terms.

SAP REM


Above configuration is used to define how the system deals with the entire process of backflushing - including BOM corrections, reduction of planned order quantities and more