1.

How Can You Differentiate Types Of Rfc By Syntax In An Abap Program?

Answer»

Basically RFC’s can be recognized in an ABAP program by the syntax CALL FUNCTION <rfc name=' '> DESTINATION <destination name=' '>.

If the RFC function call contains the clause STARTING NEW TASK, it is an asynchronous RFC; the clause IN BACKGROUND TASK indicates a TRANSACTIONAL RFC. If the call only contains the clause DESTINATION, but neither STARTING NEW TASK nor IN BACKGROUND TASK, then the RFC is started as a synchronous RFC.

The following code STARTS the functional module ZRFC_SALES_DEL_STATUS synchronously, ASYNCHRONOUSLY, and transactionally. 

* Synchronous RFC
CALL FUNCTION ‘ZRFC_SALES_DEL_STATUS’
DESTINATION ‘R10’
EXCEPTIONS
argument_error = 1
send_error = 2
OTHERS = 3.
* Asynchronous RFC
CALL FUNCTION ‘ZRFC_SALES_DEL_STATUS’
STARTING NEW TASK task
DESTINATION ‘R10’
EXCEPTIONS
communication_failure = 1
system_failure = 2
RESOURCE_FAILURE = 3.
* Transactional RFC
CALL FUNCTION ‘ZRFC_SALES_DEL_STATUS’
IN BACKGROUND TASK
DESTINATION ‘R10’
COMMIT WORK.

Basically RFC’s can be recognized in an ABAP program by the syntax CALL FUNCTION <rfc name=' '> DESTINATION <destination name=' '>.

If the RFC function call contains the clause STARTING NEW TASK, it is an asynchronous RFC; the clause IN BACKGROUND TASK indicates a transactional RFC. If the call only contains the clause DESTINATION, but neither STARTING NEW TASK nor IN BACKGROUND TASK, then the RFC is started as a synchronous RFC.

The following code starts the functional module ZRFC_SALES_DEL_STATUS synchronously, asynchronously, and transactionally. 

* Synchronous RFC
CALL FUNCTION ‘ZRFC_SALES_DEL_STATUS’
DESTINATION ‘R10’
EXCEPTIONS
argument_error = 1
send_error = 2
OTHERS = 3.
* Asynchronous RFC
CALL FUNCTION ‘ZRFC_SALES_DEL_STATUS’
STARTING NEW TASK task
DESTINATION ‘R10’
EXCEPTIONS
communication_failure = 1
system_failure = 2
RESOURCE_FAILURE = 3.
* Transactional RFC
CALL FUNCTION ‘ZRFC_SALES_DEL_STATUS’
IN BACKGROUND TASK
DESTINATION ‘R10’
COMMIT WORK.



Discussion

No Comment Found