Function Module to update Serial Numbers in Delivery

Hello there,
I am attempting to update serial numbers in an outbound delivery using function module SERNR_ADD_TO_LS followed by a perform of serial_liste_post_ls IN PROGRAM saplipw1. However I am struggle with error messages of inconsistancies in status management of the serial numbers. I have verified that the serial numbers I'm using are valid and available. Has anyone had any experience with this FM or others to post serial numbers into an outbound delivery?
Many thanks!

That is very helpful and turns out to be true, the delivery is updated with the serial numbers however LIPS is not. I have started to write a routine to correct this.
On another note in my application I'm noticing that the when I call FM serial_liste_post_ls IN PROGRAM saplipw1 that the internal tables being passed that were built in the FM SERNR_ADD_TO_LS contain serial data from all deliveries and consequently I'm getting errors.
My program loops at the delivery then the item and for each item I call the FM SERNR_ADD_TO_LS and then I call the serial_liste_post_ls IN PROGRAM saplipw1 once all lines have been passed and the first delivery updates fine. However the subsequent delivery receives an error of " Inconsitancy in status management for serial ". I have confirmed that the serials are good and when I go into debug I see the first delivery goes fine and then I noticed on the FM call of serial_liste_post_ls IN PROGRAM saplipw1 that the internal tables contains data from that delivery and the previous one.
Below is psuedo code replicating how I call the FM's
loop at i_likp.
loop at i_lips
       where vbeln = i_likp-vbeln.
      CALL FUNCTION 'SERNR_ADD_TO_LS'
           EXPORTING
                profile               = 'Z002'
                material              = i_lips-matnr
                quantity              = i_lips-anzahl
                j_vorgang             = 'PMS3'
                document              = i_likp-vbeln
                item                  = i_lips-posnr
                debitor               = i_likp-kunnr
                vbtyp                 = i_lips-vgtyp
                bwart                 = '601'
           IMPORTING
                anzsn                 = anzsn
                zeilen_id             = l_zeile
                serial_commit         = serial_commit
           TABLES
                sernos                = sernr
           EXCEPTIONS
                konfigurations_error  = 1
                serialnumber_errors   = 2
                serialnumber_warnings = 3
                no_profile_operation  = 4
                OTHERS                = 5.
endloop.
    PERFORM serial_liste_post_ls IN PROGRAM saplipw1.
    COMMIT WORK.
endloop.
Any help is very much appreciated!!!

Similar Messages

  • Update serial numbers in delivery

    Hi Experts,
    I need to update serial numbers in delivery,
    I am using function modules SERNR_ADD_TO_LS and SERIAL_LISTE_POST_LS for it.
    Its updating the serial numbers in tables SER01 and OBJK properly.
    but I am not able to see those serial numbers from tcode VL03N,
    though when in try to update the serial numbers using tcode VL02N , i can see the serial numbers updated through above function modules.
    i debugged the code and these FMs doesn't update the field ANZSN(number of serial numbers) in table LIKP.
    could you please suggest how can i update this field in this scenario. I don't want to use update/modify commands on SAP standard table(LIKP) directly .
    Thanks
    Yogesh Gupta

    Hi,
    did you find a solution for this? I'm facing the same issue. Before I use a BDC I would like to try the FM first.
    thanks!
    Frans

  • Update serial numbers in delivery (VL02N)

    Hi all,
    I need to update the serial numbers in delivery (VL02N) transaction. Do we have any BAPI or function module for this. I tried some function modules but didn't work. Anybody has information please share.
    Thanks,
    Pranav

    Hi,
    I have used the function  module SERNR_ADD_TO_LS and PERFORM serial_liste_post_ls IN PROGRAM saplipw1. It is adding the serial number to delivery. But I need to go to VL02N and save that delivery then only it is getting saved.
    Any input can appreciated.
    Thanks,
    Pranav

  • Function module to update Credit status in Delivery

    Hi,
    Is there any function module or BAPI to update the Credit status for Delivery (Outbound) in transaction VL02N.

    Hi Priyanka,
    This BAPI  " BAPI_CREDIT_ACCOUNT_GET_STATUS " will give the required solution.it determines credit status of credit account.
    by
    Prasad GVK.

  • Function Module to update Bill of Lading & No. of packages in a Delivery

    Hi,
    Can any one suggest me a function module to update Bill of Lading & No. of packages in a Delivery ?
    Thanks in Advance.

    Hi:
    I am also trying to update components of PM. I used the function CO2M_COMPONENT_CHANGE_WITH_REF, but I am not sure if I am passing the correct parameters. If possible  can you please send a sample code Or you can take a look at my code and tell me where I am doing wrong.. Thanks.
    Here is what I am passing into the the function:
    DATA: in_resbd_new LIKE resbd,
    in_rsnum_source    LIKE     resb-rsnum,
    in_rspos_source    LIKE     resb-rspos,
    in_rsart_source    LIKE     resb-rsart,
    out_INDEX_BT       LIKE     SY-TABIX.
    When I created the component, Requirement quantity of the component
    was set to initial. I am trying to change that to 1.
    in_resbd_new-MANDT = '200'.
    in_resbd_new-RSNUM = '0000000708'.  " from RESB-RSNUM
    in_resbd_new-RSPOS = '0001'.             " from RESB-RSPOS
    in_resbd_new-MATNR = '000000000000000072'. " RESB-MATNR
    in_resbd_new-WERKS = '0010'.             " from RESB-WERKS
    in_resbd_new-LGORT = '0010'.              "" from RESB-lgort
    in_resbd_new-MENGE = '1'.
    in_rsnum_source = '0000000708'.
    in_rspos_source = '0001'.
    CALL FUNCTION 'CO2M_COMPONENT_CHANGE_WITH_REF'
      EXPORTING
        i_resbd_new          = in_resbd_new
        i_rsnum_source       = in_rsnum_source
        i_rspos_source       = in_rspos_source
        i_rsart_source       = in_rsart_source
    IMPORTING
       E_INDEX_BT           = out_INDEX_BT
    EXCEPTIONS
       ERROR_OCCURED        = 1
       OTHERS               = 2
    The return value in out_index_bt is '1'.
    Thanks for your help.

  • Problem with BAPI_OUTB_DELIVERY_CHANGE to update serial numbers

    hi All,
    I am using BAPI_OUTB_DELIVERY_CHANGE to update serial numbers. i am executing this directly in se37 giving delivery number alone in import parameters header_data, header_control and delivery.
    and giving delivery numer, item no and random serial no in tables ITEM_SERIAL_NO. when i execute  it is not throwing any errors. how ever the delivery is not updated with the serial no's.Return parameters is also nor showing any values.
    Any pointers to solve this would be appreciated.
    Regards,
    Sreekanth.

    Hi,
    You need to use BAPI_TRANSACTION_COMMIT just after BAPI_OUTB_DELIVERY_CHANGE .
    Mark WAIT = 'X' in the IMPORT parameter of BAPI_TRANSACTION_COMMIT.
    For testing if it is working or not:
    Goto SE37 --> click on FUNCTION MODULE --> TEST -->TEST SEQUENCES
    First give BAPI_OUTB_DELIVERY_CHANGE and then BAPI_TRANSACTION_COMMIT.
    Click on EXECUTE. Execute BAPI_OUTB_DELIVERY_CHANGE then 'BACK' and then BAPI_TRANSACTION_COMMIT with proper data.
    Goto the transaction from where you can check entry has been created or not.
    Regards

  • Problem with updating serial numbers in sales order!

    Hi,
    I am trying to update serial numbers for a sales order in SAP. I tried using both SERNR_ADD_TO_AU and SERNR_ADD_TO_DOCUMENT. However, in both cases the FM returned the number of serial numbers created but these did not reflect in the sales order. The code for both is as below:
    WA_SERXX-SDAUFNR = '0000001733'.
    WA_SERXX-POSNR = '000010'.
    WA_SERXX-KUNDE = '0000009000'.
    WA_SERXX-VBTYP = 'C'.
    WA_SERXX-SD_AUART = 'OR'.
    WA_SERXX-SD_POSTYP = 'TAN'.
    WA_SERNR-SERNR = '000000001234ABCDAR'.
    APPEND WA_SERNR TO IT_SERNR.
    WA_SERNR-SERNR = '000000001234ABCDAQ'.
    APPEND WA_SERNR TO IT_SERNR.
    CALL FUNCTION 'SERNR_ADD_TO_DOCUMENT'
      EXPORTING
        operation                       = 'SDAU'
        objkopf                         = 'SER02'
        serxx                           = wa_serxx
        material                        = 'P1-TEST'
       PROFILE                         = 'Z001'
        quantity                        = '2'
      M_CHARGE                        =
       J_VORGANG                       = 'PMS2'
      KMATNR                          =
      CUOBJ                           =
      R_MATERIAL                      =
      BSTCH                           =
      BSTUP                           =
      SNBWG                           =
      EMATN                           =
      KDAUF                           =
      KDPOS                           =
      AUTOMATIC                       = ' '
      NO_ENQUEUE                      = ' '
      MORE_ALLOWED                    = ' '
      BUDAT                           =
    IMPORTING
       ANZSN                           = anzsn
       NEW_OBKNR                       = new_obknr
       SERIAL_COMMIT                   = serial_commit
       STATUS_NOT_ALLOWED              = status_not_allowed
      tables
        sernr                           = IT_SERNR
        r_sernr                         = it_ser1
      XVBPA                           =
    CHANGING
      T_SMESG                         =
    EXCEPTIONS
      KONFIGURATIONS_ERROR            = 1
      GENERAL_SERIAL_ERROR            = 2
      NO_PROFILE_OPERATION            = 3
      DIFFERENCE_IN_HEADER_DATA       = 4
      OTHERS                          = 5
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    commit work and wait.
    CALL FUNCTION 'SERNR_ADD_TO_AU'
      EXPORTING
        sernr                       = '000000001234ABCDAR'
        profile                     = 'Z001'
        material                    = 'P1-TEST'
      M_CHARGE                    =
        quantity                    = '1'
      J_VORGANG                   = 'PMS2'
      KMATNR                      =
      CUOBJ                       =
        document                    = '0000001733'
        item                        = '000010'
        debitor                     = '0000009000'
        vbtyp                       = 'C'
        sd_auart                    = 'OR'
        sd_postyp                   = 'TAN'
    IMPORTING
       ANZSN                       = ANZSN
      ZEILEN_ID                   =
       SERIAL_COMMIT               = SERIAL_COMMIT
    EXCEPTIONS
      KONFIGURATIONS_ERROR        = 1
      SERIALNUMBER_ERRORS         = 2
      SERIALNUMBER_WARNINGS       = 3
      NO_PROFILE_OPERATION        = 4
      OTHERS                      = 5
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    COMMIT WORK AND WAIT.

    hi,
    In order to maintain customer specific serial numbers you can do the following steps:
    1. Maintain the serial numbers provided by your client in tcode IQ01. this will create the customer serial numbers in the system.
    2. In the material master under Sales View maintain the serial number profile as 0002. this is sap standard.
    3. Once the above has been maintained you can assign serial numbers at the time of delivery and NOT in sales order.
    I hope this helps.
    Regards,
    Vishesh

  • Creation of function module for updating the ztable

    Hi,
    I am sending the requirement for ceation of function module for updating the ztable.
    Requirement----
    Table Updation rule (New record)
    While creating a new record the calling function will export the following to the table handling function.
    Table field     Probable Values
    ZORDERNO------->     Sales Delivery no in case of sales orderShipment no in case of transfer order
    UNAME----
    >     User ID
    ZORDTYPE----
    >     SALEOR in case of sales orderTRANSF in case of transfer order
    ZREFDOCNO----
    >Sales Order no in case of sales orderPurchase Order no in case of transfer order
    ZREFDOCNO1----
    >Delivery no in case of transfer order
    The table handling function will calculate the following fields
    Table field     Probable Values
    ZREQNO----
    >Running serial number (incremented by 1 for each new record)
    ZREQDAT     -
    >System date
    ZREQTIME----
    >     System time
    ZSTATUS----
    >OPEN (for all new records)
    Before inserting a new record the table handling function will always check if a previous record exists for the same order / shipment no. if record exists the function will not insert a new record.
    Table Updation rule (Status Update)
    While updating a record the calling function will export the following to the table handling function.
    Table field     Probable Values
    ZORDERNO----
    >Sales order no in case of sales orderShipment no in case of transfer order
    ZSTATUS----
    >CANCEL if cancellation successfulERROR if cancellation not possible (order already processed)
    The table handling function will calculate the following fields
    Table field     Probable Values
    ZSTATDAT----
    >System date
    ZSTATTIME----
    >     System time

    Do you have to create/update new record in Ztable through Function Module ?
    or you need to write FM only for validation?
    Any how, you need to create a Program with Input values for the fields of Ztable, and for rest of fields the Value can be calculated based on input as per your requirement.
    Let me know clearly what exactly u need ?
    Regards,
    Kiran

  • Update Serial Numbers to Production Order

    Hi,
    Has anyone used any Function module for updating the Serial Numbers to the Production Order Header. I am using the FM - SERNR_ADD_TO_PP . The Serial Numbers needs to be assigned when doing Goods Issue in MIGO. At this point The FM is updating the Serial Numbers to Order but it is putting it in Status PMP1.
    Once the Status is PMP1 it prevents anymore Serial Number update to the same production order using the same Function module. This is preventing us from doing partial Goods Issue in MIGO.
    Is there any more Function Module that can be used to updating the Serial Nos in the Production Order.
    Regards,
    Arunava

    HI rasheed,
    Check this resolution on table control for BDC.
    https://wiki.sdn.sap.com/wiki/x/DQGqAw
    Note: Do not post the same question twice.
    Regards,
    Bhumika

  • Function module to update net price in purchase information record ???

    hi all,
    Is there any function module to update net price (PREIS) for each material in the purchase info record?
    points will be rewarded for helpful answers

    Hi,
        Use below FM :
    Clear : i_prot.
    refresh : i_prot.
    Delivery Update
    CALL FUNCTION 'LE_MOB_DELIVERY_UPDATE'
    EXPORTING
    do_commit = 'X'
    TABLES
    t_delivery_items = i_lips
    prot = i_prot
    EXCEPTIONS
    conversion_overflow = 1
    essential_data_missing = 2
    error = 3
    nothing_to_update = 4
    lock_after_update_failed = 5
    error_in_delivery_update = 6
    OTHERS = 7.
    COMMIT WORK.
    Pass lips-lgort..
    Refer
    https://forums.sdn.sap.com/click.jspa?searchID=4212688&messageID=3855382
    Regards

  • Update Serial Numbers and Qty with bapi_outb_delivery_change

    HI All
    I want to update serial numbers and quantity(delivery qty) for a delivery, this is mostly in case of short ship and over ship, I am using the BAPI for this updation, but I am getting errors to it.
    I am passing the following data in the BAPI:
    HEADER_DATA -
    > Delivery Number
    DELIVERY -
    > Delivery Number
    ITEM_DATA -
    > DELIV_NUMB(Delivery Number), DELIV_ITEM(Item), MATERIAL(material), DLV_QTY(Qty what i need to update in VL02n), FACT_UNIT_NOM(as 1), FACT_UNIT_DENOM (as 1), SALES_UNIT(VRKME), BASE_UOM(MEINS)
    ITEM_CONTROL -
    > DELIV_NUMB(delivery Number), DELIV_ITEM(Item), CHG_DELQTY(as 'X') .
    But I get this error message.
    "serial numbers are already maintained. Quantity cannot be changed"
    Please suggest how can I change both?
    Regards
    Swar

    Hi Swar
    I can maybe give you insight on why you are receiving the error message in hopes in can help you go to the right direction.  In the sales order for technical objects if you are maintaining lets say a qty of 2 each serial numbers.  When you create the delivery the system passes both serial numbers to the delivery. In cases of short ship (wanting to only ship one each) go to the serial number in the file menu under extras in the delviery and  before changing qty to one each; delete the serial number you are not shipping then change your qty this works.
    Edited by: Kim Blair on Sep 29, 2011 5:19 PM

  • SAP provided function module to update picking confirmation in VL02N

    Hi
    In transaction VL02N , the quantity,net weight and batch inf is updated manually.So the question is there any SAP provided function module to update picking confirmation instead of using BDC/call transaction method?

    Hi,
        Use below FM :
    Clear : i_prot.
    refresh : i_prot.
    Delivery Update
    CALL FUNCTION 'LE_MOB_DELIVERY_UPDATE'
    EXPORTING
    do_commit = 'X'
    TABLES
    t_delivery_items = i_lips
    prot = i_prot
    EXCEPTIONS
    conversion_overflow = 1
    essential_data_missing = 2
    error = 3
    nothing_to_update = 4
    lock_after_update_failed = 5
    error_in_delivery_update = 6
    OTHERS = 7.
    COMMIT WORK.
    Pass lips-lgort..
    Refer
    https://forums.sdn.sap.com/click.jspa?searchID=4212688&messageID=3855382
    Regards

  • CRM function module to update the attribute in the classification TAB of BP

    Hi All,
    Can any body let me know if there is any functionmodule to update the CRM function module to update the attribute in the classification TAB of BP tcode.
    I have searched a lot i get FM to update the marketing attribute and not the attributes in the classification tab.
    Thanks in Advance
    Edited by: Sharath Kumar on Dec 2, 2010 4:48 PM

    For material bom: CSAP_MAT_BOM_CREATE
    and CSAP_ORD_BOM_CREATE for Order BOM.
    Regards,
    Ravi

  • HR-ABAP Any BAPI or Function module to update infotypes 167 & 170

    Hi,
        Can anyone let me know is there any BAPI or Function module to update infotypes 167(Health Plans) & 170(Flexible Spending Accounts).
    Thanks,
    Sandeep

    Hi,
       U can use HR_BEN_CREATE_PLANS internally it calls HR infotype operation as specified by suresh.
    Suresh  : If there are approximately 3000 records to be updated on regular basis do u think is it better to use BAPI's or BDC
    regards
    Vick

  • Calling Function Module in Update Task

    Hello Experts,
                              Can anyone let me know about
    Calling Function Module in Update Task.
    Why do we use this " In Update Task "  ??
    How do we Use ??
    What is the Use... ??
    Kindly let me know....
    Thanks and Regards
    Pramod

    hi,
    Why do we use this " In Update Task " ??
    The main update technique for bundling database changes in a single database LUW is to use CALL FUNCTION... IN UPDATE TASK.
    How do we Use ??
    A typical R/3 installation contains dialog work processes and at least one update work process. The update work processes are responsible for updating the database. When an ABAP program reaches a COMMIT WORK statement, any function modules from CALL FUNCTION... IN UPDATE TASK statements are released for processing in an update work process. The dialog process does not wait for the update to finish. This kind of update is called asynchronous update.
    What is the Use... ??
    Asynchronous update is useful when response time from the transaction is critical, and the database updates themselves are so complex that they justify the extra system load
    Real time scenario.
    Suppose a user wants to change an entry in a database table, or add a new one. He or she enters the necessary data, and then starts the update process by choosing Save. This starts the following procedure in the ABAP program:
    Firstly, the program locks the database entry against other users, using the enqueue work process (or the message server in the case of a distributed system). This generates an entry in the lock table. The user is informed whether the update was successful, or whether the lock could not be set because of other users.
    If the lock is set, the program reads the entry that is to be changed and modifies it. If the user has created a new entry, the program checks whether a record with the same key values already exists.
    In the current dialog work process, the program calls a function module using CALL FUNCTION... IN UPDATE TASK, and this writes the change details as an entry in table VBLOG.
    When the program is finished (maybe after further dialog steps), a COMMIT WORK statement starts the final part of the SAP LUW. The work process that is processing the current dialog step starts an update work process.
    Based on the information passed to it from the dialog work process, the update work process reads the log entries belonging to the SAP LUW from table VBLOG.
    The update work process passes this data to the database for updating, and analyzes the return message from the database. If the update was successful, the update work process triggers a database commit after the last database change and deletes the log entries from table VBLOG.
    If an error occurred, the update work process triggers a database rollback, leaves the log entries in table VBLOG, flags them as containing errors, and sends a SAPoffice message to the user, who should then inform the system administrator.
    The corresponding entries in the lock table are reset by the update work process.
    Hope this is helpful, Do reward.

Maybe you are looking for

  • 9402 DAQmx C: Write Clock and Data on two diferrent lines.

    I am working with NI 9402 (4 I/O lines) and coding with DAQmx c (I AM NOT USING LABVIEW). I am trying to output the the data signal by port0/line1. Period required of each bit: 1us.(1 MHz) At the same time I am trying to output the clock signal by po

  • My bookmarks are gone and i cant save new ones. how do i get them back

    all my bookmarks and history for this month are gone. everything else works. just need my bookmarks back

  • Substitution Variable in Partition

    Can a substitution variable be used in a partition? I need to add the current month (from our Time Periods dimension) to a partition. Right now, I am adding it manually. I'd like to automate the process. Does anyone use a partition that changes dynam

  • *** How to resume movie rental download?

    I started to download a movie and then had to quit iTunes and restart my Mac. When I opened iTunes it wasn't there so I searched for it and the message said "you've already rented this, do you want to rent it again?". I was only about 75mb into a 1.0

  • Framework for parallel processing

    Hello, Can anyone help me by giving some links or examples as to how to use the framework for parallel processing ?? (FPP) My scenario is that I have a report that handles huge volumes of data and process it. But at present my report is not able to h