Archived discussions are read-only. Learn more about SAP Q&A

how to restrict the report execution for 5 times when users run at same time in parallel

Hi,

As apart of performance i need to restrict the one custom report execution for 5 times only when users executed at the same time in parallel.

Any clues............

Regards

Ram

Tags:
replied

Intresting..

As Rajesh suggested limit the number of people having authoriztion.
I can think of a work around.

Create a customizing table say with just 2 key feilds

Report name and Lock index .

Say if you want the report to restrict to five user then matintain 5 rows and with same report name and lock index

(01,02,03,04,05).

Check the below code

INITIALIZATION.
  DATA : v_key TYPE rstable-varkey,
         v_flag_ok TYPE char1.
*zconfig has keys mandt repname lockindex.
  SELECT * FROM zconfig
    INTO TABLE it_zconfig WHERE repname = sy-repid.
  IF sy-subrc = 0.
    LOOP AT it_zconfig ASSIGNING <fs_zconfig>.

      CONCATENATE  <fs_zconfig>-mandt <fs_zconfig>-repname <fs_zconfig>-lockindex
      INTO  v_key.
      CALL FUNCTION 'ENQUEUE_E_TABLE'
       EXPORTING
*     MODE_RSTABLE         = 'E'
         tabname              = zconfig
         varkey               = v_key
*     X_TABNAME            = ' '
*     X_VARKEY             = ' '
*     _SCOPE               = '2'
*     _WAIT                = ' '
*     _COLLECT             = ' '
       EXCEPTIONS
         foreign_lock         = 1
         system_failure       = 2
         OTHERS               = 3
                .
      IF sy-subrc <> 0.
        CLEAR V_CONFIG.
        CONTINUE.
      ELSE.
        v_flag_ok = 'X'.
        EXIT.
      ENDIF.
    ENDLOOP.
    IF v_flag_ok IS INITIAL.

      MESSAGE 'Max no. of user reached! cannot run report ' TYPE 'E'.
    ENDIF.

  ENDIF.

1 View this answer in context
Not what you were looking for? View more on this topic or Ask a question