Sunteți pe pagina 1din 3

25/5/2014 MIRO - User Exit during SAVE: Read items & ...

| SCN
Getting Started New sletters Store

Hi, Guest Log On Join Us Search the Community

Products Services & Support About SCN Downloads


Activity Communications Actions
Industries Training & Education Partnership Developer Center

Lines of Business University Alliances Events & Webinars Innovation Brow se

4 Replies Latest reply: Jan 23, 2012 8:22 AM by Henrik Andersson

Share 0 Tw eet 0 Like 0

Henrik Andersson Mar 1, 2012 12:23 PM

MIRO - User Exit during SAVE: Read items &


Update header
This question has been Answered.

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 ingende vrden fr kontroll
MRM_HEADER_DEFAULT - Tyvrr stter bara XBLNR precis nr man gr in i MIRO...dvs fr tidigt.
MRM_ERS_HDAT_MODIFY - EJ anropad...

Would be greatful for any ideas on this matter...

Best regards
Henrik

Correct Answer
by Vishnu Tallapragada on Jan 22, 2012 10:22 PM

Hello Henrik,

In BADI INVOICE_UPDATE there are 3 methods CHANGE_AT_SAVE,

http://scn.sap.com/thread/2121789 1/3
25/5/2014 MIRO - User Exit during SAVE: Read items & ... | SCN
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

5809 View s
Average User Rating

(0 ratings)

Vishnu Tallapragada Jan 22, 2012 10:04 PM (in response to Henrik Andersson)

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

This is an interesting situation. BADI INVOIC_UPDATE provides you both header and item data of the
MIRO invoice but won't let you change them (all import variables). BADIs like
MRM_HEADER_DEFAULT will allow you to change XBLNR but you don't get the item data and it is
too early as this triggers as soon as the user enters data in MIRO.

You can update RBKP-XBLNR with INVOICE_UPDATE BADI. But you have to use call stack
technique. We have done similar thing in our project. I will let you know when I can access my
system.

Best regards,
Vishnu Tallapragada

Like (0)

Vishnu Tallapragada Jan 22, 2012 10:22 PM (in response to Henrik Andersson)

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

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

http://scn.sap.com/thread/2121789 2/3
25/5/2014 MIRO - User Exit during SAVE: Read items & ... | SCN

Like (0)

Henrik Andersson Jan 23, 2012 8:18 AM (in response to Vishnu Tallapragada)

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

Hi dear Vishnu!

I am REALLY sorry....that I ONLY can provide you with 10 Points of award.


Because your answer were MORE than helpful.

You have opened my mind for this new way of thinking

Thankyou very very much for your HELP!!!

Best regards
Henrik

Like (0)

Henrik Andersson Jan 23, 2012 8:22 AM (in response to Vishnu Tallapragada)

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

Hi again Vishnu

I found a way to send you even more earning points....

You get both "Solved problem" 10p AND "Very helpful" 6p = total 16p ....Yihaaaa!!!!!

best reg
Henrik

Like (0)

Share 0 Tw eet 0 Like 0

Site Index Contact Us SAP Help Portal


Follow SCN
Privacy Terms of Use Legal Disclosure Copyright

http://scn.sap.com/thread/2121789 3/3

S-ar putea să vă placă și