MIRO - User Exit during SAVE: Read items & Update header

Hi there!
During MIRO after pressing save...
I search for an user-exit or BAdI, to READ ITEM DATA and UPDATE HEADER DATA (XBLNR) after SAVE but before UPDATE.
I have searched this forum, but with no luck. Many more then me seem to have the same problem. The most common answer have been to try BAdI INVOICE_UPDATE, but that BAdI only give READ access and NO UPDATE, so no luck there..
To summarize all my searching here and findings... I list all exits I have tested...
User-Exits
LMR1M001 User exits in Logistics Invoice Verification
LMR1M002 Account grouping for GR/IR account maintenance
LMR1M003 Number assignment in Logistics Invoice Verification
LMR1M004 Logistics Invoice Verification: item text for follow-on docs
LMR1M005 Logistics Inv. Verification: Release Parked Doc. for Posting
LMR1M006 Logistics Invoice Verification: Process XML Invoice
MRMH0001 Logistics Invoice Verification: ERS procedure
MRMH0002 Logistics Invoice Verification: EDI inbound
MRMH0003 Logistics Invoice Verification: Revaluation/RAP
MRMN0001 Message output and creation: Logistics Invoice Verification
BADI - When saving in MIRO the following BAdI were passed...
PPA_CUST_BADI
/CCIS/FICLRDC_ENH
INVOICE_UPDATE  << only read no update
ME_DP_CLEARING
AC_DOCUMENT
FI_LIMIT_PROCESS
AC_QUANTITY_GET
FMRE_BUS_PROCESS
EXIT_XFMPRI_001
CO_DOCUMENT_INFO
INVOICE_UPDATE (method change_before_update ) << only read no update
MRM_RANSACT_DEFAULT
MRM_HEADER_DEFAULT
Other BAdI's
MRM_HEADER_CHECK - Bara ingående värden för kontroll
MRM_HEADER_DEFAULT - Tyvärr sätter bara XBLNR precis när man går in i MIRO...dvs för tidigt.
MRM_ERS_HDAT_MODIFY  - EJ anropad...
Would be greatful for any ideas on this matter...
Best regards
Henrik

Hello Henrik,
In BADI INVOICE_UPDATE there are 3 methods CHANGE_AT_SAVE, CHANGE_BEFORE_UPDATE and CHANGE_IN_UPDATE.
Of these CHANGE_AT_SAVE is called before INSERT / UPDATE statements are executed. We can use this to update RBKP-XBLNR.
We can't use CHANGE_BEFORE_UPDATE and CHANGE_IN_UPDATE methods as they are called after INSERT / UPDATE statements are executed and before COMMIT.
You can update RBKP-XBLNR through INVOICE_UPDATE~CHANGE_AT_SAVE method using call stack technique like below. You can replace 'VALUE' in the below code with the value based on your calculation using other variables like s_rbkp_new, ti_rseg_new etc.
method IF_EX_INVOICE_UPDATE~CHANGE_AT_SAVE.
  DATA: lv_name_xblnr(30) TYPE c VALUE '(SAPLMRMP)RBKPV'.
  FIELD-SYMBOLS: <fs_rbkpv> TYPE mrm_rbkpv.
  ASSIGN (lv_name_xblnr) TO <fs_rbkpv>.
  IF <fs_rbkpv> IS ASSIGNED.
    <fs_rbkpv>-xblnr = 'VALUE'.
  ENDIF.
endmethod.
Best regards,
Vishnu Tallapragada

Similar Messages

  • MIRO - User exit at save to put on a payment block

    I need to do some consistency checks at the save of MIRO.  In this user exit I need the option of putting the payment on a payment block.  I have found some enhancements but I haven't found any which will allow me to put it on a payment block.
    Regards,
    Davis

    use this BADI
    MRM_PAYMENT_TERMS

  • User-exit that split at item level according to bill of entry(BOE)

    HI,
    need to write the logic for splitting invoices at item level according to BOE.
    Customized new table:
    Info for the customized table:
    Table Name:     ZIN_BONDINV
    Field Name          Data Element          Type          Length     Short Text
    MANDT          MANDT          CLNT          03          Client
    VBELN          VBELN_VF          CHAR          10          Billing Document
    EXNUM          J_1IEXCNUM     CHAR          10          BOE or Excise Invoice #
    EXYEAR          J_1IEXYEAR          NUMC     04          Excise Year
    ZEILE               J_1IZEILE1          NUMC     04          Item no - GR at depot
    ZVBELN          VBELN_VL          CHAR          10          Delivery Number
    Z POSNR          POSNR_VL          CHAR          06          Delivery item
    ZWERKS          WERKS_D          CHAR          04          Plant
    This table to be used for storing the invoice created using delivery document along with other information extracted during billing document creation.
    Logic for populating the table:
    User Exit: RV60AFZC
    Form: USEREXIT_FILL_VBRK_VBRP
    This user exit should be used to update records in the customized table for the data with which billing document is created.  The data should be populated as follows:
         VBELN     =     VBRK-VBELN
         EXNUM     =     J_1IRG23D-EXNUM*
         EXYEAR     =     J_1IRG23D-EXYEAR*
         ZEILE          =     J_1IRG23D-ZEILE*
         ZVBELN     =     VBRP-VGBEL
         ZPOSNR     =     VBRP-VGPOS
         ZWERKS     =     VBRP-WERKS
    *The above data is read during splitting the billing document based on BOE (copy control routine 602) and should be used from there.

    USER-EXIT NAME IS RV60AFZZ

  • User exit on SAVE event in tranasaction CS01

    Hi all,
    Please tell me user exit on save event in transaction cs01.
    Thank you.

    Hi,
    Check the following user exits.
    PCSD0001            Applications development R/3 BOMS                          
    PCSD0002            BOMs: Customer fields in item                              
    PCSD0003            BOMs: Customer fields in header                            
    PCSD0004            BOM comparison                                             
    PCSD0005            BOMs: component check for material items                   
    PCSD0006            Mass changes user exit                                     
    PCSD0007            Check changes in STKO                                      
    PCSD0008            WBS BOM: Customer-specific explosion for creating          
    PCSD0009            Order/WBS BOM, determine URL page                          
    PCSD0010            Order/WBS BOM, determine explosion date                    
    PCSD0011            Knowledge-based order BOM, parallel update                 
    PCSD0012            Customer - Mat. number/mat. number during material exchange
    PCSD0013            Customer-specific processing of an explosion for BOM browser
    hope it helps
    Regards
    Rajesh Kumar

  • USER-EXIT on SAVE event for IE01

    Hi,
    I need USER-EXIT on SAVE event for t-code IE01.
    EXIT IEQM0003 work only first time after pressing "SAVE".
    IF i press "SAVE"  second time equipment will be created.
    Edited by: andriy.hulyk on Jan 26, 2012 12:45 PM

    Here is my code:
    IF DATA_ILOA-TPLNR IS INITIAL.
      AUTHORITY-CHECK OBJECT 'ZZ_MC_FLC'
      ID 'ZZFLC' FIELD '*'.
      CASE SY-SUBRC.
        WHEN 0."SAP-ALL User
          EXIT."OK
        WHEN 12."User without restriction
          EXIT."OK
        WHEN OTHERS.
          AUTHORITY-CHECK OBJECT 'ZZ_MC_FLC'
          ID 'ZZFLC' FIELD '01'.
            CASE SY-SUBRC.
              WHEN 0."Create eq. only with FL for some work centers
                MESSAGE E250(ZPM) WITH 'test' RAISING POSTING_NOT_ALLOWED_EXT.
            ENDCASE.
        ENDCASE.
    ENDIF.
    If i press "SAVE" firs time it work great. But next pressing just create new equipment. My restriction does not work(

  • User Exit during MB1B transaction

    Our scenario is during MIGO GR we are creating batches with a custom number range based on the unit of entry on the PO.  For example if we are procuring and receiving material A as Pallets with the unit of entry PAL then the batch number to be generated will be PAL0000123.  If for the same material A we are receiving as Drums then the batch number is DR00000123.  Each batch is required as all have a specific characteristic value that must be maintained.
    The next step in our process is to transfer these materials from one storage location to another using batch determination based on FIFO from MB1B.  The batch determination is only at the material level and not the Unit of Entry such as PAL or DR and so the system will transfer whatever material was received first irregardless of the unit of entry in MB1B.
    What we're looking for is a user exit during the MB1B transaction prior to the batch determination that will only select batches according to the value in the Unit of Entry field in MB1B.  This will allow us to apply the FIFO strategy to only PAL or DR batches separately based on the batch number assigned during GR.
    Thank you,
    Jeff Diluzio

    Hello,
    I have checked in my system and I see we do not have the order unit field available to create condition table with it but then we have a option to enahance the field catalog and there if we mention the field . However even in feild catalog I cant locate this filed but I see we have filed dummy.
    Conclusion: First step will be to do enhance field catalog with order unit field. If that is not possible then we need to use dummy field in field catalog to create condition table and then we need to pass order unit from MB1B screen to batch search/selection procedure.
    I know you have already tried for exit and all but I do not see any way possible to pass order unit to your selection /search procedure.

  • MIRO : User-exit to block an invoice

    Hello,
    I try all miro user-exits and badi and nothing works.
    I need to block some invoices in MIRO. The badi is good but no export parameters (I try dynamic assignment but it dumped !!)
    I you've any idea, I will reward
    Thanks

    Hi Fabrice,
    Please take a look at these threads..
    User Exit for FB60 ( Enter Vendor Invoice )
    Please help me find a User exit to block a Vendor
    cheers,
    Prashanth
    P.S : Please mark helpful answers

  • User-Exit at Save for KL01

    Hi,
    Is there any user-exit at save for transaction KL01.
    Here is my requirement.
    Where ever am employee is hired in HR ( transaction PA40; Action = Hire) i have to automatically create an Activity Type ( t.code : KL01 ). I am doing this in user-exit PBAS0001, component EXIT_SAPFP50M_002 on HR side.
    The next this is, once activity type is created using transaction KL01, i have to automatically trigger a activity type planning, transaction KP26.
    So, i need a user exit at Save in transaction KL01, so that i can trigger KP26 from there. I found one exit COOMKS02, but i its not triggeting from KL01.
    Does any one know any user-exit in KL01 which trigger at save. Please let me know
    Thanks,
    Pratik

    Hi Sharad,
    Thanks for your reply.
    I always have an option for executing both KL01 and KP26 fron PBAS0001, but what i was thinking that if there is any exit available at save in KL01, i can trigger KP26 from there.
    If i could not find any exit, i will call both KL01 and KP26 from PBAS0001 itself.
    Thanks,
    Pratik

  • User exit during planned order to production order conversion

    Hi,
    Let me know if there is any user exit during planned order to production order production.
    Regards,
    Yogesh

    Dear
    You can try the following :
    1.PPCO0001 /PPCO0007 /PPCO0012
    2.BADI workorder_update
    3.Check in SMOD or CMOD and enter PPC* -you will find all the related user exit
    Hope this helps
    Regards
    JH
    Edited by: Jiaul Haque on Oct 21, 2010 10:55 AM

  • User Exit during Sales Order Creation - New Line Item needed

    I have a situation during the process of sales order creation. If a Material in a line item has say 27 EA and the Base Unit is EA. But the Sales Unit is CSE. Then whenever the user enters 27 EA and presses enter he should get two line items.
    The first line item needs to convert to maximum number of CSE posible and the rest will be the second line item with the remaining EA. The order isn't important but that is what is needed. Question is how do I approach this problem and code my user exit accordingly and where do I code it.
    I was looking at SAPMV45A and saw the program MV45AIZZ which is meant as a user exit for any PAI event handling. If anybody has encountered this kind of requirement can you please share your view on this.
    I will definitely reward points for useful answers.
    Clark

    Hello Mahendra
    The requirement is as follows :
    PART 1:
    Sales Order Enter: 
    1.     When a line item is entered on a sales order (VA01 or VA02), at enter, check the sales unit of measure (VBAP-VRKME).
    •     Do not check line items where item category (VBAP-PSTYV) = TANN, TAPS or ZTAP.  TANN are free goods that should not be considered for consolidation.  TAPS & ZTAP are lower level materials as a result of product selection.  They will be attached to a higher-level material with an item category of TAX, which is relevant for consolidation.
    •     Do not check items where VRKME <> EA
    2.     If VRKME = EA, go to MARM for MATNR.
    3.     Go to record where alternate unit of measure (MEINH) = CSE, get the value from the numerator field (UMREZ).
    4.     Divide the order quantity (VBEP-WMENG) by UMREZ.
    5.     If the result is greater than 1.0, the customer has ordered more than one case and a new line item needs to be added to the sales order for the case quantity.
    6.     Add a new line to VBAP for the same material with the case quantity.  If not a whole value, the remainder of eaches (bottles) should update the qty on the first item on VBAP.
    •     Part 1 is relevant for order types ZCA, ZOR, ZSO, RE, ZSM
    PART 2:
    Batch Job to run prior to the Delivery Due List:
    1.     Read VBUK for Delivery Status (LFSTK) = A (delivery not processed).  Get all of the document numbers (VBELN).
    2.     Go to VBEP for those document numbers to get the goods issue date for the order.  There will be many records in VBEP for the same sales order.  Look at all orders with a goods issue date (WADAT) of next day.
    3.     Go to VBAK for those document numbers to see if there are multiple sales orders for the same Sold To party (KUNNR).
    4.     For customers who have more than one order in VBAK, search all line items (for all orders).  If there are no duplicate materials across sales orders, do nothing.
    •     Do not check line items where item category (VBAP-PSTYV) = TANN, TAPS or ZTAP.  TANN are free goods that should not be considered for consolidation.  TAPS & ZTAP are lower level materials as a result of product selection.  They will be attached to a higher-level material with an item category of TAX, which is relevant for consolidation.
    •     Do not check line items where reason for rejection (VBAP-ABGRU) is not blank
    5.     If there are duplicate materials, go through the same logic as in part 1.  If the quantity across the sales orders adds up to greater than one case, add the appropriate quantity to a new line item on the first sales order.   If there is a remainder qty, update the line item on the first sales order with this qty. In this case, the quantities on the second sales order needs to be closed out with a reason for rejection code of 50, ‘Line Item Consolidation’. If there is no remainder,  update the qty on this item directly.
    •     Part 2 is relevant for order types ZOR, ZCA, ZSM
    •     This batch job will have to be run manually for Day Pick orders.  The end of this program should automatically kick off the delivery due list for Day Pick orders, shipping condition 02.
    Business Justification:
    The business requires that like order line items be consolidated to one line item prior to the order going to the warehouse for picking.  This will aid in picking at the warehouse as well as result in the customer invoice not reflecting more than one line item for the same material.  In the case where the customer has truly ordered more than a case, i.e;, 1 case, 2 bottles, the documents in SAP will still reflect 2 lines.

  • User exit during MIRO with PO reference data

    I have maintained dates Validity Star and End dates in Purchase order header data. My client wants that during MIRO system will throw error message if the posting date of IV crosses the Validity end date maintained in PO.
    Is there any user exit for this so that during giving PO reference system will look for this data in PO and throw message or during simulate or post.
    Regards,
    Suman

    Hello Suman,
    Please follow this steps to get the list of Userexits for the TCODE MIRO read there short description to get the appropriate EXIT.
    Steps.
    1. Goto the Tcode
    2. System-> Status.
    3. Copy the program name, find the package for the program.
    4. Go to SMOD (tccode)  press F4 -> Click on "Information System" Push Button->
       Enter the Package name-> and press the enter button.
    5. Now you get the list of Userexits. Need to select one by looking into its short    description.
    Hope this solves your issue,
    Cheers,
    Suvendu

  • User Exit at Save during post-diffrences step in MM07 !

    hi friends,
    On the step in mm07 during save of the document , i need to capture the corresponding material document number generated.For this i refferred to exit                  
    EXIT_SAPMM07M_001  of enhancement : MBCF0002
    but it gets triggered just before save,so material doc. no is not populated here.i want some exit or may be a BADI which gets triggerred exactly on save after the material document number is generated.
    thanks,
    sachin soni

    http://209.85.141.104/search?q=cache:Ysioiwr1QP0J:help.sap.com/bp_blv1600/BL_UK/documentation/General/S04_Master_List_EN_UK.xlsexitforMM07in+sap&hl=en&ct=clnk&cd=1
    this will help u

  • Reg user exit used for reading VB items

    Dear all,
    Please give me the details of user exit used when we run plant level MRP by MDBT, so that it will create
    purchase requisitions only for consumables VB items, please explain how it works.
    Thanks in advance

    Hi,
    Can you explain what you mean by
    create purchase requisitions only for consumables VB items
    So for others you want to have planned orders?
    Regards,
    Vivek

  • MIRO User exit - processing order

    Hi
    I've had a user request to try to copy the text line entered in the header part of MIRO into the posted transactions in BSEG so that when GL account analysis jobs are run eg FS10N, relevant text info is shown as well (as it does when manual invoices are posted). I've worked on the User exits available and with the Export/Import to memory option I thought that I'd cracked it.
    I used the Export option in EXIT_SAPLMRMP_010 as required input data is available there. Then I used the Import option in EXIT_SAPLMRMP_004 as that exit is used to post data to the accounting functions. For testing I put a breakpoint into each of them.
    During testing, I was surprised to find that EXIT_SAPLMRMP_004 was actually processed before EXIT_SAPLMRMP_010 during MIRO although I proved that the concept would work would work by manually keying some text into the relevant field at the breakpoint as it appeared in BSEG afterwards.
    Can anyone please advise if there is an easy way to discover the order of processing of the exits available to MIRO (dozens of includes in SAPLMR1M!!) so I can put the Export option into the correct place.
    Thanks
    Jim Jackson

    Hi Jim,
    You can try with BTE (Business Transaction Events).
    Goto SE37 - SAMPLE_PROCESS_00001120 (this is the standard BTE for account document posting). copy this with ZSAMPLE_PROCESS_00001120.
    In this you cannot modify the tables t_bkpf and t_bseg. you can use t_bkpfsub and t_bsegsub.
    For this a little bit config is required.
    1) Goto t-code FIBF-> settings->Products->... of a customer.
        Click new entries -> product name- ZPRODUCT , text - any text, RFC dest -                                     ZSAMPLE_PROCESS_00001120, A - enable check box -> save.
    2) Go back -> settings -> P/S Modules -> ... of a customer.
        Click new entries -> event - 00001120, Product - ZPRODUCT, Ctr - Country key, Appl - FI-FI,   Function module - ZSAMPLE_PROCESS_00001120 -> save.
    3) Go back -> settings -> Process Modules -> ... of a customer.
        Click new entries ->Process - 00001120, Ctr - Country key, Appl - FI-FI, Func module - ZSAMPLE_PROCESS_00001120, Product - ZPRODUCT -> save.
    Now goto SE37->ZSAMPLE_PROCESS_00001120
    logic.
    loop at t_bkpf.
    loop at t_bkpfsub.
         move 'your value' to t_bkpfsub-value.
         modify t_bkpfsub index sy-tabix.
    endloop.
    endloop.
    loop at t_bseg.
      loop at t_bsegsub.
          move 'your value' to t_bsegsub-value.
          modify t_bsegsub index sy-tabix.
      endloop.
    endloop.
    ''your value' is imported value.
    no need to worry abt modified values. after execution of BTE it will go to standard prog and copy the values of t_bkpfsub[] and t_bsegsub[] to SAP tables. so pls be perfect with code. SAP wouldn't allow change the values in t_bkpf[] and t_bseg[] values. you can add your own fields in bkpf_subst and bseg_subst.
    But make sure that, pls write the code in FM with conditions like cocode doc type etc. bcz this BTE is very important. it will executes before acc doc is posted.if you do not specify any conditions it will execute for all co codes in acc doc. it will affect business. you can debug this BTE. put a break point in FM and see the values while post the MIRO.
    once import the values free memory id and clear the variables what ever u used in BTE.
    Best Regards,
    Mohan.

  • MIRO User-Exit or BADI Name

    Hi all,
    How can i control MIRO referans field during saving Vendor Invoices? What is the name of User Exit or BADI name?
    Best regards,
    Munur EBCIOGLU

    SE18 > INVOICE_UPDATE >
    based in ur requirement you can use:
    Methods:
    CHANGE_AT_SAVE     Invoice Document at Save
    CHANGE_BEFORE_UPDATE     Invoice Document Before Update
    CHANGE_IN_UPDATE     Invoice Document During Update

Maybe you are looking for