Parallel Processing
Hi Abap Gurus,
My leads are actually thinking of implementing parallel processing on my program. I just want to have an idea on how parallel processing works and the basic transactions that are involved in executing it.
Anybody familiar with this?
Thanks,
whiz
Look at the help for CALL FUNCTION ... STARTING NEW TASK ...
and RECEIVE RESULTS FROM FUNCTION...
Look at the help for CALL FUNCTION ... STARTING NEW TASK ...
and RECEIVE RESULTS FROM FUNCTION...
Have also a look on the Function group KKPA and documentation of
FM KKPA_PARA_PROCESS_START.
Christian
Hi ,
try this . same i have used in FM -
**********************
FUNCTION ZFII_TEST_RFC1.
*"----------------------------------------------------------------------
*"*"Local interface:
*" IMPORTING
*" VALUE(DATE) LIKE ZFI_TEST-ZDATE
*" VALUE(TIME) LIKE ZFI_TEST-ZTIME
*" VALUE(REPORT) LIKE ZFI_TEST-REPID
*" VALUE(MESSAGE) LIKE ZFI_TEST-MESSAGE OPTIONAL
*" TABLES
*" RETURNSTATUS STRUCTURE BAPIRETURN
*"----------------------------------------------------------------------
DATA:IT_TEST LIKE STANDARD TABLE OF ZFI_TEST WITH HEADER LINE.
IT_TEST-ZDATE = SY-DATUM.
IT_TEST-ZTIME = SY-UZEIT.
IT_TEST-REPID = SY-REPID.
IT_TEST-MESSAGE = 'RFC 1 Started'.
INSERT INTO ZFI_TEST VALUES IT_TEST.
CLEAR IT_TEST.
REFRESH IT_TEST.
WAIT UP TO 5 SECONDS .
CALL FUNCTION 'ZFII_TEST_RFC2' IN BACKGROUND TASK AS SEPARATE UNIT.
COMMIT WORK.
WAIT UP TO 5 SECONDS .
IT_TEST-ZDATE = SY-DATUM.
IT_TEST-ZTIME = SY-UZEIT.
IT_TEST-REPID = SY-REPID.
IT_TEST-MESSAGE = 'RFC 1 ended'.
INSERT INTO ZFI_TEST VALUES IT_TEST.
ENDFUNCTION.
regards
samir
Samir,
Your example is not parallel processing, as your main program stops execution and simply waits for the background task to complete. Which may take more than 5 seconds
For parallel processing your program would do something else after setting off another process, or more typically, it would fire off several tasks in parallel and wait for them to return their status/results.
Also be aware that the tasks fired off do not execute in 'background' mode, they use a DIA process. If you did this during the online day and did not limit the background tasks you will cause a dialog bottleneck for 'real' users.
If you do this at night, ensure Basis allow some DIA tasks to remain active.
Regards
The 'saur
Thanks for all your responses.
There are two types of parallel processing: Dialog / Background
(1) Dialog process: such as this code -
CALL FUNCTION l_function_name
STARTING NEW TASK l_task_counter
DESTINATION IN GROUP l_group_name
PERFORMING f_get_result ON END OF TASK
There is a limitation for dialog process - get max. time-out limit for each process. This function module must be set to RFC type.
(2) Background process:
Usually use function module: 'JOB_OPEN'. 'JOB_SUBMIT' and 'JOB_CLOSE' to submit child programs.
A parent program submit multiple child programs at the same time. There is no time limit for child program exectution time.