Skip to end of metadata
Go to start of metadata

Author: Sangyeul Han
Submitted: July 26, 2007
Description: Sometimes, you want to process abap code with parallel processing. In help you read the syntax following.

  • CALL FUNCTION func STARTING NEW TASK TASK
  • CALL FUNCTION func IN BACKGROUND TASK

But, you do not satisfied with "STARTING NEW TASK TASK" because of the session count 6. So, you decide to use "IN BACKGROUND TASK". After a while you also find that this syntax does not make parallel processing. This time, You can add "AS SEPARATE UNIT". First of all, your Function Module must be RFC. Let's go into the code.

Error rendering macro 'code': Invalid value specified for parameter 'com.atlassian.confluence.ext.code.render.InvalidValueException'
REPORT  y_test_syhan_008.

TABLES : mara,
         ysyhan_01.

DATA : BEGIN OF itab OCCURS 0,
         mtart LIKE ysyhan_01-mtart,
         quant LIKE ysyhan_01-quant,
         meins LIKE ysyhan_01-meins,
       END OF itab.

SELECT mtart INTO mara-mtart FROM mara.
  itab-mtart = mara-mtart.
  itab-quant = itab-quant + 1.
  itab-meins = 'EA'.
  COLLECT itab.  CLEAR itab.
ENDSELECT.

DELETE FROM ysyhan_01.

LOOP AT itab.
  CALL FUNCTION 'YSYH_MTART_QUANT'
    IN BACKGROUND TASK
    AS SEPARATE UNIT
*    IN UPDATE TASK
    EXPORTING
      mtart = itab-mtart
      quant = itab-quant
      meins = itab-meins.
  COMMIT WORK.
  WAIT UP TO 10 SECONDS.
ENDLOOP.

Code summary and explanation!

  • AS SEPARATE UNIT 
  • COMMIT WORK

Execute this ABAP Program and monitor SM50. In interval 10 seconds, dialog processes occur.
Caution. if processes count exceeds the restriction no, other SAP user will complain to you.

Good luck~

??

3 Comments

  1. Unknown User (suy5l35)

    Thanks.

    It's Helpful for my proceeding.

  2. Unknown User (1024sbjp3)

    Good Job!!! 

    It's Helpful for my proceeding.

  3. Unknown User (q8mhju0)

    Hi Sangyeul Han,

    A helpfull post.

    How many parallel sessions is supported by SAP at a time?

    Thanks,

    Prabhakaran.