Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

What is the user exit for post save in MIRO?

former_member232092
Participant
0 Kudos

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.

3 REPLIES 3

raymond_giuseppi
Active Contributor
0 Kudos

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

eduardo_hinojosa
Active Contributor
0 Kudos

Hi

See also SAP Note 1156325 - BAdIs in the Logistics Invoice Verification environment.

Regards

Eduardo

former_member223133
Active Participant
0 Kudos

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 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