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

Terminate Running Tcode?

former_member194669
Active Contributor
0 Likes
11,001

Hi,

One of ALV report runs for more than 15 minutes ,

Thru programatically i tried to terminate the running tcode use ENQUEUE_DELETE, but it not working. How can i terminate a running Tcode and also i need to restrict the running Tcode time thru ABAP.

I Know to how to terminate thru SM04, I am expecting possible way to kill the running Tcode and its time restriction?

Thanks

aRs

10 REPLIES 10
Read only

Former Member
0 Likes
6,685

Hi,

Try to kill from the running window, go to top left corner and click on the folder icon and select stop transaction.

Otherwise please try transaction SM50.

Regards,

Ferry Lianto

Read only

former_member194669
Active Contributor
0 Likes
6,685

Ferry,

Thanks for your reply.

I looking for ways to kill the Running Tcode programatically?

aRs

Read only

0 Likes
6,685

If you are not using ITS then just call this function -ITS_END_SESSION.

Regards,

Amit

Read only

Former Member
0 Likes
6,685

Hi,

Try LEAVE PROGRAM or LEAVE TO TRANSACTION statement.

Regards,

Ferry Lianto

Read only

former_member194669
Active Contributor
0 Likes
6,685

Hi All,

May be my question is not clear.

I am writing a report that search for all running tcodes that are running more 15 minutes and terminate that same.

I am looking for ways to do this programatically?

Thanks

aRs

Read only

0 Likes
6,685

Isn't there a BASIS setting that can be used to fix the limit for online & background runtime?

~Suresh

was thinking of this system profile parameter

<b>rdisp/max_wprun_time</b>

Message was edited by:

Suresh Datti

Read only

0 Likes
6,685

Did u check the FM <b>TRANSACTION_END</b>

Read only

0 Likes
6,685

What you are essentially looking for is a functionality of SM04, select session and then select the individual transaction and kill. This is not available to you to put it in your custom code as the runtime process id of each such processes is hidden. You can look at the TH_* function modules but you may not achieve what you are looking for. Most of these are written as kernel functions.

It is very dangerous to automate something like that as there are even standard SAP transactions or jobs that run longer than 15 minutes. Is this a real requirement or an academic exercise?

Read only

former_member194669
Active Contributor
0 Likes
6,685

Hi Srini,

We have lot of transactions that can be called thru web and also these can be run thru

gui frontend also. Some of SAP archieve reports runs more 15 minutes and it is creating numerous number of dialog processes in the server,

So we could not able to restrict users from running these reports, so we decide to before making a terminate we inform user by giving info message and delete the running tcodes.

Thanks

aRs

Read only

0 Likes
6,685

Is the problem created by the web calls or SAP GUI calls? I am not sure if this can be achieved purely by writing one program. You may need to look at performance tuning, built-in checks in your programs for volume of data read etc. Archiving and indexing can help in some cases. User education plays a lot of role in this as well. I once tried to kill sessions of users based on some criteria but I wasn't really successful. Check the TH* function modules as I mentioned. May be you will find some success.