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

Debugger

Former Member
0 Likes
829

IS there any system variable which give me information about the Debugger.

In one report I wanted to include one check ,that no body will able to debug the program.

I wanted to put condition like

if Debugger = ON

Display Error message.

Endif.

Please let me know how can I achieve this.

Aman

7 REPLIES 7
Read only

Former Member
0 Likes
796

sy-debug, but this is marked for internal use by SAP only.

Read only

Former Member
0 Likes
796

Hi you can use SY-DEBUG, but it will not stop you from debugging but based on this you bypass the control. Check below sample code

REPORT ZSATYATEST .

start-of-selection.

data: i type c.

i = 'A'.

<b> if sy-debug is initial.</b>

write ' No Debugging'.

else.

if i = 'A'.

write : / 'A'.

endif.

endif.

Change if sy-debug is initial with if not sy-debug is initial.

Cheers,

Satya

Read only

0 Likes
796

You can do that, but if there smart enough to thru it in debug mode, then they are smart enough to get passed the check by changing the value of it.

Regards,

RIch HEilman

Read only

0 Likes
796

In our system, sy-debug is initial both in debug and non-debug modes. But you can change it. Probably best to leave it, as it says, for SAP internal use.

Rob

Read only

Former Member
0 Likes
796

Same in our system. SY-DEBUG is not set even in debug mode.

If you don't want certain users to have debug access, you can have basis/security do it.

At our place, by default debug access is switched off except for certain users (developers,programmers).

That would be a better approach.

Read only

Former Member
0 Likes
796

Hi Amandeep,

It is not an good idea to not let people to debug the code or part of code. But if you have valid business requirement, there are several ways.

(1) If you are upto 4.6C, you can put that part of the code in MACRO. Macros can not be debugged during program execution.

(2) You can create separate report/function module for that part and call that as background job. It is possible to debug background job, but if the code is very small, it is not easy.

I hope it help.

Sharad Ag

Read only

0 Likes
796

Hi Amandeep,

Did your try any of the solutions ?