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: 

BADi BOM_UPDATE cannot trigger mail as FM giving dump

suryasarathi_basu
Participant
0 Kudos
148

Hi Experts,

I have a requirement to send mail at BOM change. I am using BADI BOM_UPDATE~CHANGE_BEFORE_UPDATE method for that.

Here I am using FM SO_NEW_DOCUMENT_ATT_SEND_API1 to send mail. But when i am using COMMIT = 'X' in the FM it is giving dump COMMIT_IN_PERFORM_ON_COMMIT. But without using commit the mail is not getting fired. So can anyone give me a solution? Please suggest me.

Regards,

SURYA

1 ACCEPTED SOLUTION

kesavadas_thekkillath
Active Contributor
0 Kudos
71

The method you choosed is wrong.

Response deleted as I was not sure about it

One more idea ... write your logic in a report program and submit that report from this method and try.

If this doesnt work choose some other badi and method for your requirement.

kesav

Edited by: Keshav.T on Dec 22, 2011 5:43 PM

Edited by: Keshav.T on Dec 22, 2011 5:47 PM

6 REPLIES 6

mithun_shetty4
Contributor
0 Kudos
71

Dont use Commit statement . The mail would be triggered and it wil be available in SOST.

To trigger mails from SOST Schedule Program RSCONN01 with an interval of 5 or 10 Mins

0 Kudos
71

Hi Mithun,

Thanks for your reply.

I have tried by not using Commit but it is not getting into SOST. The same code when i am using in a z- program for testing with commit function it is going to SOST but without that it is not going to SOST. So what to do in that case?

Regards,

SURYA

kesavadas_thekkillath
Active Contributor
0 Kudos
72

The method you choosed is wrong.

Response deleted as I was not sure about it

One more idea ... write your logic in a report program and submit that report from this method and try.

If this doesnt work choose some other badi and method for your requirement.

kesav

Edited by: Keshav.T on Dec 22, 2011 5:43 PM

Edited by: Keshav.T on Dec 22, 2011 5:47 PM

0 Kudos
71

Hi Keshav,

Thanks for your reply.

Actually I have used method Change_at_save of that badi and there the FM SO_NEW_DOCUMENT_ATT_SEND_API1 is working fine with commit = 'X' but I cannot get the item data which has been deleted from from BOM item. The problem which i am facing is that the item which has been deleted is coming with the other data in DELTA_STPOB and DELTA_STASB. So i cant distinguish between them. So i have used change_before_update which is showing the deleted item with an indicator 'D'. So i am using change_before_update method of the mentioned badi. Can you suggest anything more please.

Regards,

SURYA

0 Kudos
71
FM Documentation:
COMMIT_WORK

Default = ' '.

If this flag is set ('X'), an explicit Commit Work is sent at the end of the function module SO_DOCUMENT_SEND_API1.

An explicit commit is not allowed in the save process, need to find out another way..

SO_NEW_DOCUMENT_ATT_SEND_API1 is an rfc enabeled FM so you can call the FM in a new task like this:

CALL FUNCTION SO_NEW_DOCUMENT_ATT_SEND_API1 STARTING NEW TASK task..

0 Kudos
71

Hi Keshav,

I have used your submit a z-report idea and it is working fine.

Thanks you very much for such a brilliant idea.

Regards,

SURYA