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.
Showing results for 
Search instead for 
Did you mean: 

Can anyone help me ? (report optimization)

Former Member
0 Kudos

When I ran a big program(actually,already optimized but still high cpu usage,but completely fast,just like 30 secs,and CPU lower than before) but so many users (50 more)

My scheme ---for example User1 runs the program,other user prohibit run it.and then show it will run it automatically after XX sec,such as put in queue up schedule.

and then when User1 run finished program,program will be release,if I dont to do so,I think production server gonna die when high usage,Does anybody has any idea on this...?

Thanks in advance.



Former Member
0 Kudos


What I would think is u anyways schedule the job when any user tries to execute. The job will check for if any other job is executing or is schedule.

If there is other job running but not schedule u will schedule this job with 'Wait for predecessor job' condition.

if there is any other job sceduled in the queue then u will schedule this job waitin on the one which is sceduled.

Keep the job name same 'JOB_REPORT_001'. The last three digit is running number.

This will give u idea as to how u want to proceed. U will need lot of Job sceduling FM to program them.

Former Member
0 Kudos


I think its better to force the user to run this program only as a background job and never allow the user to run in the foreground.

Queueing and all will be additional bueden on maintenance.



Former Member
0 Kudos

Hi Wang,

You can use the FM : <b>THUSRINFO</b> to get the list of users and the list of transactions run by them.

1. Assign a transaction code to your program

2. In the program before running your lenghty select statement do the following validation check whether the same transaction is being executed simultaneously by any other user.

If so, you can prohibit the user from running the transaction giving an error message...

DATA: BEGIN OF usr_list OCCURS 1000.
DATA: END OF usr_list. "Internal table for list of users"

"Get users and transactions run by them into usr_list"
TABLES usr_tabl  =  usr_list. 

DATA count TYPE i.

"Check whether the transactions is being run"
"Replace ZONE with your tcode"
LOOP AT usr_list WHERE tcode EQ 'ZONE'.
 count = count + 1.

IF count GT 1.
  MESSAGE a001(z538msg) WITH 'Already running'.
"First user : Permitted"