Protect Selection/Parameters

An easy way of making a standard reports selection/parameters to be read-only/protected.  (like an option NO-INPUT).

You can add a "Module Protect Output." module with code to the program, where it sets the screen-input = 0 as required, and add the line  "Module Protect Output." to the PBO, and it works fine, until you re-generate the code and
this line is removed (the PBO PAI in SE51 screen 1000)  as known, this code is also re-generated and any changes made will be ineffective.

If you tried using one of the PBO generated module names, it will says its does not exist, so if you generate it with the code, and run the program  it will tell you "Module PBO_REPORT is already defined as a OUTPUT module".

The purpose: To calculate and set up the parameters in INITIALIZATION. You want to show them to the user, and use them in SELECTs, use them as Headings, but you want to stop the user from changing some of them.

The solution is as follows :

AT SELECTION-SCREEN OUTPUT.
  PERFORM protect.
.
.
.
FORM protect.
LOOP at SCREEN
 CASE screen-name.
     WHEN 'UNAME' OR 'UNUMB' OR 'DESCR'. screen-input = 0.
     WHEN 'XNAME' OR 'XNUMB' OR 'DESCX'. screen-input = 0.
ENDCASE.
ENDLOOP.
ENDFORM.

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

ABAP Books
ABAP Certification, BAPI, Java, Web Programming, Smart Forms, Sapscripts Reference Books

More ABAP Tips

Main Index
SAP Basis, ABAP Programming and Other IMG Stuff

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.