cancel
Showing results for 
Search instead for 
Did you mean: 

Parallel processing in foreground not possible

Former Member
0 Kudos
772

I am trying to achieve a parallel processing in one of my interface.

HowEver, the interface is suppose to be executed in interactive mode.

It seems that no of tasks are restricted in foreground to six external sessions. That results in a dump CALL_FUNCTION_OPEN_ERROR.

Also refer to OSS note 710920.

Is it by any chance possible to execute a program in parallel with more than 6 tasks at a time without changing the basis settings.

I have refer to some of the SAP code for parallel processing. However they didn't seem to be doing anything different than what I have added in my code.

Please refer to part of my code:

&----


*& Form f007-create_fc_in_parallel

&----


  • Create forecast data in parallel

----


FORM f007-create_fc_in_parallel

TABLES lit_iden STRUCTURE /sie/e_pp_iden

USING lv_doc TYPE vbak-vbeln

lv_group LIKE rzllitab-classname

lv_simul TYPE c.

DATA: lw_rfcdest LIKE rfcdes-rfcdest,

lwa_iden LIKE LINE OF lit_iden.

*----


> Create task name

CONCATENATE c_taskname w_task_no INTO w_taskname.

CONDENSE w_taskname NO-GAPS.

w_order_header_inx-updateflag = 'U'.

CALL FUNCTION '/SIE/E_PP_CREATE_FC_DATA_PL_02'

STARTING NEW TASK w_taskname

  • DESTINATION IN GROUP DEFAULT

PERFORMING f008-return_info ON END OF TASK

EXPORTING

salesdocument = lv_doc

order_header_in = w_order_header_in

order_header_inx = w_order_header_inx

simulation = lv_simul

TABLES

item_in = it_item_in

item_inx = it_item_inx

schedule_in = it_schedule_in

schedule_inx = it_schedule_inx

sales_cfgs_ref = it_sales_cfgs_ref

sales_cfgs_value = it_sales_cfgs_value

iden_in = lit_iden

EXCEPTIONS

communication_failure = 1

system_failure = 2

RESOURCE_FAILURE = 3

.

CASE sy-subrc.

WHEN 0.

*----


>Job submitted successfully

w_task_no = w_task_no + 1.

w_snd_jobs = w_snd_jobs + 1.

WHEN 1 OR 2.

*----


>Communication error

*----


>Remove the server on which error occured

*----


>Get the destination name

CALL FUNCTION 'SPBT_GET_PP_DESTINATION'

IMPORTING

rfcdest = lw_rfcdest.

*----


>Remove the server from further

*----


>consideration

CALL FUNCTION 'SPBT_DO_NOT_USE_SERVER'

EXPORTING

server_name = lw_rfcdest

EXCEPTIONS

invalid_server_name = 1

no_more_resources_left = 2

pbt_env_not_initialized_yet = 3

OTHERS = 4.

IF sy-subrc <> 0.

LOOP AT lit_iden INTO lwa_iden.

add_message sy-msgty sy-msgid sy-msgno

sy-msgv1 sy-msgv2 sy-msgv3

sy-msgv4 lwa_iden-ident.

ENDLOOP.

ENDIF.

*----


>resubmit the task

PERFORM f007-create_fc_in_parallel TABLES lit_iden[]

USING lv_doc

lv_group

lv_simul.

WHEN 3.

*----


>resources not available

WAIT UNTIL w_rcv_jobs >= w_snd_jobs UP TO '1' SECONDS.

IF sy-subrc EQ 0.

*----


>resubmit the task

PERFORM f007-create_fc_in_parallel TABLES lit_iden[]

USING lv_doc

lv_group

lv_simul.

ELSE.

LOOP AT lit_iden INTO lwa_iden.

*----


>Resources not available for processing

*----


>forecast data

add_message 'E' '/SIE/E_PP_MSG' '086'

space space space space lwa_iden-ident.

ENDLOOP.

ENDIF.

ENDCASE.

ENDFORM. " f007-create_fc_in_parallel

Accepted Solutions (1)

Accepted Solutions (1)

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Can you pass it off to a background task instead, or do you need an answer from the function module?

Regards,

Rich Heilman

Former Member
0 Kudos

I am in Rich's camp on this one. It is usually not advisable to consume dialog processes while doing parallel processing. It can slow down the system to an ubearably slow state, and the user logon can be frozen if all the processes are taking. It is better, if you can, to pass the functions off to a background task.

Cheers,

John

Answers (2)

Answers (2)

christian_wohlfahrt
Active Contributor
0 Kudos

Hi!

Your 'starting new task' approach is normal way to make parallel programs. Just starting this from dialog and not from a background process is different to other parallel designs.

Do you need interaction after your data creation? If not, it might be possible to use a background task (or a job) to create your data by starting new tasks in parallel sessions.

But if you have to present results immediately, you might have this restriction.

Regards,

Christian

ChristianFi
Active Participant
0 Kudos

The number of tasks in foreground is determined by the number of sesseions the user is allowed to open. That means if the user is allowed to open 6 sessions and has already opened 4, the system will not be able to open more than 2.

If you send the program in background (not using background task) the ressources are determined by system settings like no of dialog workprocesses, etc. There are some restriction which reflects the current load, also - see the help for further info.

It is advisable that you define a servergroup to limit the number of wp you intend to use.

Christian