‎2011 Oct 28 3:36 AM
Hi Friends ,
I have a standard IDoc . Is there a way to trigger a job when IDoc fails . I see there is an option called After event in SM36 .
Is it possible to trigger an event when IDoc fails , which in turn will trigger the job ?
I have little doubt, is the event in IDoc( Process code ) and event which triggers the background job are same ?
If this is possible , please let me know the T Code to create event which can be used in IDoc .
Regards,
Kiran.
‎2011 Oct 28 10:14 PM
Hi Kiran,
SAP standard event inputErrorOccurred for objecttype IDOCAPPL is triggered when an IDoc fails. So you can trigger a workflow that inturn triggers a background event which starts a background job.
Please refer URL for cretaing events in background processing.
[http://help.sap.com/saphelp_nw70/helpdata/en/20/2d513897110872e10000009b38f889/frameset.htm|http://help.sap.com/saphelp_nw70/helpdata/en/20/2d513897110872e10000009b38f889/frameset.htm]
Triggering Events from ABAP Programs : Similar logic needs to be programmed in workflow.
DATA:
p_eventid TYPE btceventid,
p_eventparm TYPE btcevtparm,
p_server TYPE btcserver.
Obligatory parameter: EventID.
EventID should be an existing event already defined in transaction
SM64 or using CREATE method of class CL_BATCH_EVENT:
p_eventid = 'SAP_TEST'.
Optional parameters: event parameter and target server.
p_eventparm = 'Event parameter'.
p_server = ''.
CALL METHOD cl_batch_event=>raise
EXPORTING
i_eventparm = p_eventparm
i_server = p_server
i_eventid = p_eventid
EXCEPTIONS
excpt_raise_failed = 1
excpt_server_accepts_no_events = 2
excpt_raise_forbidden = 3
excpt_unknown_event = 4
excpt_no_authority = 5
OTHERS = 6.
CASE sy-subrc.
WHEN 0.
EXIT.
WHEN 1 OR 2 OR 3.
Raise failed.
WHEN 4.
Event does not exist.
WHEN OTHERS.
Raised failed due to unknown reason.
ENDCASE.
Hope I didn't confuse you. Sequence is IDoc fails->IDOCAPPL~inputErrorOccurred event raise by system->Custom workflow to trigger background event->Job scheduled with start condition as BG event.
Regards,
Abhijith
‎2011 Oct 28 7:31 AM
Hi,
use SWEL to find out which event gets created when an IDOC fails
Thanks & regards.
‎2011 Oct 28 10:14 PM
Hi Kiran,
SAP standard event inputErrorOccurred for objecttype IDOCAPPL is triggered when an IDoc fails. So you can trigger a workflow that inturn triggers a background event which starts a background job.
Please refer URL for cretaing events in background processing.
[http://help.sap.com/saphelp_nw70/helpdata/en/20/2d513897110872e10000009b38f889/frameset.htm|http://help.sap.com/saphelp_nw70/helpdata/en/20/2d513897110872e10000009b38f889/frameset.htm]
Triggering Events from ABAP Programs : Similar logic needs to be programmed in workflow.
DATA:
p_eventid TYPE btceventid,
p_eventparm TYPE btcevtparm,
p_server TYPE btcserver.
Obligatory parameter: EventID.
EventID should be an existing event already defined in transaction
SM64 or using CREATE method of class CL_BATCH_EVENT:
p_eventid = 'SAP_TEST'.
Optional parameters: event parameter and target server.
p_eventparm = 'Event parameter'.
p_server = ''.
CALL METHOD cl_batch_event=>raise
EXPORTING
i_eventparm = p_eventparm
i_server = p_server
i_eventid = p_eventid
EXCEPTIONS
excpt_raise_failed = 1
excpt_server_accepts_no_events = 2
excpt_raise_forbidden = 3
excpt_unknown_event = 4
excpt_no_authority = 5
OTHERS = 6.
CASE sy-subrc.
WHEN 0.
EXIT.
WHEN 1 OR 2 OR 3.
Raise failed.
WHEN 4.
Event does not exist.
WHEN OTHERS.
Raised failed due to unknown reason.
ENDCASE.
Hope I didn't confuse you. Sequence is IDoc fails->IDOCAPPL~inputErrorOccurred event raise by system->Custom workflow to trigger background event->Job scheduled with start condition as BG event.
Regards,
Abhijith