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

Lock a particular ABAP Program from running by developers.

Former Member
0 Likes
1,803

Hi All,

Need advice. Is it possible to lock a particular ABAP "Z" program (no transaction code was tied to it) from running in PRD via SA38, SE38, SE80.

Background is that we have a few users who have access to SA38 and a few developers with SE38 in PRD and I have a few customized utility program which I want to stop these users from accidently running directly.

I was wondering if there are some aettings or authorization objects that I can set to prevent them from running the few programs but still allowed to run other programs.

Any help is greatly appreciated.

Thanks & Best Regards,

Wilson.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,418

Hi Wilson.

Assign a transaction code (for example Z_MY_TCODE)  to this report in SE93 and add the following lines after INITIALIZATION.

IF sy-tcode NE 'Z_MY_TCODE'.
  MESSAGE A000(38) WITH 'Program must be started via transaction Z_MY_TCODE'.

ENDIF.

Authority for TCODE Z_MY_TCODE should be given only to users, who should be allowed to start the program.

Regards,

Klaus

11 REPLIES 11
Read only

Former Member
0 Likes
1,418

you need to use the authorization object under program attributes data, and then the security can use that value to set permissions

Read only

0 Likes
1,418

Hi,

Thanks you for your fast response. May I know which is the exact authorization object to set ? Does it still work if the program does not have "Authority-check" in place ? Somehow some of our utility programs were create "free for all"...

Any help is greatly appreciated.

Thanks & Best Regards,

Wilson.

Read only

Former Member
0 Likes
1,418

This message was moderated.

Read only

gurunathkumar_dadamu
Active Contributor
0 Likes
1,418

Hi Wilson,

We need to create the authorization object and define the roles for the users. Then use the in reports to allow or not by  'AUTHORITY-CHECK OBJECT' after every programs.

Regards,

Gurunath Kumar D

Read only

0 Likes
1,418

Hi

Yes, but I forgot write - another user is admin and have a access to all (and he sometime remove program, query, right or... for user). Then authority-check will not working for him. When I programing in LabView, this environment had a ability used "password", who permit access to source code.

In ABAP i hoped, using DEV-key or...?

Regards

Read only

Former Member
0 Likes
1,419

Hi Wilson.

Assign a transaction code (for example Z_MY_TCODE)  to this report in SE93 and add the following lines after INITIALIZATION.

IF sy-tcode NE 'Z_MY_TCODE'.
  MESSAGE A000(38) WITH 'Program must be started via transaction Z_MY_TCODE'.

ENDIF.

Authority for TCODE Z_MY_TCODE should be given only to users, who should be allowed to start the program.

Regards,

Klaus

Read only

Former Member
0 Likes
1,418

Hi Wilson,

1st way Goto --> Program Attributes --> Tick the checkbox for Editor Lock


2nd way Use BAPI_USER_LOCK

Provide user id and it will lock the user.



Best Regards,

Praveen Srivastava

Read only

Former Member
0 Likes
1,418

This message was moderated.

Read only

Former Member
0 Likes
1,418

thank you all

Read only

Former Member
0 Likes
1,418

Hi, in your report, check value of T000-CCCATEGORY for your client. see search help for the field for possible entries

in the beginning of your report:

SELECT CCCATEGORY FROM T000 INTO LV_CCCATEGORY WHERE MANDT = SY-MANDT.....

if LV_CCCATEGORY EQ 'P'.

  die_my_report_die.

endif.

Read only

Former Member
0 Likes
1,418

Hi

I again thinking about lock. I will test on a SY-UNAME (where name I hide to ascii value).

When condition will be TRUE can stop program but especially.

I need a part of code who is a syntactic correct, but when jump to condtion give a runtime error. I don't want use error message (because everyone know program will be stoped). When I use code with runtime error (it was how I bad create program)

Regards