03-10-2014 2:27 PM
Hi All,
Could I know the user exit in MIRO for post save so that I could export the invoice year and invoice year from the user exit and import the variables to custom FM so that data could be updated to the custom database.
import belnr to invoice_no from memory id 'XXXX'.
import gjahr to l_fyear1 from memory id 'XXXX'.
UPDATE zheader SET belnr = invoice_no gjahr = l_fyear1 WHERE <condition>
COMMIT WORK AND WAIT.
Thanks in advance,
Ram.
03-10-2014 2:33 PM
Look at method CHANGE_IN_UPDATE of BAdI INVOICE_UPDATE.
(And no COMMIT WORK in this method please, best practices, call your customer function module in update task.)
Regards,
Raymond
03-10-2014 2:43 PM
Hi
See also SAP Note 1156325 - BAdIs in the Logistics Invoice Verification environment.
Regards
Eduardo
03-10-2014 2:46 PM
Hi ram,
There is a BAdI "INVOICE_UPDATE" having methods "CHANGE_IN_UPDATE" or "CHANGE_AT_SAVE"can be used. Please check if you were able to capture the Invoice Number and Invoice Year.
An alternative way instead of using user exits and BAdI is implicit enhancement in the Include "LMR1MF2Y" at the beginning of the FORM "variant_transaction". Below is the sample code.
ENHANCEMENT 1 ZMM_EN_XXXXXXXX.
IF SY-TCODE = 'MIRO'
AND SY-UCOMM = 'BU'
AND RBKPV-BELNR IS NOT INITIAL
AND RBKPV-GJAHR IS NOT INITIAL.
WAIT UP TO 1 SECONDS.
EXPORT RBKPV-BELNR FROM RBKPV-BELNR TO MEMORY ID 'ZXXXX'.
EXPORT RBKPV-GJAHR FROM RBKPV-GJAHR TO MEMORY ID 'ZYYY'.
ENDIF.
ENDENHANCEMENT.
Hope it helps you.
Thanks
Gangadhar