Skip to Content
0

Want to find a user exit after created material document for Good Receipt of a PO using MIGO

May 09, 2017 at 10:18 AM

739

avatar image

Hi experts,

I need to find a user exit after created a material document for Good Receipt of a PO using MIGO tcode. that user exit should have after commit database updates.

Thanks.

10 |10000 characters needed characters left characters exceeded

If I wanted to send an e-mail in response to the creation of a document in SAP, my first thought would be to use output control rather than a user exit or a BADI. Have you considered that already?

0
* Please Login or Register to Answer, Follow or Comment.

8 Answers

Richard Harper May 09, 2017 at 11:45 AM
1

I doubt that you'll find one since the whole idea of user exits/badi's is to allow customer manipulation of data before it is saved on the database.

I would suggest encapsulating Migo in a custom transaction and then carrying on with your processing after the CALL TRANSACTION to MIGo ends.

Rich

Share
10 |10000 characters needed characters left characters exceeded
Patrick Weber May 12, 2017 at 11:26 AM
1

If I had to generate an e-mail in response to the creation of any document in SAP, my first thought would be to use output control rather than a user exit or a BADI. Have you considered that, yet?

Show 5 Share
10 |10000 characters needed characters left characters exceeded

No I haven't consider it.. how can I use it when posting a document..

0

Read up on "SAP output determination". There are lots of resources on that topic available on the internet and it will be worth the time investment as it's a general concept that you can use with almost any document to generate conditional printouts, IDocs, e-mail and other outputs whenever a document is created or changed. In your specific case, the customizing settings can be found here:

SPRO > Materials Management > Inventory Management and Physical Inventory > Output Determination

1

I searched on SAP output determination and found that it can be used in Good Receipts using MB01 not using MIGO.

0

Where did you find this? It can be used for any goods movement document, no matter how it was created.

1

Yup I will be wrong. In MB01 there is a Message tab but in MIGO how to send email. I refer this http://sapanalysis2014.blogspot.com/2014/10/auto-mail-send-at-goods-receipt-in-sap.html

0
N C Cooray May 09, 2017 at 11:21 AM
-1

Hi,

Please Check : - MB_DOCUMENT_BADI

Method:MB_DOCUMENT_BEFORE_UPDATE

MB_DOCUMENT_UPDATE

Regards,

NCC

Share
10 |10000 characters needed characters left characters exceeded
Pavithra Jayasinghe May 12, 2017 at 05:18 AM
-1

I have never used BADI before. Can anyone tell me how to use it??

Actually I want to send a mail after generated the material document...

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi,

You may get some idea on this BAID by referring its example class and reading documentation

1. Example implementation class CL_EXM_IM_MB_MIGO_BADI

2. Read documentation

Thanks and Regards,

1
Dieter Gröhn May 09, 2017 at 11:04 AM
0

Hi,

perhaps BADI: ME_PROCESS_PO_CUST Method CLOSE

can help. USE SE18/SE19.

Regards, Dieter

Share
10 |10000 characters needed characters left characters exceeded
Manish Kumar May 09, 2017 at 11:32 AM
0

What exactly you are trying to achieve as you mentioned "user exit should have after commit database updates"

Share
10 |10000 characters needed characters left characters exceeded
Raymond Giuseppi
May 10, 2017 at 09:27 AM
0

Did you try with MB_MIGO_BADI. In method POST_DOCUMENT the document number is already available, but database is not yet commited, so you could use a CALL FUNCTION IN BACKGROUND TASK/UNIT so it will be executed after the database commit, if you don't need any commit, you could also use A CALL FUNCTION IN UPDATE TASK. In first case use a RFC FM wrapper (with some BAPI call and COMMIT WORK) in second case an UPDATE V2 FM wrapper (only some OPEN SQL statements)

Share
10 |10000 characters needed characters left characters exceeded
Pavithra Jayasinghe May 23, 2017 at 06:37 AM
0

I tried MB_DOCUMENT_BADI but it also triggered before commit work.

So again I tried enhancement MB_CF001 and EXIT_SAPLMBMB_001 . In that INCLUDE ZXMBCU01 I added a break point but it not triggered. Do u have any idea???

Show 5 Share
10 |10000 characters needed characters left characters exceeded

All of the user exits badi's etc etc will be triggered before any commits since they are allowing you in the majority of cases to change data. Your break-point may not be being triggered if you have not activated the enhancement. However, I would follow @Patrick Webers advice above.

0

For cripes sake... Sending material document output by email is standard functionality. See Patrick's answer.

There are no "ideas" needed. Ask your MM consultant, they should be able to configure this.

0

Calm....Jelena....Breathe deeply and slowly......calm.....

0

Pavithra, read again my answer. You cannot get a user-exit/BAdI/etc. 'after database commit', as the transaction is finished/closed/ended at this point (Read some documentation on SAP the LUW concept) so I proposed a workaround, did you notice it?

NB: The exit you tried, is executed in update task (as method MB_DOCUMENT_UPDATE of the BAdI MB_DOCUMENT_BADI), so during the database update, do activate debug in update task. But you are not allowed to many actions during this step (only some database updates) to preserve database integrity.

To add to Jelena's comment, is there any reason you cannot use standard options of 'Output Determination' Customizing?

0

Raymond, I noticed your answer and finally thought to create a background job. As I found I cannot use standard options of 'Output Determination' Customizing because in our case email has to sent when doing Good Receipts using 103 movement type only for NHPP materials.

0