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: 

Passing data to User Exit in Parallel Processing

Former Member
0 Kudos

Hi,

We have a custom "wrapper" program that is used to call a SAP native program which has some User Exits. Before calling, it exports some data into a memory ID so that the User Exits can read it and process the data accordingly (for example, process the data for company code 1001 only).

The SAP native program does not provide any input parameters for the additional data (like Company Code) and it also allows for Parallel Processing using a server group.

We have a request to run the program for multiple companies at the same time using the Parallel Processing function provided by the SAP program.

The problem here is that a PID does not work on Parallel Processing when executing multiple tasks in multiple servers. If we use a shared memory object we do not know which object we are supposed to use in the User Exit (which company code am I supposed to filter?).

At this point we are looking at modifying the SAP native program but we want to see if someone else has resolved this by using other means such as trying to find the task name of the parallel session or the Parent PID of the children sessions.

Any help will be greately appreciated.

2 REPLIES 2

0 Kudos

Hi,

You can you the IMPORT/EXPORT statement where you can export the taskname and company code.

As the IMPORT/EXPORT will be unique for each session.

Increase the gv_taskname for each process in loop.

CALL FUNCTION 'ZSCH_CREATE_DELV_PARALLEL'

STARTING NEW TASK gv_taskname

DESTINATION IN GROUP gv_grp

PERFORMING task_return ON END OF TASK

EXPORTING

uv_vstel = uv_vstel

us_delivery_extend = us_delivery_extend

ut_sales_key = lt_sales_key_p

ut_sku_hu = lt_sku_hu_p

EXCEPTIONS

communication_failure = 1

system_failure = 2

RESOURCE_FAILURE = 3.

Best Regards,

Vijay

0 Kudos

Hi Vijay,

Thank you for your prompt response but I do not understand your answer or perhaps I am not makig myself clear.

Let me explain the current process:

1) Z program collects data and exports to Memory ID 'TEST01'.

2) Z program calls SAP program

3) SAP program calls User Exit '001' and data is read from Memory ID 'TEST01'.

4) SAP program collects some of the data and then executes SAP FM to continue processing.

5) SAP FM Executes User Exit for FM and data is read from Memory ID 'TEST01'.

6) SAP FM returns completed data back to SAP main program.

7) Z Program collects results from SAP program.

New process:

1) Z program collects data and exports to Memory ID 'TEST01'. Data now includes filter for CC.

2) Z program calls SAP program

3) SAP program calls User Exit '001' and data is read from Memory ID 'TEST01'.

4) SAP program collects some of the data and then executes SAP FM IN PARALLEL PROCESSING to continue processing.

5) SAP FM Executes User Exit for FM and an attempt to read data is read from Memory ID 'TEST01' fails.

6) SAP FM returns completed data back to SAP main program.

7) Z Program collects results from SAP program.

The dilemma is how to capture the proper CC filter in the FM exit when SAP is unable to read the data from memory ID 'TEST01'. I guess I can understand this since the tasks are executed in separate sessions and servers from the one that started the program since we are using a server group.

Perhaps I am missing something with respect to exporting to memory IDs?

Thanks.