Home > ABAP, API, SAP ERP, SD > Serial Number Function Module in SD

Serial Number Function Module in SD

September 24th, 2009 Leave a comment Go to comments

You can use serial number component to identify and differentiate between individual items of material.All the function modules related to serial number in SD module is located in function group IPW1(Serial Number Management in Documents).

Below are the most useful function module to add serial number to an SD document like sales order,delivery document and so on. It also contains a sample code to show you how to use these function module.
SERNR_ADD_TO_AU
SERNR_ADD_TO_HU
SERIAL_LISTE_POST_AU

* save the serial no
  LOOP AT it_sernr[] INTO it_sernr.
 
    CALL FUNCTION 'SERNR_ADD_TO_AU'
      EXPORTING
        sernr                       = it_sernr-sernr
        profile                     = lv_sernp
        material                    = i_matnr
        quantity                    = lv_qty
        document                    = i_vbeln
        item                        = i_posnr
        debitor                     = i_kunnr
        vbtyp                       = i_vbtyp
        sd_auart                    = i_auart
        sd_postyp                   = i_pstyv
     EXCEPTIONS
       konfigurations_error        = 1
       serialnumber_errors         = 2
       serialnumber_warnings       = 3
       no_profile_operation        = 4
       OTHERS                      = 5.
 
  ENDLOOP.
 
* save the serial number to the database
 
  CALL FUNCTION 'SERIAL_LISTE_POST_AU'.

The profile is the serial no profile which defined in material master.

  1. jonnjenkind
    September 30th, 2009 at 03:31 | #1

    I want to say – thank you for this!

  1. No trackbacks yet.