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

Restricting debugging of a program

Former Member
0 Likes
2,295

Hi all,

Is it possible to restrict debugging of any program by any developer or somebody else.

Thanks in advance.

1 ACCEPTED SOLUTION
Read only

sreeramkumar_madisetty
Active Contributor
1,640

Hi

While executing the report by writing the code in the report as

if sy-user = (u and what ever u required).

allow.

else.

break user.

endif.

Hope it will work by breaking the other users.

Here they are not able to run ur report.

Regards,

kumar

10 REPLIES 10
Read only

Former Member
0 Likes
1,640

Hi Raja,

By authorization you can restrict the debugging and also not changing the values while debugging

Regards

Arun

Read only

Former Member
0 Likes
1,640

hi

good

if a programmer is debugging a program and he can stop debugging by selection file->stop debugging

Thanks

mrutyun^

Read only

Former Member
0 Likes
1,640

What I meant was would there be any setting to restrict debugging of a program to any developer or any end user. By default, all the programmers are assigned with the debugging authorization in our organization

Read only

0 Likes
1,640

hi

good

I dont think there is any such setting which ll block the debugging the program,

thanks

mrutyun^

Read only

0 Likes
1,640

I am not sure if that is possible. You just have to remove the authority. Why do you want to do this?

Read only

0 Likes
1,640

Hi raja,

1. If it is our Z Program,

2. Then in ATTRIBUTES,

we can specify STATUS = SYSTEM

3. Such program having this status, cannot be Debugged.

regards,

amit m.

Read only

Former Member
0 Likes
1,640

Hi,

I believe you cannot restrict debugging access to a single program..Instead the debugging authorization can be removed..WHich means the user can no longer debug any program..

THanks,

Naren

Read only

sreeramkumar_madisetty
Active Contributor
1,641

Hi

While executing the report by writing the code in the report as

if sy-user = (u and what ever u required).

allow.

else.

break user.

endif.

Hope it will work by breaking the other users.

Here they are not able to run ur report.

Regards,

kumar

Read only

1,640

Call TH_RESET_DEBUGGING in your AT SELECTION-SCREEN. If someone is debugging they can go as far as this call and after that they will be thrown out. This will work only if someone is debuggin using '/h'. But if someone puts a soft breakpoint on some line of the code and then executes the program, this will not stop it if that breakpoint is after the call.

To stop this kind of debugging, you can use another function module SYSTEM_DEBUG_BREAKPOINTS which will give you all the soft breakpoints set in the program. So if there are entries, you can then quit.

If the program has BREAK-POINT in it, then you cannot do anything.

Here is a small program

REPORT  zakstest1.

DATA: BEGIN OF breakpoints OCCURS 0.
        INCLUDE STRUCTURE  breakpoint.
DATA: END OF breakpoints.

PARAMETER: p_check AS CHECKBOX.

AT SELECTION-SCREEN.

  CALL FUNCTION 'TH_RESET_DEBUGGING'
    EXCEPTIONS
      no_authority = 1
      OTHERS       = 2.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.

START-OF-SELECTION.

  CALL FUNCTION 'SYSTEM_DEBUG_BREAKPOINTS'
    EXPORTING
      main_program          = 'ZAKSTEST1'
*    IMPORTING
*      flag_system_debugging = flag_system_debugging
*      flag_exception_object = flag_exception_object
    TABLES
      breakpoints           = breakpoints
    EXCEPTIONS
      c_call_error          = 1
      OTHERS                = 2.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.

  IF breakpoints[] IS NOT INITIAL.
*-- there is at least one soft breakpoint set
    MESSAGE s056(14) WITH 'You cannot debug this program'.
    STOP.
  ENDIF.

  IF p_check = 'X'.
    WRITE:/ 'The box is checked'.
  ELSE.
    WRITE:/ 'The box is not checked'.
  ENDIF.

Read only

Former Member
0 Likes
1,640

Hi Amit,

By setting the status to system..We can still debug using the system debugging..option..Right??

Thanks

Naren