Quantcast
Channel: SCN : All Content - Web Dynpro ABAP
Viewing all articles
Browse latest Browse all 3667

How to handle custom authorization checks in Web Dynpro ABAP - Part 1

$
0
0

Purpose:

Application to demonstrate handling the custom authorization checks in Web Dynpro ABAP

 

Scenario:

I would like to explain the functionality of handling the custom authorizations in Web Dynpro ABAP.

 

Process:

Here, the authorized users list along with roles have been maintained in the custom table and WDA application should check the user against the table entries and respond accordingly.

 

Process is divided as below

  1. Create a custom table YTR_AUTH_CHECK
  2. Generate the maintenance view & maintain the entries in the table
  3. Create an assistance class YCL_RK_AUTHORIZATIONS and methods to get data from table
  4. Create Webdynpro ABAP component

 

Pre-requisite:

Basic knowledge of Webdynpro ABAP, Data dictionary& OO ABAP

 

Step by step Process

 

1. Create a custom table : YTR_AUTH_CHECK

Go to t-code SE11 and enter table name as YTR_AUTH_CHECK and click on create button ( F5)  as below


Step 1:

Maintain the table "Delivery & Maintenance " data as below

t1.PNG

 

Step 2:

Set the technical settings as below

t2.PNG

Step 3

Create domain for ROLE as below

t4.PNG

 

Set the range values as below

t4_1.PNG

Step 4:

Create data element for ROLE as below

t3.PNG

t3_1.PNG

Step5:

Create the table fields as below

t5.PNG

2. Generate the maintenance view & maintain the entries in the table

Now, we need to generate the table maintenance for table YTR_AUTH_CHECK

 

Step1:

 

Go to menu : Utilities---> Table Maintenance Generator as below

t6.png

Choose the authrozation group and create a function group and click on create button as below

t6_1.PNG

Step 2:

Go to t-code SM30 and choose the maintenance view YTR_AUTH_CHECK and Maintain the table entries as below

t6_4.PNG

 

 

 

3. Create an assistance class YCL_RK_AUTHORIZATIONS and methods to get data from table

 

Step1:

 

Go to t-code se24, create the class YCL_RK_AUTHORIZATIONS & enter the super class CL_WD_COMPONENT_ASSISTANCE as below

c1_1.PNG

Step3:

Create global constants for each role as below

c1_2.PNG

Step4:

Create a method GET_USER_DATA as below

c2.PNG

Step5:

Create the method parameter ES_RESULT as below

c3.PNG

Step6:

Write the below logic to get user data from table

c4.PNG

 

 

 

Continued.......

 

How to handle custom authorization checks in Web Dynpro ABAP - Part 2


Viewing all articles
Browse latest Browse all 3667

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>