Application Development and Automation 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: 
Read only

Asynchronious FM call - queue

Former Member
0 Likes
2,572

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,532

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.

2 REPLIES 2
Read only

Former Member
0 Likes
1,533

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.

Read only

0 Likes
1,532

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.