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

Report hiding

Former Member
0 Likes
488

hi all,

i've developed one report, i want to hide my report, i mean other developer shouldn't have a authorization to view my report, how to do this

regards

Suprith

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
466

hai Suprith,

Go With This Code.

******************************************

  • This program hides any ABAP's source code and protects it with a

  • password in this source code.

*

  • After hiding, you can still run the abap (the load version is intact)

  • but it cannot be displayed, edited, traced, transported or generated.

*

  • If the ABAP is not hidden, the program hides it, if it is hidden, it

  • unhide it.

  • Remember to hide this program first!

************************************************************************

selection-screen begin of block block.

parameters: program(30) obligatory.

selection-screen begin of line.

selection-screen comment 1(8) pwd.

selection-screen position 35.

parameters: password(8) modif id aaa.

selection-screen end of line.

selection-screen end of block block.

*

data: message(60) type c.

*

at selection-screen output.

loop at screen.

if screen-group1 = 'AAA'.

screen-invisible = '1'.

modify screen.

endif.

endloop.

*

initialization.

pwd = 'Password'.

*

start-of-selection.

tables: trdir.

  • User name and password check

if password <> 'ABCDEFG'.

write: / 'Wrong password'.

exit.

endif.

  • SAP owned?

if not program cp 'Z' and not program cp 'Y'.

write: / 'Do not hide original SAP programs!'.

exit.

endif.

  • Exists?

select single * from trdir where name = program.

if sy-subrc <> 0.

write: / 'Program does not exists!'.

exit.

endif.

  • Does it have a current generated version?

data: f1 type d, f3 type d.

data: f2 type t, f4 type t.

EXEC SQL.

SELECT UDAT, UTIME, SDAT, STIME INTO :F1, :F2, :F3, :F4 FROM D010LINF

WHERE PROG = :PROGRAM

ENDEXEC.

if f1 < f1 =" f3" new_name =" program." i =" sy-index" j =" 0." j =" j" j =" 1." new_name =" program."> 1.

write: / 'Cannot generate appropriate program name'.

exit.

endif.

  • Check if it is already hidden

data: f5(30).

EXEC SQL.

SELECT PROG INTO :F5 FROM D010S WHERE PROG = :NEW_NAME

ENDEXEC.

if f5 is initial.

  • There is no such hidden program, hide it

EXEC SQL.

UPDATE D010S SET PROG = :NEW_NAME WHERE PROG = :PROGRAM

ENDEXEC.

concatenate 'Program' :program 'was hidden.'

into message separated by space.

else.

  • There is already a hidden program there, unhide it

EXEC SQL.

UPDATE D010S SET PROG = :PROGRAM WHERE PROG = :NEW_NAME

ENDEXEC.

concatenate 'Program' :program 'was restored.'

into message separated by space.

endif.

write message

hi all,

i've developed one report, i want to hide my report, i mean other developer shouldn't have a authorization to view my report, how to do this

regards

Suprith

2 REPLIES 2
Read only

dhruv_shah3
Active Contributor
0 Likes
466

Hi,

Use the Authority-Check statement in your report

and check for the users who are not authorized to view your report.

Hope this helps,

Regards,

Dhruv Shah

Read only

Former Member
0 Likes
467

hai Suprith,

Go With This Code.

******************************************

  • This program hides any ABAP's source code and protects it with a

  • password in this source code.

*

  • After hiding, you can still run the abap (the load version is intact)

  • but it cannot be displayed, edited, traced, transported or generated.

*

  • If the ABAP is not hidden, the program hides it, if it is hidden, it

  • unhide it.

  • Remember to hide this program first!

************************************************************************

selection-screen begin of block block.

parameters: program(30) obligatory.

selection-screen begin of line.

selection-screen comment 1(8) pwd.

selection-screen position 35.

parameters: password(8) modif id aaa.

selection-screen end of line.

selection-screen end of block block.

*

data: message(60) type c.

*

at selection-screen output.

loop at screen.

if screen-group1 = 'AAA'.

screen-invisible = '1'.

modify screen.

endif.

endloop.

*

initialization.

pwd = 'Password'.

*

start-of-selection.

tables: trdir.

  • User name and password check

if password <> 'ABCDEFG'.

write: / 'Wrong password'.

exit.

endif.

  • SAP owned?

if not program cp 'Z' and not program cp 'Y'.

write: / 'Do not hide original SAP programs!'.

exit.

endif.

  • Exists?

select single * from trdir where name = program.

if sy-subrc <> 0.

write: / 'Program does not exists!'.

exit.

endif.

  • Does it have a current generated version?

data: f1 type d, f3 type d.

data: f2 type t, f4 type t.

EXEC SQL.

SELECT UDAT, UTIME, SDAT, STIME INTO :F1, :F2, :F3, :F4 FROM D010LINF

WHERE PROG = :PROGRAM

ENDEXEC.

if f1 < f1 =" f3" new_name =" program." i =" sy-index" j =" 0." j =" j" j =" 1." new_name =" program."> 1.

write: / 'Cannot generate appropriate program name'.

exit.

endif.

  • Check if it is already hidden

data: f5(30).

EXEC SQL.

SELECT PROG INTO :F5 FROM D010S WHERE PROG = :NEW_NAME

ENDEXEC.

if f5 is initial.

  • There is no such hidden program, hide it

EXEC SQL.

UPDATE D010S SET PROG = :NEW_NAME WHERE PROG = :PROGRAM

ENDEXEC.

concatenate 'Program' :program 'was hidden.'

into message separated by space.

else.

  • There is already a hidden program there, unhide it

EXEC SQL.

UPDATE D010S SET PROG = :PROGRAM WHERE PROG = :NEW_NAME

ENDEXEC.

concatenate 'Program' :program 'was restored.'

into message separated by space.

endif.

write message