Programming Serialization 

The procedure below describes how to program the queued RFC with send queue in its basic form (that is, without the addition AS SEPARATE UNIT and without "mixed mode").

Prerequisites

Procedure

To implement the qRFC with send queue, proceed as follows:

  1. Assign queue names for the subsequent function call(s).
  2. To pass the queue name, call function module TRFC_SET_QUEUE_NAME immediately before each function call.
  3. Call the function module using CALL FUNCTION … IN BACKGROUND TASK.
  4. Repeat steps 2 and 3 (and 1 if required) for all other function calls.
  5. Close the LUW using COMMIT WORK.
  6. Repeat steps 1 to 5 for all other LUWs of the application.

REPORT ... .

...

DATA Q_NAME LIKE TRFCQOUT-QNAME .

 

Q_NAME = 'BASIS_TEST_Q1'.

CALL FUNCTION ' TRFC_SET_QUEUE_NAME '

          EXPORTING

                  QNAME = Q_NAME.

CALL FUNCTION 'RFC_FUNCTION_1'

          IN BACKGROUND TASK

          DESTINATION 'DEST'

          EXPORTING ...

          TABLES ... .

...

Q_NAME = 'BASIS_TEST_QM'.

CALL FUNCTION ' TRFC_SET_QUEUE_NAME '

          EXPORTING

                  QNAME = Q_NAME.

CALL FUNCTION 'RFC_FUNCTION_N'

          IN BACKGROUND TASK

          DESTINATION 'DEST'

          EXPORTING ...

          TABLES ... .

COMMIT WORK.

* NEXT LUW

...

Result

The system stores the queue specifications in table TRFCQOUT.

With each COMMIT WORK, the system determines a counter that is used to keep the sequence of transaction processing.

As an introduction, execute the simple demo program RSTRFCT0.