Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Parallelization is not happening using asychnronous RFC in a function module

0 Kudos
428

A BW data source ZTEST
has been created based on a function module ZTEST_FM to pull the
data into BW system from R/3.

(Have checked the parellel jobs running in SM66 transaction).

Inside the function module, an RFC function
module
ZTEST_RFC1 has been called asynchronously to implement the parallelization
to improve the data extraction time into BW system.

Note: In this scenario asynchronous
RFC is used to implement the parallel processing.

The logic in the function module is as follows.

Function module ZTEST_FM Logic:

  • Fetch data from HRP1000 table into an internal table IT_HRP1000 for
    OTYPE = ‘TN’.
  • Loop at IT_HRP1000 into work area (WA).
  • Call the RFC asynchronously by passing OBJID,OTYPE and ENDDA,
  • Calculate SOBID which is the required output field from the RFC
    function module.
  • Populate the results into final internal table E_T_DATA.

The output structure contains the following fields.

  • OBJID
  • BEGDA
  • ENDDA
  • SOBID

Could you please give us some suggestions, to implement the parellel processing using asychronous RFC in this scenario.

Would appreciate your help.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
252

Hi Jayashankar,

Just want know, why WAIT statement is written before RFC call ? Usually WAIT will be written after RFC call to collect consolidated result in parallel processing . It seems like before calling  RFC call system will wait till previously called RFC So it will be like synchronous behavior. Please correct me if my assumption is wrong.

Thanks &  Regards,

Arun

7 REPLIES 7

iotatau
Participant
0 Kudos
252

Your RFC call looks correct. For collecting the result you will need to code the callback routine Write_E_T_data. Inside the callback you can use the statement


RECEIVE RESULTS FROM FUNCTION ZFHLS_EX_TNM_ACADEMY_RFC1 IMPORTING <parameter list>

to retrieve the calculated result. For the declaration of the callback routine I recommend

FORM Write_E_T_data USING iv_name TYPE c.


The parameter iv_name containing the name of the RFC task turned out to be mandatory in my tests.

0 Kudos
252

Thank you Jochen for your reply,

I have implemented the RECEIVE RESULTS FROM FUNCTION ZFHLS_EX_TNM_ACADEMY_RFC1

in the function module in WRITE_E_T_DATA sub routine.

but main issue is the jobs are not running in parellel.

i.e. jobs running synchronously.

0 Kudos
252

Have you checked with transaction RZ12 if any parallel server group has been configured on your system?

0 Kudos
252

Yeah, have checked the RFC server group maintained in RZ12 transaction.

RZ12 server group name  is 'pararellel_generators'.

system = 'pararellel_generators'.

we tried the below two options.

DESTINATION IN GROUP system

DESTINATION IN GROUP DEFAULT.

but the issue remains same.

Thanks

Jay.

0 Kudos
252

I usually check my parallel jobs with SM50. Could it be that the calculation is so quick that the RFC call is finished before the next RFC request is issued? - Debugging parallel jobs is not easy. What I have done for my task is to create program logic to switch between synchronous or asynchronous/parallel execution. Whenever I have made major changes in the RFC code I first monitor a clean synchronous execution and only then switch to parallel execution. Note that you have to call the callback routine manually for synchronous execution.

Former Member
0 Kudos
253

Hi Jayashankar,

Just want know, why WAIT statement is written before RFC call ? Usually WAIT will be written after RFC call to collect consolidated result in parallel processing . It seems like before calling  RFC call system will wait till previously called RFC So it will be like synchronous behavior. Please correct me if my assumption is wrong.

Thanks &  Regards,

Arun

0 Kudos
252

Thank you Aruna Kumara K,

I have tried  by removing the statement WAIT UNTIL before the RFC CALL, now the jobs are executing in parellel.

Thanks again.

Regards,

Jay.