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: 

Parallel Processing through ABAP program

Former Member
0 Kudos
808

Hi,

We are trying to do the parallel processing through ABAP. As per SAP documentation we are using the CALL FUNCTION STARTING NEW TASK DESTINATION.

We have one Z function Module and as per SAP we are making this Function module (FM)as Remote -enabled module.

In this FM we would like to process data which we get it from internal table and would like to send back the processed data(through internal table) to the main program where we are using CALL FUNCTION STARTING NEW TASK DESTINATION.

Please suggest how to achieve this.

We tried out EXPORT -IMPORT option meaning we used EXPORT internal table in the FM with some memory ID and in the main program using IMPORT internal table with the same memory ID. But this option is not working even though ID and name of the internal table is not working.

Also, SAP documentation says that we can use RECEIVE RESULTS FROM FUNCTION 'RFC_SYSTEM_INFO'

IMPORTING RFCSI_EXPORT = INFO in conjunction with CALL FUNCTION STARTING NEW TASK DESTINATION. Documentation also specifies that "RECEIVE is needed to gather IMPORTING and TABLE returns of an asynchronously executed RFC Function module". But while creating the FM remote-enabled we cant have EXPORT or IMPORT parameters.

Please help !

Thanks in advance

Santosh

4 REPLIES 4

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos
138

<i>We tried out EXPORT -IMPORT option meaning we used EXPORT internal table in the FM with some memory ID and in the main program using IMPORT internal table with the same memory ID. But this option is not working even though ID and name of the internal table is not working</i>

I think that this is not working because that memory does not work across sessions/tasks. I think that the

IMPORT FROM SHARED BUFFER and EXPORT TO SHARED BUFFER would work. I have used these in the past and it works pretty good.

Also,

here is a quick sample of the "new task" and "recieve" functionality. You can not specify the importing parameters when call the FM. You specify them at the recieving end.



report zrich_0001 .

data: session(1) type c.

data: ccdetail type bapi0002_2.

start-of-selection.

* Call the transaction in another session...control will be stop
* in calling program and will wait for response from other session

  call function 'BAPI_COMPANYCODE_GETDETAIL'
           starting new task 'TEST' destination 'NONE'
               performing set_session_done on end of task
    exporting
      companycodeid             = '0010'
* IMPORTING
*   COMPANYCODE_DETAIL        = ccdetails
*   COMPANYCODE_ADDRESS       =
*   RETURN                    =
            .
* wait here till the other session is done
  wait until session = 'X'.

  write:/ ccdetail.

************************************************************************
*       FORM SET_session_DONE
************************************************************************
form set_session_done using taskname.

* Receive results into messtab from function.......
* this will also close the session
  receive results from function 'BAPI_COMPANYCODE_GETDETAIL'
    importing
       companycode_detail        = ccdetail.

* Set session as done.
  session = 'X'.

endform.

Hope this helps.

Rich Heilman

Former Member
0 Kudos
138

HI Rich,

Thanks for your help. It helped me but I have another question. Is it possible to import internal table through receive ?

Thanks

Santosh

0 Kudos
138

Yes, internal tables can be passed just like other data types. Define a table type using SE11 and use that to provide a type definition for your table that can be shared by your program and the function module. Use the IMPORTING... EXPORTING.. features. The TABLES feature is considered obsolete and is not supported in ABAP OO.

0 Kudos
138

Yes, as Charles has already stated, you can pass internal tables through IMPORTING/EXPORTING as well as TABLES parameters, but if using ABAP OO, TABLES is obselete.

Regards,

Rich Heilman