Help: How to add serial number data into Delivery Order document

Dear Gurus,
I am creating an interface program and I have problem in attaching the serial number data to the corresponding material code for a certain delivery order document in R/3 4.6C SP22 system.
The serial number can be attached either during the creation of the Delivery Order itself or in the subsequent step after creating the Delivery Order (i.e.: create the D/O document first, and then update the D/O data).
The BAPI_OUTB_DELIVERY_CONFIRM_DEC FM does not provide any input parameter to let me put the serial number in this R/3 version.
By tracing in SE30 the standard program VL02N --> Menu --> Extras --> Serial Number --> Continue (Enter) --> Save (Ctrl+S), I found out that the serial attachment 'might' be done during sub-routine SERIAL_LISTE_POST_LS in program SAPLIPW1. It will in turn executes FM SERIAL_LISTE_POST_LS. The commit to database table will be done in update task by FM OBJK_POST_UPDATE_N and SERIAL_POST_UPDATE_LS.
<b>My question:</b>
============
1. Is FM SERNR_ADD_TO_LS can be used to attach the serial number to D/O?
If yes, how to do it please because I already tried it I can not see the serial information in VL02N after that. There is no any insert or update to database in this function module. Should I call other FM after this? I want to try to call FM OBJK_POST_UPDATE_N and SERIAL_POST_UPDATE_LS but I do not know how I can retrieve the global object such as XOBJK_ALL that is necessary for the input parameter.
2. If SERNR_ADD_TO_LS can not be used, what other FM can I use? Can I call SERIAL_LISTE_POST_LS instead? Is there any reliable way to generate the import parameter for this FM, such as XSER00, XSER01, XOBJK_ALL and XEQUI?
Thank you in advanced for your kind assistance.
Best Regards,
Hiroshi

Try something similar to this below...
Afterwards you should do a call transaction to VL02N and immediately SAVE. This is sufficient to ensure the status on the serial numbers is updated correctly.
FUNCTION z_mob_serialnr_update_ls.
""Local interface:
*" IMPORTING
*" VALUE(VBELN_I) LIKE LIKP-VBELN
*" TABLES
*" SERNO_TAB STRUCTURE RISERLS
*" YSER00 STRUCTURE SER00 OPTIONAL
*" YSER01 STRUCTURE RSERXX OPTIONAL
*" YOBJK_ALL STRUCTURE RIPW0 OPTIONAL
*" YEQUI STRUCTURE RIEQUI OPTIONAL
*" YMASE STRUCTURE MASE OPTIONAL
*" EXCEPTIONS
*" NO_EQUIPMENT_FOUND
The modified/confirmed table of serial numbers is supplied in
SERNO_TAB.
These are updated in the SAP tables
YSER00 - General Header Table for Serial Number Management
YSER01 - Document Header for Serial Numbers for Delivery
YOBJK_ALL - Internal Table for Object List Editing/Serial Numbers
YEQUI - Internal Structure for IEQUI
local data
DATA: BEGIN OF del_wa,
vbeln LIKE likp-vbeln,
posnr LIKE lips-posnr,
matnr LIKE lips-matnr,
lfimg LIKE lips-lfimg.
DATA: END OF del_wa.
DATA: del_tab LIKE del_wa OCCURS 0.
DATA: _ct TYPE i.
DATA: lastobknr LIKE objk-obknr.
DATA: _debug.
CLEAR: yser00, yser01, yobjk_all, yequi, ymase.
REFRESH: yser00, yser01, yobjk_all, yequi, ymase.
GET PARAMETER ID 'ZEDI_DEBUG' FIELD _debug.
OBJECT KEYS
read the delivery items with serial numbers to be processed
SELECT * INTO CORRESPONDING FIELDS OF TABLE del_tab
FROM lips
WHERE vbeln = vbeln_i
AND serail NE space.
if nothing is relevant for serial numbers bailout
DESCRIBE TABLE del_tab LINES _ct.
IF _ct IS INITIAL.
EXIT.
ENDIF.
==== read the existing object keys for delivery items
SELECT * INTO CORRESPONDING FIELDS OF TABLE yser01
FROM ser01
WHERE lief_nr = vbeln_i.
IF sy-subrc = 0.
yser01-dbknz = 'X'. "entry exists in db
MODIFY yser01 TRANSPORTING dbknz WHERE dbknz = space.
ENDIF.
== check if there is a header entry for the delivery item
LOOP AT del_tab INTO del_wa.
READ TABLE yser01 WITH KEY lief_nr = del_wa-vbeln
posnr = del_wa-posnr.
IF sy-subrc NE 0.
create one
CALL FUNCTION 'OBJECTLIST_NUMBER'
IMPORTING
obknr = yser01-obknr.
yser00-mandt = sy-mandt.
yser00-obknr = yser01-obknr.
APPEND yser00.
SELECT SINGLE kunnr INTO (yser01-kunde)
FROM likp
WHERE vbeln = vbeln_i.
yser01-mandt = sy-mandt.
yser01-lief_nr = del_wa-vbeln.
yser01-posnr = del_wa-posnr.
yser01-vorgang = 'SDLS'.
yser01-vbtyp = 'J'.
yser01-bwart = '601'.
yser01-dbknz = space. "not in db
yser01-loknz = space. "do not delete
APPEND yser01.
ENDIF.
ENDLOOP.
check if any entries should be deleted
LOOP AT yser01.
READ TABLE serno_tab WITH KEY vbeln = yser01-lief_nr
posnr = yser01-posnr.
IF sy-subrc NE 0.
yser01-loknz = 'X'. "mark for delete
MODIFY yser01.
ENDIF.
ENDLOOP.
collect all the object keys for the delivery item with s/n's
LOOP AT yser01.
READ TABLE serno_tab WITH KEY vbeln = yser01-lief_nr
posnr = yser01-posnr.
IF sy-subrc = 0.
READ TABLE yser00 WITH KEY obknr = yser01-obknr.
IF sy-subrc NE 0.
yser00-mandt = yser01-mandt.
yser00-obknr = yser01-obknr.
APPEND yser00.
ENDIF.
ENDIF.
ENDLOOP.
IF NOT _debug IS INITIAL. BREAK-POINT. ENDIF.
SERIAL NO OBJECTS
==== read the existing serial numbers from the database
via object number into YOBJK_ALL
LOOP AT yser00.
SELECT * APPENDING CORRESPONDING FIELDS OF TABLE yobjk_all
FROM objk
WHERE obknr = yser00-obknr.
ENDLOOP.
yobjk_all-dbknz = 'X'.
MODIFY yobjk_all TRANSPORTING dbknz WHERE dbknz = space.
=== add any new serial numbers
LOOP AT serno_tab.
READ TABLE yser01 WITH KEY lief_nr = serno_tab-vbeln
posnr = serno_tab-posnr.
READ TABLE yobjk_all WITH KEY sernr = serno_tab-sernr
matnr = del_wa-matnr.
IF sy-subrc NE 0.
this is a new serial number
yobjk_all-mandt = sy-mandt.
yobjk_all-obknr = yser01-obknr.
yobjk_all-obzae = 0.
yobjk_all-equnr = yequi-equnr.
yobjk_all-objvw = 'S'.
yobjk_all-sernr = serno_tab-sernr.
yobjk_all-matnr = del_wa-matnr.
yobjk_all-datum = sy-datum.
yobjk_all-taser = 'SER01'.
yobjk_all-equpd = 'X'.
yobjk_all-objnr = yequi-objnr.
yobjk_all-dbknz = space.
yobjk_all-loknz = space.
APPEND yobjk_all.
ENDIF.
ENDLOOP.
=== mark any which are no longer confirmed as deleted
LOOP AT yobjk_all.
READ TABLE yser01 WITH KEY obknr = yobjk_all-obknr.
READ TABLE serno_tab WITH KEY vbeln = yser01-lief_nr
posnr = yser01-posnr
sernr = yobjk_all-sernr.
IF sy-subrc NE 0.
yobjk_all-loknz = 'X'.
MODIFY yobjk_all TRANSPORTING loknz.
ENDIF.
ENDLOOP.
EQUIPMENT RECORDS
== get the equipment records
LOOP AT yobjk_all.
SELECT SINGLE * INTO CORRESPONDING FIELDS OF yequi
FROM equi
WHERE sernr = yobjk_all-sernr
AND matnr = yobjk_all-matnr.
IF sy-subrc NE 0.
CONTINUE.
ENDIF.
IF yobjk_all-dbknz = space AND
yobjk_all-loknz = space.
yequi-dbknz = 'X'.
yequi-obknr = yobjk_all-obknr.
yequi-j_vorgang = 'PMS3'. "add to delivery
yequi-matnr_old = yequi-matnr.
APPEND yequi.
yobjk_all-equnr = yequi-equnr.
MODIFY yobjk_all TRANSPORTING equnr.
CONTINUE.
ENDIF.
IF yobjk_all-dbknz = 'X' AND
yobjk_all-loknz = 'X'.
yequi-dbknz = 'X'.
yequi-j_vorgang = 'PMSA'. "delete from delivery
yequi-matnr_old = yequi-matnr.
APPEND yequi.
CONTINUE.
ENDIF.
ENDLOOP.
remove any Equipment records that do not need to be processed
DELETE yequi WHERE j_vorgang IS initial.
IF NOT _debug IS INITIAL. BREAK-POINT. ENDIF.
fill the object counter
LOOP AT del_tab INTO del_wa.
READ TABLE yser01 WITH KEY lief_nr = del_wa-vbeln
posnr = del_wa-posnr.
DO del_wa-lfimg TIMES.
READ TABLE yobjk_all WITH KEY obknr = yser01-obknr
obzae = sy-index.
IF sy-subrc NE 0.
READ TABLE yobjk_all WITH KEY obknr = yser01-obknr
obzae = 0.
IF sy-subrc = 0.
yobjk_all-obzae = sy-index.
MODIFY yobjk_all INDEX sy-tabix TRANSPORTING obzae.
ENDIF.
ENDIF.
ENDDO.
ENDLOOP.
IF NOT _debug IS INITIAL. BREAK-POINT. ENDIF.
===========================================
update the delivery
===========================================
CALL FUNCTION 'SERIAL_LISTE_POST_LS'
TABLES
xser00 = yser00
xser01 = yser01
xobjk_all = yobjk_all
xequi = yequi
xmase = ymase.
TAB_CUOBJ =
XSER03 =
CALL FUNCTION 'STATUS_BUFFER_EXPORT_TO_MEMORY'
EXPORTING
i_memory_id = memid_status.
COMMIT WORK AND WAIT.
CALL FUNCTION 'Z_MOB_SERIALNR_REFRESH_LS'
EXPORTING
ctu = 'X'
mode = 'N'
UPDATE = 'L'
GROUP =
USER =
KEEP =
HOLDDATE =
NODATA = '/'
vbeln_i = vbeln_i.
IMPORTING
SUBRC =
TABLES
MESSTAB =
ENDFUNCTION.
FUNCTION z_mob_serialnr_refresh_ls.
""Local interface:
*" IMPORTING
*" VALUE(CTU) LIKE APQI-PUTACTIVE DEFAULT 'X'
*" VALUE(MODE) LIKE APQI-PUTACTIVE DEFAULT 'N'
*" VALUE(UPDATE) LIKE APQI-PUTACTIVE DEFAULT 'L'
*" VALUE(GROUP) LIKE APQI-GROUPID OPTIONAL
*" VALUE(USER) LIKE APQI-USERID OPTIONAL
*" VALUE(KEEP) LIKE APQI-QERASE OPTIONAL
*" VALUE(HOLDDATE) LIKE APQI-STARTDATE OPTIONAL
*" VALUE(NODATA) LIKE APQI-PUTACTIVE DEFAULT '/'
*" VALUE(VBELN_I) LIKE LIKP-VBELN
*" EXPORTING
*" VALUE(SUBRC) LIKE SYST-SUBRC
*" TABLES
*" MESSTAB STRUCTURE BDCMSGCOLL OPTIONAL
DATA: vbeln_001 LIKE bdcdata-fval.
vbeln_001 = vbeln_i.
subrc = 0.
PERFORM bdc_nodata USING nodata.
PERFORM open_group USING group user keep holddate ctu.
PERFORM bdc_dynpro USING 'SAPMV50A' '4004'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LIKP-VBELN'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'LIKP-VBELN'
vbeln_001.
PERFORM bdc_dynpro USING 'SAPMV50A' '1000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=PSER_T'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LIPS-POSNR(01)'.
PERFORM bdc_dynpro USING 'SAPLIPW1' '0200'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RIPW0-SERNR(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=RWS'.
PERFORM bdc_dynpro USING 'SAPMV50A' '1000'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=SICH_T'.
PERFORM bdc_field USING 'BDC_CURSOR'
'LIPS-MATNR(02)'.
PERFORM bdc_transaction TABLES messtab
USING 'VL02N'
ctu
mode
update.
IF sy-subrc <> 0.
subrc = sy-subrc.
EXIT.
ENDIF.
PERFORM close_group USING ctu.
ENDFUNCTION.
INCLUDE bdcrecxy.

Similar Messages

  • Problem when Add Serial Number for Goods Receipt PO Document

    Dear All,
    In my App I have function to Add goods receipt PO and Serial for these items of this document as code bellows:
    oGrp = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseDeliveryNotes)
                'Add Header Goods Receipt
                oGrp.CardCode = "CC1"
                oGrp.CardName = "Card Code 1."
                oGrp.DocDate = now
                oGrp.DocDueDate = now
                oGrp.TaxDate = now
                Dim Qty As Int32 = 2
                For i As Integer = 0 To Qty - 1
                    oGrp.Lines.SerialNumbers.SystemSerialNumber = 1
                    oGrp.Lines.SerialNumbers.ManufacturerSerialNumber = "MSR01" & "-" & i
                    oGrp.Lines.SerialNumbers.InternalSerialNumber = "ISR01" & "-" & i
                    oGrp.Lines.SerialNumbers.SetCurrentLine(i)
                    oGrp.Lines.SerialNumbers.Add()
                Next
                oGrp.Lines.ItemCode = "YMY2H-BLACK"
                oGrp.Lines.ItemDescription = "My Item"
                oGrp.Lines.Currency = "USD"
                oGrp.Lines.Quantity = Qty
                oGrp.Lines.Price = 10000
                oGrp.Lines.DiscountPercent = 0
                RetVal = oGrp.Add()
                If RetVal <> 0 Then
                    oCompany.GetLastError(ErrCode, ErrMsg)
                    Return -1
                Else
                  End If
    When Add this document I have Error : "You should use existing serial/batch numbers for this document type ". Please help me fix this problem. In my SAP doesn't have Serial for these item. Please let me know How to add serial master data?
    Thanks & Regards

    Dear,
    Thanks for your support but when I chaged code as bellows:
    oGrp = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseDeliveryNotes)
                'Add Header Goods Receipt
                oGrp.CardCode = "CC1"
                oGrp.CardName = "Card Name."
                oGrp.DocDate = MyArrContainDocInfo(2)
                oGrp.DocDueDate = MyArrContainDocInfo(3)
                oGrp.TaxDate = MyArrContainDocInfo(4)
                Dim Qty As Int32 = 2
                oGrp.Lines.ItemCode = "YMY2H-BLACK"
                oGrp.Lines.ItemDescription = "My Item"
                oGrp.Lines.Currency = "USD"
                oGrp.Lines.Quantity = Qty
                oGrp.Lines.Price = 10000
                oGrp.Lines.DiscountPercent = 0
                For i As Integer = 0 To Qty - 1
                    oGrp.Lines.SerialNumbers.SetCurrentLine(i)
                    oGrp.Lines.SerialNumbers.SystemSerialNumber = i
                    oGrp.Lines.SerialNumbers.ManufacturerSerialNumber = "MSR01" & "-" & i
                    oGrp.Lines.SerialNumbers.InternalSerialNumber = "ISR01" & "-" & i
                    oGrp.Lines.SerialNumbers.Add()
                Next
                RetVal = oGrp.Add()
                If RetVal <> 0 Then
                    oCompany.GetLastError(ErrCode, ErrMsg)
                    Return -1
                Else
                              End If
    I have the same Error: "You should use existing serial/batch numbers for this document type". I try config in Gerneral Setting Form as image bellow: [http://www.hoanghaicap.com/GS.png|http://www.hoanghaicap.com/GS.png]. Please help me fix this problem. I try Add Goods receipt PO with items manage by Serial it's OK but by SDK it's not OK.
    Thanks & Regards,
    Edited by: Tao lao on Mar 10, 2010 2:44 AM

  • How to add a hide data into an appointed image of the pdf

    Can I add data into an appointed image and hide the data?
    if can not add hide data in image, can I  add hide the data into the other layer  of   the pdf?
    Can anybody give me some tips?
    thanks!

    My code:
    ASFile hddatFile = NULL;
    ASPathName hidedataFile = ASFileSysPathFromDIPath (ASGetDefaultFileSys(),  "e:/myInfo.txt", NULL);
    if (hidedataFile == NULL)
         AVAlertNote("not yet");
    ASInt32 hidedataVal = ASFileSysOpenFile(NULL, hidedataFile, ASFILE_READ, &hddatFile);
    if (hidedataVal != 0)
         AVAlertNote("隐藏数据加载失败!");
    CosObj imgCos;
    PDEImageGetCosObj(pdeImage, &imgCos);
    CDocument cDocument;
    ASAtom Seal_K = ASAtomFromString("ADBE:Mytest");
    CosDictPut(imgCos, Seal_K, CosNewInteger((CosDoc)cDocument, false, ASFileGetEOF(hddatFile)));
    I'm not sure whether I have set the hide data in the picture success? there is not a return value to know it.
    when I use this code to get data:
    CosObj stream;
    PDEImageGetCosObj((PDEImage)pdeElement, &stream);
    CosObj nameCosObj = CosDictGet(stream, Seal_K);
    the return value (nameCosObj is (0,0)).  I dont know why? and if I get the cosObj, How to get my hide data?
    Where I do wrong?
    thanks for Leonard !

  • How to add the error message into Delivery Error Log (VL10A,VL10X)

    Hi,
    I have a to add my custom message into Delivery creation error log (VBFS, VBSS)
    This message should be shown in the Collective process log (VL10X, VL10A).
    Please give me the soln to solve this problem.
    I have searched in SDN, i didnt get the proper solution
    Thanks
    Shankar

    HI,
    Make use of the BADi "LE_SHP_DELIVERY_PROC"
    Use the method DELIVERY_FINAL_CHECK.
    Pass the error messages in table CT_FINCHDEL.
    Regards,
    Ankur Parab

  • How to add Serial Number to the batch report name?

    How to format the report name for batch model to have <Sequencename>_<batch_SerialNumber>_<DateTime>.xml. Everytime a different sequence is executed the report file name should be formated with that sequence name and batch serial number porvided. I am using TS4.1
    Sequential model has a Determine Report File Path, is there something similar for batch model also, if so where?
    Thanks.
    CLD,CTD

    Did hit Post too early, here is the remaining,
    For the second part 
    have the serial number of each individual DUTs included in its file name
    The setting in Report Option will also save the UUT report with UUT serial Number included in the following format:
    SeqFileName_[UUT][Date][Time].xml where [UUT] will store the UUT serail number.
    CLD,CTD
    Attachments:
    reportOptions.jpg ‏85 KB

  • How to add serial number contolled item with serial numbers in sales order.

    Hi OM Functional Experts,
    I need a help on sales order booking.
    We have serial controlled items in our inventory. At the time of booking a sales order, we need to call the items with the appropriate serial numbers [ for example, if i book an item for a qty of 10, then, the system should get the details ( serial number ) of the 10 item's serial number ].
    And the serial numbers are Pre-defined by the organization for their internal tracking from the porcess 1 till end of the assembly line.
    The purpose of this step, is to reduce the particular serial numbered item from the inventory, when we reserve/pick release the sales order.
    thanks in advance.
    Rdx,
    J kannan
    Edited by: J Kannan on Feb 17, 2009 1:23 AM

    Kannan
    OK. Unfortunately reservations cannot be created at the serial number level. So the unsupported way of doing this is updating the mtl_serial_numbers tables. I hope you would know (by some means) which serial numbers you want to allocate to a specific sales orders. If you know, update group_mark_id column in mtl_serial_numbers table with your order_line_Id, This will avoid any one from picking the serial numbers (they will not come up in the LOV or will not be auto allocated).
    But you have to make sure to take it off when you actually want to pick this order line and allocate this serial number. So just before you pick release/ confirm this order line you need to update column back to null so that you can allocate that serial number.
    Thanks
    Nagamohan

  • How to add Serial Number to the report name?

    HI,
    I'd like to add the option of including the SN to the report name.  A good option will be to automatically set the default base name to the SN.
    I'm open to suggestions. Either a simple solution where I'll always get the SN as the base name, or
    a more complicated solution where I can really make some modifications to the report option dialog page to include that upon user selection.
    Thanks
    Rafi
    TS3.5+CVI8.0
    p.s. an example, if exist, will be highly useful (and appreciated of course)

    That's okay... I can answer here as well...
    Under Configure >> Report Option
    UNSELECT "Store UUT Report in Batch Report File" first, then select "New UUT Report File for Each UUT"
    New UUT Report File for Each UUT—Appends a string containing the current UUT serial number to the base name of the report file. For example, uut_report.html becomes uut_report[SN000001].html. This setting is not available if you select Store UUT Report in Batch Report File.

  • How to add a new node into existing XML Document

    I have a very simple question. I use XML as input argument for PL/SQL procedure that inserts data into the corresponding table. All I have to do is to add a new tag for Primary Key column and put sequence.NEXTVAL - value into it.
    <ROWSET>
    <ROW>
    -- Add <ID_table_name> value </ID_table_name> ??????
    <FIELD1>data1</FIELD1>
    <FIELD2>data1</FIELD2>
    </ROW>
    </ROWSET>
    I've parsed XML, but I couldn't find the way how to insert the new NODE.
    If you know how to use packages XMLDOM, XMLParser for this purpose, please help me!
    Oracle version 8.1.7

    DOMParser parser=new DOMParser();
    XMLDocument xmlDocument=parser.getdocument();
    Node node=xmlDocument.selectSingleNode("/ROWSET/ROW");
    Element element=xmlDocument.createElement(String tagName)
    node.appendChild(element);

  • How To Add Serial Number  Dynamically

    Dear all,
    In a dynamic form I require to add cosecutive serial no to the dynamically generated fields.How can I do it?If any body can please help me.
    Thanking you
    Rakesh

    I too need to be able to add a sequence number to each new row that is added to a dynamic form. The fields are being added / deleted as they should be but my JavaScript knowledge is not up to the level where I am able to address individual fields in each new row.
    I've tried script along the lines of:
    _detail[0].Item_Sequence.rawValue = 1;
    _detail[1].Item_Sequence.rawValue = 2;
    Where "detail" is the subform that contains the 'dynamic' rows
    "Item_Sequence" is a numeric field in each row.
    Please help to put an old IBM mainframe developer out of his misery and get to grips with this wonderful world of new fangled Adobe object-oriented technology.

  • Help - how to add my own data to a table

    Hello,
    I looked at the tutorials, but cannot get this to work.
    I want to load a table (each row) with data I read from other tables.
    I tried:
    RowKey rk = objectArrayDataProvider1.appendRow();
    FieldKey fk = new FieldKey("A");
    objectArrayDataProvider1.setValue(fk,rk,"HELLO");
    Can someone point me in the right direction with some good code?
    Thanks
    Frank

    What I am trying to do is asemble data from three tables and add them to a datatable. Data may not be in all three tables, but all info from the first table must be added to the datatable.
    table 1 has a list of procedures, these must be included.
    table 2 has a list of providers
    table 3 has a schedule that has date, procedure_id, provider_id.
    I have to read table 3 for a given date, then add the provider if he is scheduled for a procedure.
    Thanks
    Frank

  • How do I insert multiple photos into an excel document vs inserting each individually?  Insert, Picture, From FIle...now what?  it only allows me to choose 1 at a time.

    Help - How do I insert multiple photos into an excel document vs inserting each individually?  Insert, Picture, From FIle...now what?  it only allows me to choose 1 at a time.

    https://discussions.apple.com/thread/3383532?tstart=0
    Stefan

  • To add serial number column

    Dear Experts,
                        I herewith attachedc my  codings i waht to add serial number how to do that i have done something but it is giving all zero values.,.,.,
    *& Report  ZAPPRAISAL_LAG
    REPORT  ZAPPRAISAL.
    *Declaration of type-pools
    TYPE-POOLS SLIS.
    *Declaration of tables
    TABLES : PA0025, PA0001.
    DATA : LV_VALUE TYPE I.
    *Declaration of work area
    DATA: BEGIN OF WA_PA0025,
            PERNR TYPE PA0025-PERNR,
            ENDDA TYPE PA0025-ENDDA,
            BEGDA TYPE PA0025-BEGDA,
            AEDTM TYPE PA0025-AEDTM,
            BWNAM TYPE PA0025-BWNAM,
            DAT25 TYPE PA0025-DAT25,
            GRPNR TYPE PA0025-GRPNR,
            ENAME TYPE EMNAM,
            BUKRS TYPE PA0001-BUKRS,
            number type i,
          END OF WA_PA0025,
           WA_FCAT TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
           wa_sort  TYPE SLIS_SORTINFO_ALV,
           WA_EVENTS TYPE SLIS_T_EVENT WITH HEADER LINE.
    DATA: row_number type i.
    *Declaration of internal tables
    DATA : IT_PA0025 LIKE TABLE OF WA_PA0025,
           IT_FCAT TYPE SLIS_T_FIELDCAT_ALV,
           I_SORT  TYPE STANDARD TABLE OF SLIS_SORTINFO_ALV,
           IT_EVENTS TYPE SLIS_T_EVENT.
    *selection screen
    SELECTION-SCREEN BEGIN OF BLOCK FF WITH FRAME TITLE TEXT-001.
    *SELECT-OPTIONS S_DATE FOR PA0025-DAT25.
    parameters : p_date type pa0025-dat25.
    parameters : p_date1 type pa0025-dat25.
    SELECT-OPTIONS S_BUKRS FOR PA0001-BUKRS NO INTERVALS.
    SELECTION-SCREEN END OF BLOCK FF.
    *ALV EVENTS
    WA_EVENTS-FORM    = 'HEADER'.
    WA_EVENTS-NAME    = 'TOP_OF_PAGE'.
    APPEND WA_EVENTS TO IT_EVENTS.
    CLEAR : WA_EVENTS.
    *start-of-selection event.
    START-OF-SELECTION.
      SELECT DISTINCT
            A~PERNR
            A~ENDDA
            A~BEGDA
            A~AEDTM
            A~BWNAM
            A~DAT25
            A~GRPNR
            B~ENAME
            B~BUKRS
            INTO TABLE IT_PA0025
            FROM PA0025 AS A
            INNER JOIN PA0001 AS B
            ON BPERNR = APERNR
            WHERE A~DAT25
           between p_date and p_date1
           AND B~BUKRS IN S_BUKRS.
      SORT IT_PA0025 by pernr.
      DESCRIBE TABLE IT_PA0025 LINES LV_VALUE.
    loop at it_pa0025 into wa_pa0025.
    row_number = row_number + 1 .
    WA_PA0025-number   =  row_number.
    *append wa_pa0025 to IT_PA0025.
    endloop.
      perform fcat using '1'  'NUMBER' 'S.no' '12' '' 'C410' 'C'.
      PERFORM FCAT USING '2'  'PERNR' 'Personnel number'    '16'  'X' 'C410' 'C'.
      PERFORM FCAT USING '3'  'ENAME' 'Employee name'       '26'  ''  '' ''.
      PERFORM FCAT USING '4'  'BUKRS' 'Company code'        '15'  ''  '' 'C'.
      PERFORM FCAT USING '5'  'BEGDA' 'Start date'          '11'  ''  '' ''.
      PERFORM FCAT USING '6'  'ENDDA' 'End date'            '10'  ''  '' ''.
      PERFORM FCAT USING '7'  'AEDTM' 'Changed date'        '13'  ''  '' ''.
      PERFORM FCAT USING '8'  'BWNAM' 'Appraiser'           '18'  ''  '' ''.
      PERFORM FCAT USING '9'  'DAT25' 'Appraised date'      '15'  ''  '' ''.
    CLEAR wa_sort.
    wa_sort-fieldname = 'PERNR'.
    wa_sort-up = 'X'.
    APPEND wa_sort TO i_sort.
      CLEAR wa_sort.
      wa_sort-FIELDNAME = 'DAT25'.
      wa_sort-UP = 'X'.
      APPEND wa_sort TO I_SORT.
      CLEAR wa_sort.
      wa_sort-FIELDNAME = 'BUKRS'.
      wa_sort-UP = 'X'.
      APPEND wa_sort TO I_SORT.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          I_CALLBACK_PROGRAM      = SY-CPROG
          I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
          IT_SORT                 = I_SORT
          I_GRID_TITLE            = 'Report'
          IT_FIELDCAT             = IT_FCAT
          IT_EVENTS               = IT_EVENTS
        TABLES
          T_OUTTAB                = IT_PA0025.
    *&      Form  USER_COMMAND
          text
    -->  p1        text
    <--  p2        text
    FORM USER_COMMAND USING U_UCOMM TYPE SY-UCOMM
                            US_SELF_FIELD TYPE SLIS_SELFIELD.
      CASE U_UCOMM.
        WHEN '&IC1'.
          READ TABLE IT_PA0025 INTO WA_PA0025 INDEX US_SELF_FIELD-TABINDEX.
          CASE US_SELF_FIELD-FIELDNAME.
            WHEN 'PERNR'.
              SET PARAMETER ID : 'PER' FIELD WA_PA0025-PERNR.
              CALL TRANSACTION 'PA30'.
          ENDCASE.
      ENDCASE.
    ENDFORM.                    " USER_COMMAND
    FORM FCAT  USING    FP_COL_POS
                        FP_FIELDNAME
                        FP_SELTXT_M
                        FP_OUTPOUTLEN
                        FP_HOTSPOT
                        FP_EMPHASIZE
                        FP_JUST.
      WA_FCAT-COL_POS    =  FP_COL_POS.
      WA_FCAT-FIELDNAME  = FP_FIELDNAME.
      WA_FCAT-SELTEXT_M  = FP_SELTXT_M.
      WA_FCAT-OUTPUTLEN  = FP_OUTPOUTLEN.
      WA_FCAT-HOTSPOT    = FP_HOTSPOT.
      WA_FCAT-EMPHASIZE  = FP_EMPHASIZE.
      WA_FCAT-JUST       = FP_JUST.
      APPEND WA_FCAT TO IT_FCAT.
      CLEAR : WA_FCAT.
    ENDFORM.                    " FCAT
    *&      Form  HEADER
          text
    -->  p1        text
    <--  p2        text
    FORM HEADER .                                               "#EC CALLED
      DATA :     IT_HEADER TYPE SLIS_T_LISTHEADER,
                 WA_HEADER LIKE LINE OF IT_HEADER.
      WA_HEADER-TYP  = 'H'.
      WA_HEADER-INFO = TEXT-006.
      APPEND WA_HEADER TO IT_HEADER.
      CLEAR WA_HEADER.
      WA_HEADER-TYP  = 'S'.
      WA_HEADER-KEY  = TEXT-007.
      CONCATENATE  SY-DATUM+6(2) '.'
                   SY-DATUM+4(2) '.'
                   SY-DATUM(4) INTO WA_HEADER-INFO.   "Current date
      APPEND WA_HEADER TO IT_HEADER.
      CLEAR WA_HEADER.
      WA_HEADER-TYP  = 'S'.
      WA_HEADER-KEY = TEXT-012.
      MOVE LV_VALUE TO WA_HEADER-INFO.
      APPEND WA_HEADER TO IT_HEADER.
      CLEAR WA_HEADER.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          IT_LIST_COMMENTARY = IT_HEADER.
      CLEAR : IT_HEADER[], WA_HEADER.
    ENDFORM.                    " HEADER
    Thanks and Regards,
    Thirukumaran. R

    hi
    LOOP AT it_pa0025 INTO wa_pa0025.
        row_number = row_number + 1 .
        wa_pa0025-number = row_number.
    " Add this statement here
        MODIFY it_pa0025 INDEX sy-tabix FROM wa_pa0025 TRANSPORTING number.
      ENDLOOP.
    Thanks & Regards

  • How to get serial number in bapi BAPI_GOODSMVT_CREATE

    hi everyone
    im using the bapi BAPI_GOODSMVT_CREATE to create goods receipt for a PO but its giving me an error 'Maintain serial numbers for total quantity' and I really dont know how to get the serial number data, i know the table GOODSMVT_SERIALNUMBER should be populated with the serial number data but i dont know where to get the data
    can anybody help me plz?

    Hi,
    Please check the following code
    DATA: lw_header         TYPE  bapi2017_gm_head_01,
             lw_headret        TYPE  bapi2017_gm_head_ret,
             lw_goodsmvt_item  TYPE  tw_goodsmvt_item,
             lt_goodsmvt_item  TYPE  tt_goodsmvt_item,
             lw_return         TYPE  tw_return,
             lt_return         TYPE  tt_return,
             lt_zprefg         TYPE  tt_zprefg,
             lw_zprefg         TYPE  tw_zprefg,
             lw_errorlog       TYPE  tw_errorlog,
             lt_zprefg_temp    TYPE  tt_zprefg,
            lw_afs_goodsmvt_sku TYPE /afs/bapi_gm_sku,
            lt_afs_goodsmvt_sku TYPE STANDARD TABLE OF /afs/bapi_gm_sku.
    CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
         EXPORTING
           goodsmvt_header             = lw_header
           goodsmvt_code               = '04'
      TESTRUN                     = ' '
        IMPORTING
          goodsmvt_headret            = lw_headret
      MATERIALDOCUMENT            =
      MATDOCUMENTYEAR             =
         TABLES
           goodsmvt_item               = lt_goodsmvt_item
      GOODSMVT_SERIALNUMBER       =
           return                      = lt_return
          afs_goodsmvt_sku            = lt_afs_goodsmvt_sku.
    IF sy-subrc EQ 0.
         COMMIT WORK AND WAIT.
       ENDIF.
       LOOP AT lt_return INTO lw_return.
         IF lw_return-type EQ co_msgtyp_e OR
            lw_return-type EQ co_msgtyp_a.
           lw_errorlog-msgtype = lw_return-type.
           lw_errorlog-msgid   = lw_return-id.
           lw_errorlog-msgno   = lw_return-number.
           lw_errorlog-message = lw_return-message.
           APPEND lw_errorlog TO gt_errorlog.
         ELSE.
           UPDATE zprefg FROM TABLE lt_zprefg_temp.
         ENDIF.
       ENDLOOP.
    Pls mark points if helpful
    Line Turbin

  • How to add a new data element for existing table filed(Primary key field)

    Hi Experts,
    How to add a new data element for existing table field(Primary key field)
    For this filed ther is no foreign key relation ships and even check table.
    while activating table it is giving message like below.
    can you help any one to solve this and wil steps to add new dataelement for existing primary key filed of a table.
    Check table (NAMING SPACE/TABLE NAME(EX:/TC/VENDOR)) (username/19.02.10/03:29)           
    Primary key change not permitted for value table /TC/VENDOR
    Check on table  /TC/VENDOR resulted in errors              
    Thanks
    Ravi

    Hi,
    Easiest way is to download the table eg into an Excel table (if possible) or text table. Drop the table from the database. Build your table with the new key field. Build the database table again and fill it.
    You can do it also over the database into a new table. Drop the old one. Build the enhanced one and fill it. Afterwards drop your (temporary) table.
    Maybe there are other ways, but this works.
    Success,
    Rob

  • How to download the script data into pdf file

    how to download the script data into pdf file
    i have one option to download the script data to pdf file --->rstxpdft4 program.
    i have one doubt how to use this proogram.or any function module to download the script data to pdf file.
    Thanks and regards,
    Sri.

    Hi      Sri Sai,
    I know one method to convert the sapscript to pdf file :
    first generate a Spool Request for the required Sapscript
    then goto transaction SP01 and copy the generated Spool Request number
    now execute the SAP report RSTXPDFT4
    here enter the copied Spool request number and the target directory into the parameters
    execute the report
    required pdf file will be generated into the target directory
    i hope it will help you out
    Please refer this simple program:
    http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm
    Reward points if found helpful....
    Cheers,
    Eshwar.

Maybe you are looking for

  • HP Pavilion 15-n268sa will not boot after windows update (windows 8.1)

    After a series of windows update (windows 8.1) my HP Pavilion 15-n268sa will not boot up, no fan noises, no lights no nothing.  I have tried a "hard reset" a number of times with no success.  When the battery is present the white LED flashes 3 times 

  • FM to calculate Customer Discounts

    Hello Experts,                            I need a function module to calculate customer discounts. customer cash discounts that get displayed based on payment terms is what I need. Any pointers to other threads will be much appreciated. Thanks! Rahu

  • After syncing can't open apps

    On my wife's iPad I successfully installed a number of apps, some purchased, some free.  She has her own email address.  However, I purchased the apps in the iTunes Store with my Apple ID. On my mac mini, we have separate accounts.  I opened iTunes i

  • ORA-20001 when creating my first workspace.

    Hi, I'm sure this must be an easy one to answer. I am trying to create a new workspace in my new install of Application Express 3.1.2.00.02 (Oracle 11g 11.1.0.6.0). I get the error: ORA-20001: Request 1030503661329735 could not be processed. -20001 O

  • Cannot shut down, restart, or log off iMac

    I have an iMac with OS 10.5.2. I use the Virus Barrier virus protection program and have not had any problems with it. However, immediately after installing the latest Virus Barrier update, my computer began acting strangely. Most importantly, since