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: 

Lock Z report with message

Former Member
0 Kudos

Hello.

I want to shre the idea of blocking obsolete reports from execution and ask for your ideas.

In our core ERP system there are a lot of Z reports (>8k) with transactions attached to them.

And I want to lock the oldest of them from execution.

So when user start the ZABC transaction, or ZDEF report from SE38(SA38), or when user schedule background job there will be a message 'The report ZABCD is locked because ...".

Who knows the best way to do it without changing ABAP code of reports?

For example we store the names of locked reports in custom database table and any report before execution should be checked.

If it is in the table, a popup message should be shown and execution should be stopped.

Locking via SM01 is not convinient, because only transactions are being locked, so this doesn't help.

I have found several standart function modules which can be enhanced with custom code to check the locking of an reports. They are

1) JOB_SUBMIT - can stop background schedule

2) AUTH_CHECK_TCODE - can check transaction code

3) SUBMIT_REPORT - can stop execution from SE38(SA38)

I have locked 30% of our Z reports. They all are obsolete. But 3 enhancements are too much. And they cannot check for execution of function modules.

Maybe you know only one standart object that can be enhanced to check execution of reports/function modules?

Or maybe there is standart BADI for it?

Is there any fresh ideas?

Thanks is advance.

Anatoliy Stypshin,

Custom Code Management Tead Lead.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Anatoliy,

For the execution of Reports you can check the following link https://scn.sap.com/thread/768396

probably it will help you.

Regards

17 REPLIES 17

former_member195402
Active Contributor
0 Kudos

Hi Anatoliy,

the easiest way to lock transactions is via tcode SM01. But you can lock module pools completely this way, while executable programs can be startet via SA38, when someone has the authority to do so. And you can't use an own message using SM01.

Regards,,

Klaus

0 Kudos

Thank you Klaus.

But the main idea is to show a message to user WHY it is locked and lock not only transaction, but a report itself. So the SM01 is not the way we can do so.

0 Kudos

Hi,

then you can change the tcode in SE93 and replace the report with another one giving a message of type A with text 'Tcode XYZ is locked, because the report has become obsolete' and give sy-tcode for XYZ.

So you only have to switch the reports in the transaction.
For SA38 execution you've told, that you have another solution.

Regards,

Klaus

Shubham1
Employee
Employee
0 Kudos

Hi,

This thread will help you.

How to lock transaction codes in ABAP report | SCN

- Shubham

Former Member
0 Kudos

Already helped. But only transactions can be locked and no way to show a "human readable" message.

Former Member
0 Kudos

Hi Anatoliy

One option for consideration.

SE38 to be forbidden for all users (General Best Practice)

All Z Programs to have a Z Transaction Code.

Then you can limit the access...as for the human readible bit...I'd have to do some more digging around.

Either way I think there's quite a bit of effort to achieve your desired result.

Regards

Arden

Former Member
0 Kudos

There is NO WAY anyone with clear mind will create transactions for unused reports

former_member195402
Active Contributor
0 Kudos

Hi Anatoliy,

I want to tell you also the way we lock reports from execution.

We are using an implementation of BADI WORKLOAD_STATISTIC described in SAP note 931446 to fill a custom Z-table with monthly calls of custom programs and the last caller.

If a program hasn't been used for several years, then we make it invalid with a X-message at the beginning or delete it. That depends on the decision of the responsible maintenance team.

This code doesn't work for function modules and groups. But it can be used for RFC function modules, which calls we are also logging in two more Z-tables for incoming and outgoing RFC calls.

Regards,

Klaus

Former Member
0 Kudos

Hi Anatoliy,

For the execution of Reports you can check the following link https://scn.sap.com/thread/768396

probably it will help you.

Regards

0 Kudos

Thanks for advice, but it doesn't fit. SEU00001 is for execution or activation in SE38. But we want to find BADI before execution of a report or function module.

0 Kudos

Check Enhancement "S38MREP1" it will be executed if you execute a report from SE38

Exit: EXIT_SAPLSABE_010

0 Kudos

Thanks a lot, Mark!

S38MREP1 did the trick!

All checks can be in one user exit, awesome!

PS: is there any exit for Function Module builder - SE37?

0 Kudos

You're welcome.

I think this one works for the function module too

0 Kudos

Unfortunately it can check whether SE37 was started, but not when actual function module was executed. Anyway thanks a lot!

former_member186746
Active Contributor
0 Kudos

Hi Anatoliy,

A colleague of mine faced a similar problem, His approach was to change all old Z* programs and transactions to Y*. Then used an ad hoc approach whenever a user issued an urgent issue that transaction X was missing then he changed that back to Z.

After about a year he simply deleted all Y stuff on the systems.

Kind regards, Rob Dielemans

0 Kudos

Hello Rob, thanks for advice.

But I suppose your collegue didn't have 3000 unused Z reports as we do

0 Kudos

It was around a thousand or so.

In any case it is difficult to monitor if something is used or not, maybe solution manager has some tools for that.

You can do something with STAD maybe do a daily/hourly download of Z* transactions and then after 6 months change all unused transaction to Y or lock it and see if someone complains.

this will at least remove a lot of clutter from the system.

Kind regards, Rob Dielemans