2011 Dec 22 11:11 AM
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
2011 Dec 22 12:08 PM
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
2011 Dec 22 11:37 AM
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
2011 Dec 22 11:51 AM
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
2011 Dec 22 12:08 PM
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
2011 Dec 22 3:01 PM
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
2011 Dec 22 7:56 PM
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..
2011 Dec 23 6:55 AM
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