Disabling the Download Option in LIST

To disable the list download option in the menu (System Menu). 

It would be easy to do the same in the menu named 'List' of the report, but a little bit more effort is required to do the same in the menu System -> List -> Save... 
 

Create your own gui status and attach it to the list in the event START-OF-SELECTION. 

In the menu painter extra -> adjust template. 

Make it a list status and you will see all the standard list options appear including list->download 

Deactivate the ones you don't want. 
 

If you just want to prevent users from downloading the list you can achieve this with authorization object S_GUI, activity 61. Menu option will still be there though.

Please note that if you remove authorisation for S_GUI activity 61 then all downloads will not be possible. 
 

If you just want to disable downloads only for a particular report, you can try this test program: 

Code: 

REPORT ztest. 
  DATA: PROGNAME LIKE SY-CPROG value 'Z_CHECK_AUTH', 
        FORMNAME LIKE SY-XFORM value 'F_CHECK_AUTH'. 

START-OF-SELECTION. 
    CALL FUNCTION 'SET_DOWNLOAD_AUTHORITY' 
         EXPORTING 
              FORM    = FORMNAME 
              PROG    = PROGNAME 
         EXCEPTIONS 
              OTHERS  = 1. 

  WRITE: / 'TEST'. 

You also need this: 

Code: 

PROGRAM z_check_auth. 

FORM f_check_auth USING pe_result TYPE i. 
  pe_result = 5. 
ENDFORM. 

Also have a look at the exit SGRPDL00. 

Prevent printing or downloading report output

-----Original Message-----
Subject: Prevent printing or downloading report output

Hi, 
There is a challenging request to prevent printing or downloading certain (confidential)
abap report output. Every sap screen has System menu with Print and Save options. How
can I switch them off? 
Thank you for your help, 

-----Reply Message-----
Subject: RE: Prevent printing or downloading report output

We had the same requirement and decided to email the reports to the individuals that
were to see the report. We created a table of email addresses, which in turn, created a
method for security.

-----Reply Message-----
Subject: RE: Prevent printing or downloading report output

1. The printing of the report can be checked by granting/revoking authorization via the
   authorization object 'S_SPO_DEV' & ID being the printer device name. The check is
   internally being carried out when you try to print from any screen. 
   For example:- 
   Code:

            AUTHORITY-CHECK OBJECT 'S_SPO_DEV' 
                 ID     'SPODEVICE' FIELD  TSP03L-LNAME. 

2. The downloading of the report can also be prevented on similar lines by checking the
   authorization object 'S_GUI'. 
   For example:- 
   Code:
            AUTHORITY-CHECK OBJECT 'S_GUI' 
                 ID 'ACTVT' FIELD '61'. 

   If the program is a custom object (Z), then all the checks can be effected using the SY-UCOMM check for Print (%PRI)
   and Download (%PC). 
   I agree with the contributor that the Z table could be designed to hold the valid userids but my question to him/her
   is that how would you stop background users from printing/downloading the reports. Generally the background jobs
   occur via a generic userid, say, BATCH, which is so generic that you would also need a special background userid, say,
   BATCH1, who would be authorized to do these for background jobs. 

   Hope this helps... 

   "Skill is fine, and genius is splendid, but right contacts are more valuable than either. " 
   --Archibald McIndoe

-----Reply Message-----
Subject: RE: Prevent printing or downloading report output

Depends on how many holes you want to close. 
There are more than you think and the effort is mostly not worth it. 
Anything a user can see on a PC can be copied no matter what you do in SAP. You're just
making it a little harder and at you have no audit trail. 
eg a simple print screen utility bypasses anything as does having a local printer with
SAPLPD plus other functions.

-----Reply Message-----
Subject: RE: Prevent printing or downloading report output

Hi, 
...using AUTHORITY-CHECK we can switch ON/OFF user's ability to print or download
generally in SAP system. 
What I need to do is to control it on User/Report level. Unfortunately AT USER-COMMAND
does NOT work on system functions , which are executed directly by the system and thus 
cannot be processed by programs including system commands SY-UCOMM = '%...' 

Anybody...any suggestion...please?

-----Reply Message-----
Subject: RE: Prevent printing or downloading report output

Hi, 

You can restrict the call to the Auth-Check only for the report & then perhaps a list of users
(ZTable entries would help). 

Code:

IF sy-Cprog = 'XYZ'. " <-- VALID PROGRAM CHECK. 
* ALSO CHECK FOR VALID USER.....HERE 

*******CHECK IF THE USER IS PERMITTED TO PRINT. 
AUTHORITY-CHECK OBJECT 'S_SPO_DEV' 
           ID     'SPODEVICE' FIELD  TSP03L-LNAME.

  IF sy-subrc <> 0. 
* SHOUT HERE THAT THE USER IS NOT PERMITTED TO PRINT.. 
     EXIT. 
  ENDIF. 

*******CHECK IF THE USER IS PERMITTED TO DOWNLOAD. 

  AUTHORITY-CHECK OBJECT 'S_GUI' 
           ID 'ACTVT' FIELD '61'. 

  IF sy-subrc <> 0. 
* SHOUT HERE THAT THE USER IS NOT PERMITTED TO DOWNLOAD. 
    EXIT. 
  ENDIF. 
ENDIF. 

Thanks, 

-----Reply Message-----
Subject: RE: Prevent printing or downloading report output

Hi, 
Guys, thanks for your help. The download portion is solved: there is a Customer-function to
use in LGRAPU08....The print is still to go.... I need to let all users to run all of our 'Z'
reports, but when they want to print from SYSTEM menu, that's when I need to decide
whether to allow or prevent printing.... Chaps, where would you put the

AUTHORITY-CHECK? 

Thanks,

-----Reply Message-----
Subject: RE: Prevent printing or downloading report output

Hi, 

I presumed you would be creating your own Pf-status and then trapping this action 

-----Reply Message-----
Subject: RE: Prevent printing or downloading report output

Hi, 

The only way to do it would be to define your own PF Status and fiddle around with the
printing and Save options. 

regards, 

-----Reply Message-----
Subject: RE: Prevent printing or downloading report output

Guys, again thanks for your help, 
The first thing was to create my own PF-status and deactivate '%PRI'. This makes print icon
inactive on the ok code line, but in System menu the Print option remains active.... Looks
like we have no control over print function in System menu. 
Thanks, 

-----Reply Message-----
Subject: RE: Prevent printing or downloading report output

In order to prevent the System menu from being part of your program you will need to
create a specific menu status (via SE41), and from there you can deactivate / activate any
functions you require. 

Kind Regards 

-----Reply Message-----
Subject: RE: Prevent printing or downloading report output

You'll probably also need to prevent running the report in background. Otherwise a user
could just retrieve the output from the spool and print or download away. 

You should be able to do this in the AT SELECTION-SCREEN event. Just check SY-UCOMM --
you'll only want to allow ONLI. 

-----End of Message-----

Fast Links:
BDC program examples:
Auto Disallowed Back Posting to Previous Period

Get help for your ABAP problems
Do you have a ABAP Question?

SAP Books
SAP Certification, Functional, Basis Administration and ABAP Programming Reference Books

ABAP Programming Tips
ABAP and Samples Program Codes for Abapers

Best regards,
SAP Basis, ABAP Programming and Other IMG Stuff
http://www.erpgreat.com

All the site contents are Copyright © www.erpgreat.com and the content authors. All rights reserved.
All product names are trademarks of their respective companies.  The site www.erpgreat.com is in no way affiliated with SAP AG. 
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk. 
 The content on this site may not be reproduced or redistributed without the express written permission of 
www.erpgreat.com or the content authors.