17.08.2013 Views

Data Interfaces

Data Interfaces

Data Interfaces

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Asynchronous RFC: Parallel Processes<br />

© SAP AG<br />

PROGRAM PARAL01.<br />

...<br />

CALL FUNCTION 'A'<br />

DESTINATION '1'<br />

STARTING NEW TASK 'A'<br />

PERFORMING 'BACK' ON END OF TASK.<br />

CALL FUNCTION 'B'<br />

DESTINATION '2'<br />

STARTING NEW TASK 'B'<br />

PERFORMING 'BACK' ON END OF TASK.<br />

...<br />

FORM BACK USING TASK.<br />

CASE TASK.<br />

WHEN 'A'. ... AFLAG = 'X'.<br />

WHEN 'B'. ... BFLAG = 'X'.<br />

ENDCASE.<br />

SET USER-COMMAND 'CHECK'.<br />

ENDFORM.<br />

AT USER-COMMAND.<br />

CASE SY-UCOMM.<br />

WHEN 'CHECK'.<br />

IF AFLAG = 'X' AND BFLAG = 'X'.<br />

...<br />

By starting several RFCs with STARTING NEW TASK, you can roll out calculations to other servers<br />

(with distributed systems) or systems, or run them in parallel.<br />

If you have to wait for the result of some or all called function modules, you can control this in the list<br />

environment via the event AT USER-COMMAND by setting flags.<br />

Note:<br />

You can perform the same action in a dialog chain (screen sequence) without using SET USER-<br />

COMMAND to trigger the AT USER-COMMAND list event. Please note that the function modules<br />

first run separate from the client program. You do not know when the individual function modules have<br />

finished or, consequently, when the relevant FORM routine is internally triggered. The processing of the<br />

FORM routine is inserted into the current PAI event of the client program. PAI is then processed again<br />

from the beginning.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!