User exit for return from delivery - 651 movemment type in WM

Hi Guru,
We are going to implement a customize program to control the putaway storage location when the HU returning from delivery in WM environment.
The process is as below:
1. Create the return order with reference to the original billing document;
2. Create the return delivery (original storage location is 0001).
3. Manually attached the HU we want to return to the delivery ;
<<<< 4.LT03 to create the TO for this delivery. >>>>>
         - then it will automatically PGR (material document with 651 movement type) 
         - A TO will automatically created and from 904 to another destination storage type 101 (setup in the 651 movement type).
The requirement is: we need to change the storage location when the TO (904 to 101) is confirmed according to some logic.
We found that we can not use the user exit "EXIT_SAPLL03T_001 - User Exit at End of TO Creation (in Update Task)" or   'EXIT_SAPLL03T_002 - User Exit at End of TO Confirmation (in Update Task)". We set the break point, but it didn't stop there.
Any one can help us where we can put our code in?
Thank you very much,

Hello!
The user exit MWMTO001 (FM EXIT_SAPLL03T_001) runs usually in Update
Task. That means that you have to switch on the update debugging in
order to let the debugger stop in this exit. In most cases update
debugging isn´t switch on when the debugger doesn´t stop in the exit.

Similar Messages

  • Need User Exits for Creation of Delivery and for Posting Goods Issue

    Hi,
    I need User Exits for
    Creation of Delivery
    Posting Goods Issue
    I need to make some checks regarding customer license expiration and if checks fail, I need to stop Creation of Delivery and Posting Goods Issue.
    Thanks in advance,
    Will reward,
    Mindaugas

    In the delivery you can use userexit USEREXIT_SAVE_DOCUMENT_PREPARE to make your checks and send an error message to the user in case they fail.
    You can find this user exit (form routine) in include MV50AFZ1.
    Hope that helps,
    Michael

  • User exit for PGI via delivery (Vl02N)

    Hi Folks
    Can you suggest me appropriate user exit which can be used during PGI for delivery in Vl02N. This should get triggered when POST PGI tab is hit in VL02N.
    Via USer exit I want to change the GL account in the accounting document for PGI ( GL account for Tr price difference which is posted via key AUM (Expense/revenue from stock transfer).
    Please reply ASAP.
    Thanks
    Vipin

    Hi Vipin
    I did a small check in our internal system.
    In VL02n choosing the PGI TAB it hits user exit MV50AFZ1 -> FORM USEREXIT_SAVE_DOCUMENT_PREPARE
    This is the call:
    Main Program     SAPMV50A
    Source code of   FV50XF0B_BELEG_SICHERN
    form BELEG_SICHERN_DET_CHECK
    * Userexit
        PERFORM userexit_save_document_prepare(sapmv50a).
    So you are good to go with MV50AFZ1 just use
    form USEREXIT_SAVE_DOCUMENT_PREPARE
    Kind regards
    Brian

  • User exit for XD01 with delivery priority

    Hi ,
    I am using a user exit EXIT_SAPMF02D_001 for customer master.Below is the piece of code .I am just displaying message based on delivery priority field in the customer master .
    But the probleam is when user only change the value in delivery priority field then only my message should come .But now my logic executes when ever no changes in the delivery priority field also and any touch other than this field also getting the message.
    Means the value in the delivery priority field  not refreshed in the customer master screen .Thats why the message is coming any time when not touching the field also.
    so can somebody suggest what to do?My logic should work only when delivery priority field only changed.
    TABLES:tpakd.
    DATA:l_lprio TYPE lprio,
         l_kztlf TYPE kztlf,
         l_antlf TYPE antlf.
    DATA:l_lp(2) TYPE c VALUE '03',
         l_kz(1) TYPE c VALUE 'B',
         l_an(1) TYPE c VALUE '1'.
    SELECT SINGLE * FROM tpakd
                    INTO tpakd
                    WHERE parvw = 'WE'
                      AND ktokd = i_kna1-ktokd.
    IF sy-subrc = 0 .
      MOVE i_knvv-lprio TO l_lprio.
      MOVE i_knvv-kztlf TO l_kztlf.
      MOVE i_knvv-antlf TO l_antlf.
      IF l_lprio = l_lp AND ( l_kztlf NE l_kz OR l_antlf NE l_an )  .
        MESSAGE w534(zm).
        ELSEIF l_lprio IS NOT INITIAL
                AND ( l_kztlf IS NOT INITIAL
                OR  l_antlf IS NOT  INITIAL
                OR  l_antlf NE '0'
                OR  l_antlf NE '9' ).
        MESSAGE w534(zm) .
      ENDIF.
    ELSE.
      EXIT.
    ENDIF.

    HI
    I think something doesn't sound good in this control
    ELSEIF l_lprio IS NOT INITIAL
      AND ( l_kztlf IS NOT INITIAL
           OR l_antlf IS NOT INITIAL                  "<-------
           OR l_antlf NE '0'
           OR l_antlf NE '9' ).
        MESSAGE w534(zm) .
    ENDIF.
    The control for L_ANTIF seems to be always valid, probably you should use AND insted of OR
    ELSEIF l_lprio IS NOT INITIAL
      AND ( l_kztlf IS NOT INITIAL
           OR ( l_antlf IS NOT INITIAL                  "<-------
           AND l_antlf NE '0'
           AND l_antlf NE '9' ) ).
        MESSAGE w534(zm) .
    ENDIF.
    Max
    Max

  • User exit for copying planned delivery time

    Hi
    My requirement is to copy the value in field Planned delivery time from contract to planned delivery time field in MRP2 view in material master. Please let me know which user exit or enhancement may be used for the purpose.
    TIA.

    Hi
    Check BADI_MATERIAL_CHECK
    Regards
    Sanil

  • User exit for incoterms from ship-to-party

    Hi Gurus,
    my client needs to catch incoterms from ship-to-party,
    please let me know which user exit is used to get incoterms from ship-to-party.
    regards,
    Naren

    In our system we get the inco terms from the ship to party. We use user exit move_fields_to_vbkd in program mv45afzz. The code looks like this:
    Inco terms
    Added to get the values of Inco Terms from
    Ship-To-Party instead of Sold-To-Party.
    data: oldship like kuwev-kunnr value space.
    if sy-ucomm   <> 'UEBR' and  "Ordre er ikke oprettet med reference
       t180-trtyp <> 'A'.        "Der er ikke Vis mode
      import oldship from memory id 'ZSS'.
      if *vbkd-inco1 is initial. "Første gang vi er i User-Exitet
        if kuwev-kunnr <> kuagv-kunnr. "Varemodtager forskellig fra ordregiver
          select single inco1
                        inco2
         into (vbkd-inco1,
               vbkd-inco2)
         from knvv
        where kunnr = kuwev-kunnr
          and vkorg = vbak-vkorg
          and spart = vbak-spart
          and vtweg = vbak-vtweg.
        endif.
      elseif oldship <> kuwev-kunnr and
       ( *vbkd-inco1 <> vbkd-inco1 or
         *vbkd-inco2 <> vbkd-inco2 ).
        select single inco1
                      inco2
          into (vbkd-inco1,
                vbkd-inco2)
          from knvv
         where kunnr = kuwev-kunnr
           and vkorg = vbak-vkorg
           and spart = vbak-spart
           and vtweg = vbak-vtweg.
      endif.
    endif.
    Det skal ligge udenfor if-sætningen for at undgå at det overskrives
    ved oprettelse med reference
    move kuwev-kunnr to oldship.
    export oldship to memory id 'ZSS'.
    /Torben

  • User exit for save_document in delivery

    hello!
    What is the include for the user exit of save document in a delivery?
    Thx

    hi
    try method
    SAVE_DOCUMENT_PREPARE
    or
    include mv50afzz.
    include mv50afz1.
    include mv50afz2.
    include mv50afz3.          "Userexit neu zu Release 3.0A
    include mv50afzk.          "Userexit 4.6A (KOMKG/KOMPG)include mv50afzl.          "Userexit 4.6A Liefergruppen
                                                                   "n_693000
    include mv50afzp.          "Userexit for pricing screen input
    regards
    ravish
    <b>plz dont forget to reward points if helpful</b>
    Message was edited by:
            ravish goyal

  • User exit for PGI in delivery

    Hello every one,
    This is regarding vl03n transaction. The requirement is to have some checks before PGI is done. If that checks are not satisfied PGI should not be happened and the delivery document should not be saved. The user exit we have used is SAVE_DOCUMENT_PREPARE. But the problem if we save the document without doing PGI then also the checks are carrying out and if those are not satisfied delivery is not saving. The requirement is to bypass the PGI when we save the document in case when we doesn't do PGI.

    hi prabhu,
    Thanks for your reply. Seems it may work, but i have another idea and that is we can use IF fcode = 'WABU' then only PGI checks will be carried out.If we save directly instead of doing PGI the fcode is different and checks will not be carried out. Hope it will work. If you have any further ideas please post it.
    thank you.

  • User exit for copying Inbound delivery data to Batch

    Hi, my client wanted copy the field 'country of origin' of Inbound delivery to batch when we create a new batch in inbound delivery.
    Can anyone tell me which User Exit I can use? Thanks.

    Removed, for new thread
    Edited by: Carol D'Sa on Dec 7, 2009 12:56 PM

  • User exit for transfer from SD to CO-PA ?

    Hi,
    We need to implement a new flow for 'early start' SD orders. These are uncommited towards the customer, but certain enough to start procurement activities. The point is to use a flag on SD order header to control 'early start' that prevents updates of planned values to CO-PA. Once order is firmed, the early start flag is removed, and normal CO-PA transfer should be used.
    Reason for rejection seems like a candidate, but it disallows even procurement and delivery creation, so that will not work.
    I was thinking about a user exit, but can not get any of the COPA000* to update relevant data.
    COPA0001 via KEDR can only affect characteristics, not values.
    COPA0003 is called when saving the order, but T_COPADATA is empty.
    Most of the remaining COPA000* does not seem to be called when creating orders by transaction VA01

    Hi Ole,
              I have a simmilar problem as you discussed .Whenever we change in sales order at line item level in AAG(Account Assignment Group) line item level,it has to go to for Profitability Analysis CO-PA.But this change is not reflected in KE24(Actual line item report) immediatly.It reflects when we do changes for second time the first change is getting reflected.
        One possible reason which I am predicting is posting to CO-PA is happening before sales order getting updated so it is taking earlier value.Please help me out.
    Thanks in Advance,
    Albert

  • User exits for crosschecking from EBAN,ESLL, ESUH @ runtime

    Hi all @ SDN forums,
    question: i have to find an user exit to introduce a new check that has to be executed during the creation of a purchase request (me51n).
    The task must evaluate the data inserted so far in the request doing a check that involves both data from EBAN (position items), from ESLL (service items) and ESUH (limit items). I tried to find out the usr-exit used in the transaction, did also a bit of debugging to find out how it works, but... Seems that the checks already developed in the EXIT_SAPLMEREQ_00* FM family work only on a single kind of row (e.g.: there's a FM to check position items, another FM to check service items) but don't allow to do crosschecking (e.g. "if the field 'foo' in a position item has value 'bar', then check that its service items have the field "X" with value 'Y').
    Can anybody help?
    Thanks in advance
    EDIT: additional info from debug:
    I noticed that the first user exit chunk to be executed when i click on the "check purchase req" is the FM EXIT_SAPLMLSP_030... unfortunately, it holds only values concerning service items but nothing about the position (hier) item. Obviously, a prelimary check on the hier item is necessary to proceed...
    Edited by: Matteo Montalto on Jan 13, 2009 3:04 PM

    JavaWorld has an article on some of the pitfalls that can happen when using Runtime.exec() that might interest you:
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

  • User Exit for Tagging a Delivery manually  to a manual shipment

    Hi All,
    We have a process in which we are creating a shipment manually and then we are trying to tag a delivery manually to that shipment. The requirement is that it should give an error for a particular type of delivery.
    Please let me know if there are any exits for that.
    Thanks,
    Sharadendu

    Dear,
    In main program SAPMV50A of transaction VL01N you would find an include MV50AFZ1. This include is supplied by SAP for customers to do specific checks etc.
    FORM USEREXIT_MOVE_FIELD_TO_LIKP.
    Move the required values to KNA1
    Hope this helps.
    Regards,
    R.Brahmankar

  • User-Exit for Checking Customer and Sale order type in Sales Order Creation

    Hi Experts,
      While creating the Sales Order once i enter sold-to-party and enter line item, i have to check the customer against the sales order type.
    Please suggest me if any user-exit or enhancement or BADI available for it.
    Thanks & Regards,
    -VM

    Hi
    Follow the below steps to find out what all BADI's are called when you press any button in any transaction.
    1) Goto se24 (Display class cl_exithandler)
    2) Double click on the method GET_INSTANCE.
    3) Put a break point at Line no.25 (CASE sy-subrc).
    Now
    4) Execute SAP standard transaction
    5) Press the required button for which you need to write an exit logic, the execution will stop at the break point.
    6) Check the values of variable 'exit_name', it will give you the BADI name called at that time.
    7) This way you will find all the BADIs called on click of any button in any transaction.
    mark if helpful
    Regs,
    Tushar Mundlik

  • BADI/User Exit for custom table update from Delivery

    Hi
    Our requirement is to update a custom table with the delivery number and other related details when the picking status is changed to "C". Kindly suggest BADI/User exit for this requirement .
    Thanks in Advance for your immediate help .

    Hi Joseph,
    See SAP Note 415716 - User exits in delivery processing. It says when you have the document number available, what is permitted, what not, ....
    I hope this helps you
    Regards
    Eduardo

  • User Exits for Invoice creation ,cancellation and sales return

    Hi Gurus,
    Pl help me it's very urgent.
    I did not find any user exit invoice creation so i wrote the following code in include program
    MV60AF0B_BELEG_SICHERN.
    This code is to update the Z*table while saving invoice ,cancellation and sales return.
    The code modification is like below
          FORM BELEG_SICHERN                                            *
          Buchen Fakturabelege                                          *
    FORM BELEG_SICHERN.
      READ TABLE XVBRK INDEX 1.
      IF SY-SUBRC NE 0.
        CALL FUNCTION 'DEQUEUE_ALL'.
        MESSAGE S032.
        EXIT.
      ENDIF.
      IF SAMH_MOD = ON.
        EXPORT XKOMFK TO MEMORY ID 'SDBILLDL'.
      ENDIF.
      DATA: CALC_TYPE.
      IF REBATE_DETERMINED = 'Y'.
        CALC_TYPE = 'A'.
      ELSE.
        CALC_TYPE = 'I'.
      ENDIF.
    *{   INSERT         RD1K903017                                        1
    Work Area*********************
    data : wa_xvbrk type VBRKVB.
    data : wa_xvbrp type vbrpvb.
    data : wa_zmigo type zmigo.
    data : wa_vbrp type vbrp.
    Internal table Creation*******
    DATA:  BEGIN OF tab_XVBRP OCCURS 100.
             INCLUDE STRUCTURE VBRPVB.
    DATA:  END OF tab_XVBRP.
    data : begin of tab_vbeln occurs 10,
           vbeln type vbrk-vbeln,
           knumv type vbrk-knumv,
           end of tab_vbeln.
    data : tab_zmigo type table of zmigo.
    data : tab_vbrp type table of vbrp.
    *****Data declaration*************
    data : v_no_of_inv type i.
    data : v_vbeln_no(10) type n.
    data : v_last_inv_no(10) type n.
    data : v_first_inv_no(10) type c.
    data : v_tot_qty type i.
    data : v_frbnr type mkpf-frbnr.
    *******Ranges*********************
    ranges : r_vbeln for vbrk-vbeln.
    *****Populating IT****************
    tab_xvbrp[] = xvbrp[].
    describe table xvbrk lines v_no_of_inv.
    *}   INSERT
      CALL FUNCTION 'RV_INVOICE_DOCUMENT_ADD'
           EXPORTING
                VBSK_I           = VBSK
                WITH_POSTING     = 'A'
                PREISFINDUNGSART = CALC_TYPE
           IMPORTING
                VBSK_E           = VBSK
           TABLES
                XKOMFK           = XKOMFK
                XTHEAD           = XTHEAD
                XVBFS            = XVBFS
                XVBSS            = XVBSS
                XVBRK            = XVBRK
                XVBRP            = XVBRP
                XVBPA            = XVBPA
                XKOMV            = XKOMV.
    *{   INSERT         RD1K903017                                        2
    data : v_count type i,v_fkimg type i .
    data : v_no_of_records(10) type n.
    wa_xvbrk = xvbrk.
    ********Selecting the last rec no from ZMIGO
          select max( sr_no ) from zmigo into v_no_of_records.
    *****If Distribution channel is not ZB*********
    if  wa_xvbrk-vtweg ne 'ZB' and ( wa_xvbrk-fkart = 'ZRIN' or wa_xvbrk-fkart = 'ZRTE' ).
    if v_no_of_inv = 1.              " Process only when there is one invoice
    loop at tab_xvbrp into wa_xvbrp  where (           matnr ne 'CDGSTP0001'       and
                                                       matnr ne 'CD-RW'            and
                                                       matnr ne 'CD-RW65OHS'       and
                                                       matnr ne 'CABLE'            and
                                                       matnr ne 'CD-R'             and
                                                       matnr ne 'CDQ80N4'          and
                                                       matnr ne 'GENERAL'          and
                                                       matnr ne 'NERO'             and
                                                       matnr ne 'OTHERS'           and
                                                       matnr ne 'SPARE PARTS'      and
                                                       matnr ne 'PROMO ITEM'       and
                                                       matnr ne 'PROMO-1'          and
                                                       matnr ne 'PROMO-2'          and
                                                       matnr ne 'PROMO-3'          and
                                                       matnr ne 'PROMO-4'          and
                                                       matnr ne 'PROMO-5'          and
                                                       matnr ne 'PROMO-6'          and
                                                       matnr ne 'PROMO-7'          and
                                                       matnr ne 'PROMO-8'          and
                                                       matnr ne 'PROMO-9'          and
                                                       matnr ne 'PROMO-10' ).
    v_fkimg = wa_xvbrp-fkimg .
    v_fkimg = v_fkimg / 1000.
                do v_fkimg times.
                  v_no_of_records = v_no_of_records + 1.
                  wa_zmigo-sr_no = v_no_of_records.
                  wa_zmigo-po_no = wa_xvbrk-vbeln.
                  wa_zmigo-item_no  = wa_xvbrp-posnr.
                 wa_zmigo-mblnr  = wa_xmkpf-mblnr.
                  wa_zmigo-doc_type = wa_xvbrk-fkart.
                  wa_zmigo-posting_date = wa_xvbrk-fkdat.
                  wa_zmigo-created_on = sy-datum.
                  wa_zmigo-created_time = sy-uzeit.
                 wa_zmigo-bill_lno = v_frbnr.
                  wa_zmigo-material = wa_xvbrp-matnr.
                 wa_zmigo-inv_no = wa_xvbrk-vbeln.
                 wa_zmigo-inv_item_no = wa_xvbrp-posnr.
                  wa_zmigo-plant = wa_xvbrp-werks.
                  wa_zmigo-inv_date = wa_xvbrk-fkdat.
                  wa_zmigo-customer = wa_xvbrk-kunag.
                  wa_zmigo-unit = 1.
                  wa_zmigo-mtype = '601'.
                  insert into zmigo values wa_zmigo.
                enddo.
                clear : wa_zmigo.
    endloop.
    clear : v_count,v_fkimg,wa_zmigo.
    refresh tab_zmigo[].
    clear v_no_of_inv.
    else.                              "When there are Split Invoices
    v_last_inv_no = wa_xvbrk-vbeln.
    v_vbeln_no = v_last_inv_no - v_no_of_inv + 1.
    v_first_inv_no = v_vbeln_no.
    sort tab_xvbrp by vbeln.
    loop at tab_xvbrp into wa_xvbrp  where (           matnr ne 'CDGSTP0001'       and
                                                       matnr ne 'CD-RW'            and
                                                       matnr ne 'CD-RW65OHS'       and
                                                       matnr ne 'CABLE'            and
                                                       matnr ne 'CD-R'             and
                                                       matnr ne 'CDQ80N4'          and
                                                       matnr ne 'GENERAL'          and
                                                       matnr ne 'NERO'             and
                                                       matnr ne 'OTHERS'           and
                                                       matnr ne 'SPARE PARTS'      and
                                                       matnr ne 'PROMO ITEM'       and
                                                       matnr ne 'PROMO-1'          and
                                                       matnr ne 'PROMO-2'          and
                                                       matnr ne 'PROMO-3'          and
                                                       matnr ne 'PROMO-4'          and
                                                       matnr ne 'PROMO-5'          and
                                                       matnr ne 'PROMO-6'          and
                                                       matnr ne 'PROMO-7'          and
                                                       matnr ne 'PROMO-8'          and
                                                       matnr ne 'PROMO-9'          and
                                                       matnr ne 'PROMO-10' ).
    v_fkimg = wa_xvbrp-fkimg .
    v_fkimg = v_fkimg / 1000.
                do v_fkimg times.
                  v_no_of_records = v_no_of_records + 1.
                  wa_zmigo-sr_no = v_no_of_records.
                  wa_zmigo-po_no = v_vbeln_no.                      "wa_vbrp-vbeln.
                  wa_zmigo-item_no  = wa_xvbrp-posnr.
                 wa_zmigo-mblnr  = wa_xmkpf-mblnr.
                  wa_zmigo-doc_type = wa_xvbrk-fkart.
                  wa_zmigo-posting_date = wa_xvbrk-fkdat.
                  wa_zmigo-created_on = sy-datum.
                  wa_zmigo-created_time = sy-uzeit.
                 wa_zmigo-bill_lno = v_frbnr.
                  wa_zmigo-material = wa_xvbrp-matnr.
                 wa_zmigo-inv_no = v_vbeln_no.
                 wa_zmigo-inv_item_no = wa_xvbrp-posnr.
                  wa_zmigo-plant = wa_xvbrp-werks.
                  wa_zmigo-inv_date = wa_xvbrk-fkdat.
                  wa_zmigo-customer = wa_xvbrk-kunag.
                  wa_zmigo-unit = 1.
                  wa_zmigo-mtype = '601'.
                  insert into zmigo values wa_zmigo.
                enddo.
                clear : wa_zmigo.
    at end of vbeln.
    v_vbeln_no = v_vbeln_no + 1.
    endat.
    clear : v_count,v_fkimg,wa_zmigo.
    refresh tab_zmigo[].
    endloop.
    endif.                             "End of first 2nd IF.
    clear : v_no_of_inv, v_vbeln_no.
    endif.
    ****************Sales return************************************
    if  wa_xvbrk-fkart = 'ZRRE' and wa_xvbrk-vtweg ne 'ZB'.
    loop at tab_xvbrp into wa_xvbrp where (            matnr ne 'CDGSTP0001'       and
                                                       matnr ne 'CD-RW'            and
                                                       matnr ne 'CD-RW65OHS'       and
                                                       matnr ne 'CABLE'            and
                                                       matnr ne 'CD-R'             and
                                                       matnr ne 'CDQ80N4'          and
                                                       matnr ne 'GENERAL'          and
                                                       matnr ne 'NERO'             and
                                                       matnr ne 'OTHERS'           and
                                                       matnr ne 'SPARE PARTS'      and
                                                       matnr ne 'PROMO ITEM'       and
                                                       matnr ne 'PROMO-1'          and
                                                       matnr ne 'PROMO-2'          and
                                                       matnr ne 'PROMO-3'          and
                                                       matnr ne 'PROMO-4'          and
                                                       matnr ne 'PROMO-5'          and
                                                       matnr ne 'PROMO-6'          and
                                                       matnr ne 'PROMO-7'          and
                                                       matnr ne 'PROMO-8'          and
                                                       matnr ne 'PROMO-9'          and
                                                       matnr ne 'PROMO-10' ).
             v_fkimg = wa_xvbrp-fkimg.
             v_fkimg = v_fkimg / 1000.
             v_tot_qty = v_tot_qty + v_fkimg.
              do v_fkimg times.
                v_no_of_records = v_no_of_records + 1.
                wa_zmigo-sr_no = v_no_of_records.
                wa_zmigo-po_no = wa_xvbrk-vbeln.
                wa_zmigo-item_no  = wa_xvbrp-posnr.
                wa_zmigo-doc_type = wa_xvbrk-fkart.
                wa_zmigo-posting_date = wa_xvbrk-fkdat.
                wa_zmigo-created_on = sy-datum.
                wa_zmigo-created_time = sy-uzeit.
                wa_zmigo-material = wa_xvbrp-matnr.
               wa_zmigo-inv_no = wa_xvbrk-vbeln.
               wa_zmigo-inv_item_no = wa_xvbrp-posnr.
                wa_zmigo-plant = wa_xvbrp-werks.
                wa_zmigo-inv_date = wa_xvbrk-fkdat.
                wa_zmigo-customer = wa_xvbrk-kunag.
                wa_zmigo-unit = 1.
                wa_zmigo-mtype = '651'.
                condense wa_xvbrk-xblnr.
                wa_zmigo-reference = wa_xvbrk-xblnr.
    ********Bill of lading no**
               select single bill_lno from zmigo_final into v_frbnr where inv_no = wa_xvbrk-xblnr and material = wa_xvbrp-matnr.
               if sy-subrc eq 0.
               wa_zmigo-bill_lno = v_frbnr.
               endif.
                insert into zmigo values wa_zmigo.
              enddo.
              clear : wa_zmigo,wa_xvbrp , v_fkimg, v_frbnr.
    endloop.
    endif.
    *******Invoice Cancellation*****************************
    if  wa_xvbrk-fkart = 'ZRS1' and wa_xvbrk-vtweg ne 'ZB'.
    delete tab_xvbrp[] where shkzg eq 'X'.
    loop at tab_xvbrp into wa_xvbrp where (            matnr ne 'CDGSTP0001'       and
                                                       matnr ne 'CD-RW'            and
                                                       matnr ne 'CD-RW65OHS'       and
                                                       matnr ne 'CABLE'            and
                                                       matnr ne 'CD-R'             and
                                                       matnr ne 'CDQ80N4'          and
                                                       matnr ne 'GENERAL'          and
                                                       matnr ne 'NERO'             and
                                                       matnr ne 'OTHERS'           and
                                                       matnr ne 'SPARE PARTS'      and
                                                       matnr ne 'PROMO ITEM'       and
                                                       matnr ne 'PROMO-1'          and
                                                       matnr ne 'PROMO-2'          and
                                                       matnr ne 'PROMO-3'          and
                                                       matnr ne 'PROMO-4'          and
                                                       matnr ne 'PROMO-5'          and
                                                       matnr ne 'PROMO-6'          and
                                                       matnr ne 'PROMO-7'          and
                                                       matnr ne 'PROMO-8'          and
                                                       matnr ne 'PROMO-9'          and
                                                       matnr ne 'PROMO-10' ).
             v_fkimg = wa_xvbrp-fkimg.
             v_fkimg = v_fkimg / 1000.
             v_tot_qty = v_tot_qty + v_fkimg.
              do v_fkimg times.
                v_no_of_records = v_no_of_records + 1.
                wa_zmigo-sr_no = v_no_of_records.
                wa_zmigo-po_no = wa_xvbrk-vbeln.
                wa_zmigo-item_no  = wa_xvbrp-posnr.
                wa_zmigo-doc_type = wa_xvbrk-fkart.
                wa_zmigo-posting_date = wa_xvbrk-fkdat.
                wa_zmigo-created_on = sy-datum.
                wa_zmigo-created_time = sy-uzeit.
                wa_zmigo-material = wa_xvbrp-matnr.
               wa_zmigo-inv_no = wa_xvbrk-vbeln.
               wa_zmigo-inv_item_no = wa_xvbrp-posnr.
                wa_zmigo-plant = wa_xvbrp-werks.
                wa_zmigo-inv_date = wa_xvbrk-fkdat.
                wa_zmigo-customer = wa_xvbrk-kunag.
                wa_zmigo-unit = 1.
                condense wa_xvbrk-zuonr.
                wa_zmigo-reference = wa_xvbrk-zuonr.
                wa_zmigo-mtype = '602'.
    ********Bill of lading no**
               select single bill_lno from zmigo_final into v_frbnr where inv_no = wa_xvbrk-xblnr and material = wa_xvbrp-matnr.
               if sy-subrc eq 0.
               wa_zmigo-bill_lno = v_frbnr.
               endif.
                insert into zmigo values wa_zmigo.
              enddo.
              clear : wa_zmigo,wa_xvbrp , v_fkimg.
    endloop.
    endif.
    clear : v_no_of_records.
    *}   INSERT
      CALL FUNCTION 'STACK_RESET'.
      R185D-DATALOSS = SPACE.
      FOLGEAUFRUF102 = SPACE.
      PERFORM SETPAR_INIT.
    *{   INSERT         RD1K903017                                        3
    *}   INSERT
      LEAVE.
    ENDFORM.
    This program is working fine for single user but in production where no of people are creating the invoices from different places the data is not getting updated in table ZMIGO.
    sometime populating with wrong data , partial data and sometimes no updation at all.
    I have used the table locking system enqueue and dequeue FM's before n after updation but still the same
    thing is happening.
    What could be the reason.
    Looking for help very urgent any other alternate option.

    Hi,
    Go thru these..
    Enhancement
    SDVFX009 Billing doc. processing KIDONO (payment reference numbe
    SDVFX010 User exit item table for the customer lines
    SDVFX011 Userexit for the komkcv- and kompcv-structures
    V05I0001 User exits for billing index
    V05N0001 User Exits for Printing Billing Docs. using POR Procedu
    V60A0001 Customer functions in the billing document
    V60P0001 Data provision for additional fields for display in lis
    V61A0001 Customer enhancement: Pricing
    SDVFX001 User exit header line in delivery to accounting
    SDVFX002 User exit for A/R line (transfer to accounting)
    SDVFX003 User exit: Cash clearing (transfer to accounting)
    SDVFX004 User exit: G/L line (transfer to accounting)
    SDVFX008 User exit: Processing of transfer structures SD-FI
    SDVFX007 User exit: Billing plan during transfer to Accounting
    SDVFX006 User exit: Tax line (transfer to accounting)
    SDVFX005 User exit: Reserves (transfer to accounting)
    Business Add-in
    SD_CIN_LV60AU02 BADI for billing
    If it is helpful rewards points
    Regards
    Pratap.M

Maybe you are looking for

  • Material liability against vendor return

    Hi expert i have Done a GRN for 100 kg, from the 100 kg i have use 5 kgs for quality, then i came to material if of poor quality, so in the system only 95 kg is left, so i did vendor return for 95 kg. in this case my 5 kg is standing as liability , w

  • UIElement getting disabled

    Hi, I am trying to create a wd view layout with multiple groups and ui elements within it. I accidentally clicked on 'deploy and run' before 'save metadata', when there were couple of compile errors in the view. After I did this, the group in which t

  • SOAP to IDOC scenario:  java.lang.NullPointerException

    Our trading partners currently post their xml files directly to our Integration Engine, where they are converted to idocs and posted to ECC.  I am now trying to change this scenario to a SOAP to IDoc scenario so that we can process the files through

  • Interactive PDFs

    Hello all, I am using a Blackberry Z10 and need to fill in an Interactive PDF (generated by SAP). It does not seem that the native Adobe Reader works for this. Does any one have any ideas, options, apps that would allow me to fill in Interactive PDFs

  • Homesharing doesn't work

    After singning in to Homesharing I get a window that says something like "Congratulations now your homesharing is working", however I can not see it anymore in the side bar. I have this problem only on my iMac. When I tried to create a homesharing on