‎2012 Oct 19 9:02 AM
Hi all... I need to start a FM that will send a message to some external web service. This FM can be called asynchronously, the external system may not be running etc. so I have to store the request in a queue and allow system to repeat later or administrators to see why it does not work... something like IDOCs processing
Is there some mechanism in SAP to work like this, or I have to do it by myself?
I have tried standard V2 function module processing CALL FUNCTION...IN UPDATE TASK, it works basically, but by documentation I understand it's not exactly what it was designed for, and also I am not sure it suits my needs fully:
- it sends sap mails to users in the case of failure, is this possible to disable it?
- is there a way how to automatically repeat the updates, for example every 10 minutes?..
...do you think V2 FM are good way to achieve?..
Thanks for any advice!
Bye, Bohuslav
‎2012 Oct 19 10:50 AM
I would suggest you call the function IN BACKGROUND TASK, rather than UPDATE TASK.
Lifting from the ABAP help
If the specified destination is not available for COMMIT WORK, an executable program called
RSARFCSE is started in the background processing,
which by default tries every 15 minutes up to 30 times to start the function
modules registered for an SAP LUW in their destination. To change these
parameters, use transaction SM59. If the destination does not become
available within the given time, this is noted in the database table ARFCSDATA
as an entry "CPICERR". The entry in the database table ARFCSSTATE is deleted by
default after 8 days.
This should allow errors to be identified and automatic attempts made to reprocess.
If you require them to be placed in a queue to maintain sequence, then use a call to function
TRFC_SET_QUEUE_NAME first to set a queue name which will then appear in transaction SMQ1 should failures occur.
‎2012 Oct 19 10:50 AM
I would suggest you call the function IN BACKGROUND TASK, rather than UPDATE TASK.
Lifting from the ABAP help
If the specified destination is not available for COMMIT WORK, an executable program called
RSARFCSE is started in the background processing,
which by default tries every 15 minutes up to 30 times to start the function
modules registered for an SAP LUW in their destination. To change these
parameters, use transaction SM59. If the destination does not become
available within the given time, this is noted in the database table ARFCSDATA
as an entry "CPICERR". The entry in the database table ARFCSSTATE is deleted by
default after 8 days.
This should allow errors to be identified and automatic attempts made to reprocess.
If you require them to be placed in a queue to maintain sequence, then use a call to function
TRFC_SET_QUEUE_NAME first to set a queue name which will then appear in transaction SMQ1 should failures occur.
‎2012 Oct 22 9:12 AM
Hi Paul thanks for your advice. The other system is not a SAP system, I can not use RFC call, I need to use web service/soap... Maybe I am missing something?
The FM only I have tried to encapsulate every single SOAP call into some re-callable element...But probably the best way will be to create my own solution - db table with stored messages and status + some periodically called job that will try to process unprocessed messages + some administrator alv monitor...
One more - thanks for you effort!
Bye, Bohuslav.