0% found this document useful (0 votes)
6 views12 pages

Chapter 12 - Authorizations Passing Data Between Programs Catching Runtime Errors

The document outlines the objectives and key concepts related to authorizations, data passing between programs, and error handling in SAP. It covers the use of Authority objects, AUTHORITY-CHECK statements, EXPORT and IMPORT statements, and catching runtime errors. Additionally, it includes practical demonstrations and questions to reinforce understanding of the material.

Uploaded by

Aniruddha_Ghosh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views12 pages

Chapter 12 - Authorizations Passing Data Between Programs Catching Runtime Errors

The document outlines the objectives and key concepts related to authorizations, data passing between programs, and error handling in SAP. It covers the use of Authority objects, AUTHORITY-CHECK statements, EXPORT and IMPORT statements, and catching runtime errors. Additionally, it includes practical demonstrations and questions to reinforce understanding of the material.

Uploaded by

Aniruddha_Ghosh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 12

IBM Global Services

Authorizations, Passing Data Between Programs, Catching Runtime


Errors

Authorizations, Passing Data Betwee Dec-2008 © 2005 IBM Corporation


n Programs, Catching Runtime Error
s|
IBM Global Services

Objectives

 The participants will be able to:


 Use Authority objects in SAP.
 Use Authority-Check Statements.
 React to the result of Authority-Check statement.
 Use the EXPORT statement.
 Use the IMPORT statement.

2 Authorizations, Passing Data Between Programs, Catching Runti Dec-2008 © 2005 IBM Corporation
me Errors |
IBM Global Services

Authority Objects in SAP

3 Authorizations, Passing Data Between Programs, Catching Runti Dec-2008 © 2005 IBM Corporation
me Errors |
IBM Global Services

The AUTHORITY-CHECK Statement

AUTHORITY-CHECK OBJECT ‘S_DEVELOP’


ID ‘DEVCLASS’ FIELD ‘YLJS’
ID ‘OBJTYPE’ DUMMY
ID ‘OBJNAME’ DUMMY
ID ‘P_GROUP’ DUMMY
ID ‘ACTVT’ DUMMY.

The option DUMMY


The AUTHORITY-CHECK
suppresses the check for
lists the fields to be checked
the specified field. The net
and verifies what the user is
effect is that the user can
attempting to do against what
perform any activity on Package
the user is authorised to do.
YLJS.

4 Authorizations, Passing Data Between Programs, Catching Runti Dec-2008 © 2005 IBM Corporation
me Errors |
IBM Global Services

Reacting to the AUTHORITY-CHECK Statement

AUTHORITY-CHECK OBJECT ‘S_DEVELOP’


ID ‘DEVCLASS’ FIELD ‘YLJS’
ID ‘OBJTYPE’ DUMMY
ID ‘OBJNAME’ DUMMY
ID ‘P_GROUP’ DUMMY
ID ‘ACTVT’ DUMMY.
IF SY-SUBRC <> 0.
WRITE: / ‘You are not authorised to development’,
‘class YLJS.’.
EXIT.
ENDIF.

5 Authorizations, Passing Data Between Programs, Catching Runti Dec-2008 © 2005 IBM Corporation
me Errors |
IBM Global Services

The EXPORT Statement

EXPORT EXPORT
KNA1-KUNNR SY-SUBRC
KNA1-BUKRS TO MEMORY
TO MEMORY. ID ‘LJS1’.

6 Authorizations, Passing Data Between Programs, Catching Runti Dec-2008 © 2005 IBM Corporation
me Errors |
IBM Global Services

The IMPORT Statement

IMPORT <variable name>


FROM MEMORY.

7 Authorizations, Passing Data Between Programs, Catching Runti Dec-2008 © 2005 IBM Corporation
me Errors |
IBM Global Services

Catching Runtime Errors

CATCH SYSTEM-EXCEPTIONS
ARITHMETIC_ERRORS = 5
CONVERSION_ERRORS = 6.
[…..]
ENDCATCH.

8 Authorizations, Passing Data Between Programs, Catching Runti Dec-2008 © 2005 IBM Corporation
me Errors |
IBM Global Services

Completing the CATCH Code

DATA: int type I,


char(3) type C value ‘ABC’.
[…..]
CATCH SYSTEM-EXCEPTIONS
CONVERSION_ERRORS = 1.
[…..]
MOVE char TO int. “MOVE keyword to trigger CATCH
[…..]
ENDCATCH.

IF SY-SUBRC = 1.
WRITE: / ‘Conversion error has occurred’.
ENDIF.

9 Authorizations, Passing Data Between Programs, Catching Runti Dec-2008 © 2005 IBM Corporation
me Errors |
IBM Global Services

Demonstration

 Creation of a simple program where an authority check object is used to allow


only certain users to perform an activity.

10 Authorizations, Passing Data Between Programs, Catching Runti Dec-2008 © 2005 IBM Corporation
me Errors |
IBM Global Services

Practice

 Creation of a simple program where an authority check object is used to allow


only certain users to perform an activity.

11 Authorizations, Passing Data Between Programs, Catching Runti Dec-2008 © 2005 IBM Corporation
me Errors |
IBM Global Services

Questions

 What is the maximum number of authorization fields in an authority object?


 Discuss different type of activities an authorization object may have.

12 Authorizations, Passing Data Between Programs, Catching Runti Dec-2008 © 2005 IBM Corporation
me Errors |

You might also like