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: 

Restricting Number of users for executing report

Former Member
0 Kudos

Hi Gurus,

I have developed one report which is using parallel processing inside it with 4 different kinds of FMs. Here environment is much bigger in nature with 5 different Servers. Now I want to restrict number of users executing that report because if many users execute this report then it will be overhead on system at peak hours.

I want to restrict number of users using the report to 10. How can I get count of users executing the report? Also how can I restrict the number of users to some limited amount for this particular report only.

Pls help in this regards.

1 ACCEPTED SOLUTION

martin_voros
Active Contributor
0 Kudos

Hi,

as far as I understand your question you want to restrict number of users running your report at the same time but potentially there can be more than 10 users who can run this report. If this is right then authorizations don't help you in this case. I mean you can still control access to the report but you can't limit number of executions at same time. From your description I guess that report is custom development so you need to implement this by yourself. I can think about multiple approaches. One is to have a table/memory area with 10 lines, before running business logic the program would try to get at least one free slot. If there is one then it would take it. At the end of execution it would release its slot. If you have more questions than I would suggest ABAP forum.

Cheers

8 REPLIES 8

Former Member
0 Kudos

Hello,

-> see if you can provide this report in the form of a custom tcode to users, if that is possible you can add the custom tcode to the users whom you would like to run.

-> add this program to auth group and assign this auth group to only those people who should be able to execute it.

let us know, if this works for you.

Thanks,

Brahmeshwar

martin_voros
Active Contributor
0 Kudos

Hi,

as far as I understand your question you want to restrict number of users running your report at the same time but potentially there can be more than 10 users who can run this report. If this is right then authorizations don't help you in this case. I mean you can still control access to the report but you can't limit number of executions at same time. From your description I guess that report is custom development so you need to implement this by yourself. I can think about multiple approaches. One is to have a table/memory area with 10 lines, before running business logic the program would try to get at least one free slot. If there is one then it would take it. At the end of execution it would release its slot. If you have more questions than I would suggest ABAP forum.

Cheers

0 Kudos

I agree, and will move the thread to the ABAP Performance forum...

0 Kudos

Thanks all,

I agree with Maritn, but isn't there any other solution from Basis/Performance point of view. I mean can't we restrict it through basis settings?

0 Kudos

Hi,

> I agree with Maritn, but isn't there any other solution from Basis/Performance point of view.

> I mean can't we restrict it through basis settings?

nope. I'm afraid: No we can't. Or more precisely: it dpends.

We can not limit the users that are allowed to run your program. But in principle we can restrict the number

of parallel threads one user may start. If the parallelization is implemented with asynchronous RFC (ARFC) the

RFC groups offer the ressource restrictions. you can e.g. allow 48 parallel processes. Those can be used by

one users or by 24 or by 48 and if we have more you can react on the ressource shortage with an error or

decide to run your program sequentially (if implemented in that way).

With parallelism you can use the whole system ressources with one user. So parallelism is nothing that scales up

as the number of users increases. You have to be careful with that if multiple users run your program.

Check out this link:

http://books.google.de/books?id=TmPoYfpeJAUC&pg=PA624&lpg=PA624&dq=kyteparallelscale+user&source=bl&ots=RzYf8w1w0y&sig=8GfMEe8WvNDk8fh7wqgOQ78830k&hl=de&ei=wop4Tf31KsSgOqmp7YUH&sa=X&oi=book_result&ct=result&resnum=1&ved=0CBsQ6AEwAA#

it explains this from an database perspective (parallel dml / sql) but it is in principle also valid for a SAP system.

In a SAP system the ressource control for parallel processes is done with RFC groups or has to be implemented by

other means in the application.

Kind regards,

Hermann

Former Member
0 Kudos

Thanks Hermann.

I had arrived on that solution previously but hoping for any simple Basis solution if possible.

I guess I have no choice.

0 Kudos

We can not limit the users that are allowed to run your program.

Maybe we can?

I propose to use FM ENQUEUE_ESFUNCTION. It locks a report execution.

First, some SET/GET parameter should be used for saving of report execution count. Use SAP memory (SET/GET PARAMETER ID ...), because we need to exchange information between main and/or internal sessions.

Therefore, by any report call (event LOAD-OF-PROGRAM) SET this parameter to <current value>+1.

Then, check this new value, if it is equal to limit, call ENQUEUE_ESFUNCTION like this:


CALL FUNCTION 'ENQUEUE_ESFUNCTION'
  EXPORTING
    funcname     = 'Z_REPORT'
    mode_tfdir   = 'X'
  EXCEPTIONS
    foreign_lock = 4.
CHECK sy-subrc = 0.

Also, don't forget to subtract 1 by exiting report, and use FM DEQUEUE_ESFUNCTION to unlock the report when parameter value reaches limit-1.

0 Kudos

Hi,

We can not limit the users that are allowed to run your program.

>Maybe we can?

what i meant is:

we can not limit the users that are allowed to run your program with basis settings. That is there is no customizing or ressource control avalble that allows to specify program x may run up to 5 times in parallel or something like this... at least i'm not aware of such a thing... .

You gave a nice example for:

...or has to be implemented by other means in the application.

Kind regards,

Hermann