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.

No comments:

Post a Comment