cancel
Showing results for 
Search instead for 
Did you mean: 

Parallel profile use in reports

Former Member
0 Kudos

Hi All,

I need to use Parallel profile into my report to improve performance as the input has huge produt list. The report reads the data from planning area depending on the product entered. I learnt how to create profile and did one in the tcode /SAPAPO/SDP_PAR. I used this profile in report by selecting in the selection screen and saved as a variant. I then created a background job which uses this variant and executed. The job is taking same time as the job without parallel profile. Could you please tell me what other things i need to do it. I need to move the changes to prod this week. appreaciate your help.

THanks,

Deepika

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Ada,

I got lost looking at the code of the program /SAPAPO/TS_BATCH_RUN. Could you please tell me the steps i need to follow with some sample code? this would of great help.

Thanks,

Deepika

former_member187488
Active Contributor
0 Kudos

Hello,

As I said, it's really not that easy.

Maybe you can just refer to function module /SAPAPO/MSDP_PAR_PROCESS_START.

And you may mainly need the below steps:

1)Read parallel profile (around line 150)

2)Wait for free processes (around line 180)

3)Process blocks by loop (around line 320).

   In the loop, you need to do:

   - Read planning objects in blocks (around line 530)

   - Loop end when no planning object is read (around line 560). Otherwise process the block.

   - Check and wait for free processes (around line 610)

   - Call up your process logic of the block in a different process using the statement like below:

     ------------------

              CALL FUNCTION 'XXXXXXXXX'
              STARTING NEW TASK lv_taskname
              DESTINATION IN GROUP ls_par_profile-server_group

              EXPORTING ...

    ---------------------

4) Wait until all processes are finished. (around line 1195)

Best Regards,

Ada

Former Member
0 Kudos

hi ada,

Thanks for your reply. Can i not use FM /SAPAPO/MSDP_PAR_PROCESS_START directly?

If i cannot, then in the steps you have mentioned i need to call my process as FM. Should i now create a FM and copy my whole logic of alv report into this FM?

former_member187488
Active Contributor
0 Kudos

Sorry but no. Maybe you can copy some comman part like step 1), 2), 4), but you must create your own logic for planning object reading and processing. When I mentioned your process FM, I mean the FM you call inside the loop. This is nothing relevant with FM /SAPAPO/MSDP_PAR_PROCESS_START. I think an ABAP developer should understand the FM /SAPAPO/MSDP_PAR_PROCESS_START easily, since it has a clear logic.

Former Member
0 Kudos

Sorry. I am very new to the parallel processing logic. Will try to implement. Thanks a lot for your help.

former_member187488
Active Contributor
0 Kudos

Yes, we normally do not use it in our customizing program

former_member187488
Active Contributor
0 Kudos

Hi, what report are you using?

Former Member
0 Kudos

ALV report to display the contents of the planning area.

former_member187488
Active Contributor
0 Kudos

Do you have program name? Is it an SAP standard report?

Former Member
0 Kudos

I have created a custom program to extract data. The functionality of the report is to provide the planning of the materials regarding when it will be available to the customers.

Thanks,

Deepika

former_member187488
Active Contributor
0 Kudos

In this case, you must create your own program logic to process the parallel profile in the customizing report, like, first check whether parallel profile exists, if yes, divide data in to blocks according to parallel profile setting, and process blocks in parallel processes in free process exists ... You can refer to some SAP standard report with parallel processing like /sapapo/ts_lcm_cons_check, or /sapapo/ts_batch_run.

Former Member
0 Kudos

Oh ok. I will refer and impleemnt the same in my code. THank u very much for your help... i didnt understand this from your reply. 'and process blocks in parallel processes in free process exists'. do i need to check if any free blocks exists?

former_member187488
Active Contributor
0 Kudos

I think yes. For example, in /sapapo/ts_batch_run, parallel processing is done in function module /SAPAPO/MSDP_PAR_PROCESS_START. You may notice the following coding:

---------------------

   * Get number of free processes

  WHILE lv_wait_for_resources = true. "Note 1380215

* ==> TK.803681
    CALL FUNCTION '/SAPAPO/MSDP_PAR_FREE_PROC_GET'
      EXPORTING
        IV_SERVER_GROUP = ls_par_profile-server_group
      IMPORTING
        EV_PROCESSES    = lv_free_wps
      EXCEPTIONS
        INTERNAL_ERROR  = 1
        NO_RESOURCES_AVAILABLE = "Note 1380215
        OTHERS          = 3.
    IF sy-subrc <> 0.
*<<<--- Note 1380215
      IF sy-subrc = 2 AND sy-batch = true.
        lv_wait_for_resources = true.
      ELSE.
        lv_wait_for_resources = false.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4
              RAISING INTERNAL_ERROR.
      ENDIF.
    ELSE.
      lv_wait_for_resources = false.
*--->>> Note 1380215
    ENDIF.
* <== TK.803681

  ENDWHILE. "Note 1380215

-----------------

... and some further processes.

Former Member
0 Kudos

ok. let me check. i will try and implement the code. i thought using the profile directly in the report will handle everything.

former_member187488
Active Contributor
0 Kudos

Unfortunately it's really not that easy

Former Member
0 Kudos

Hi Ada,

quick questions

1. Do i need to check for any user?

2. THis profile is possible only for background or can it be used for online processing?

Thanks,

Deepika

former_member187488
Active Contributor
0 Kudos

1. I don't think you need to check for any user.

2. Online processing should also be OK.

Former Member
0 Kudos

ok. thank you.