Introduction to ABAP ABAP Exercises
Exercise
Chapter 12
Introduction to ABAP ABAP Exercises
Exercise (Chapter 12):
In this exercise, you will write a program to help you to understand authority objects.
Objectives
After completing this exercise, you will be able to:
 Understand when to use an authority object.
Estimated time to complete this exercise: 45 minutes
Exercises
This exercise provides practice working with the concepts learned in Chapter 12.
Exercise 1
Name your program YIN018_XX. This program will check to make sure that the user has
proper authority to perform the activities (e.g., create, change, display, and delete) on
vendor master records. The activity should be entered as a parameter. This parameter
should be a length 2 numeric character field.
Some of the valid activities on the customer master records are:
01 - create
02 - change
03 - display
06 - mark for deletion
The appropriate authority object for this authorization check is “F_KNA1_APP”. This
authority object has two fields:
ACTVT (activity)
APPKZ (application)
You should suppress the check for the “APPKZ” field. The check for the “ACTVT” field
should be on the activity parameter.
To code the “AUTHORITY-CHECK OBJECT” statement, use the menu path “Edit
> Insert statement” (or the ‘Pattern’ pushbutton). You need to enter the name of the
authority object in the “Authority-Check” field and the system will automatically code
the appropriate “AUTHORITY-CHECK OBJECT” statement. By using this method, you
cannot make a mistake typing in the proper authority object name and field names.
The report generated by this program is simple. The line written to the report will indicate
whether the authority for the selected activity was passed or failed. See the sample output
for the content and layout of the report in both scenarios.
Introduction to ABAP ABAP Exercises
Although the processing logic of this program is not complex, imagine this authority
check being used in a program that is maintaining vendor master records. Without the
authority check, any user executing the program may be able to change or delete records.
If the authority check fails, a message should appear, “You do not have the authority for
activity XX (authority number)”.