Application Development and Automation 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: 
Read only

How to generate a program counter

Former Member
0 Likes
726

Hi, buddies.

I face this situation that I want to make a counter to count how many user run a special program(report or function module) in R/3 which will consume lots of resourses during the operating. I hope to utilize the counter to limit the numbers of the user.

I am wondering whether there is global parameter I can use or there is another method to realize my requirment.

Looking forward your replies.

Thanks in advance.

Alex

Hi, buddies.

I face this situation that I want to make a counter to count how many user run a special program(report or function module) in R/3 which will consume lots of resourses during the operating. I hope to utilize the counter to limit the numbers of the user.

I am wondering whether there is global parameter I can use or there is another method to realize my requirment.

Looking forward your replies.

Thanks in advance.

Alex

2 REPLIES 2
Read only

Former Member
0 Likes
571

Hi Alex

One possible solution might be handling it manually via the program:

1. Create a entry with the program id in table TVARVC as a counter variable.

2. At start of execution increment the variable.

3. At end of execution decrease the counter.

Though i foresee the problem incase of abnormal executions, like the execution has terminated in between...

Kind Regards

Eswar

Read only

Former Member
0 Likes
571

Hi,

Use IMPORT, EXPORT statement to achieve this..

Have this code at the end of the program..

DATA: V_RUN TYPE INT4.

  • Get the counter..

IMPORT V_RUN FROM DATABASE INDX(ST) ID 'PGM_RUN'.

  • Increment by 1 to know to how many times this program has been executed.

V_RUN = V_RUN + 1.

  • Update the country

EXPORT V_RUN FROM DATABASE INDX(ST) ID 'PGM_RUN'.

Thanks,

Naren