Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

abt authorisation check

Former Member
0 Likes
1,952

how do we do authorisation Check and what is m_iseg_wm_iseg_wib

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,694

hi...

go through this hope it ll help you to give some idea about the authorization check.

A programmer wants to make an authorization check before bookings for business customers can be changed.

To do this, the programmer should create authorization fields (ACTVT and CUSTTYPE) and assign for each field defined the value to be checked (02, B). Authorization fields are created under Tools ® ABAP Workbench ® Development ® Other tools ® Authorization objects ® Fields (transaction SU20).

Programmers should also create an authorization object (here S_TRVL_BKS) and assign the authorization object to an object class.

Authorization fields are created under Tools ® ABAP Workbench ® Development ® Other tools ® Authorization objects ® Objects (transaction SU21). Authorization objects can also be created in the Object Navigator (transaction SE80).

You program the authorization check using the ABAP statement AUTHORITY-CHECK.

AUTHORITY-CHECK OBJECT 'S_TRVL_BKS'

ID 'ACTVT' FIELD '02'

ID 'CUSTTYPE' FIELD 'B'.

IF SY-SUBRC <> 0.

MESSAGE E...

ENDIF.

The AUTHORITY-CHECK checks whether a user has the appropriate authorization to execute a particular activity.

When this happens, the system checks the authorization profiles in the user’s master record for the appropriate authorization object (S_TRVL_BKS). If the authorization is found and it contains the correct values, the check is successful.

The system administrator has defined the following authorizations for the authorization object S_TRVL_BKS:

· S_TRVL_CUS1 with the following values:

  • for customer type ( CUSTTYPE field) and

03 for activity (field: ACTVT).

Users with this authorization can display all customer bookings (activity 03 = display).

· S_TRVL_CUS2 with the following values:

B for customer type ( CUSTTYPE) and

02 for activity (ACTVT).

Users with this authorization can change all business customers (activity 02 = change).

When assigning profiles, the system administrator gave different authorizations to different users.

User Miller has been assigned a profile containing both of these authorizations (S_TRVL_CUS1 and S_TRVL_CUS2). Miller can therefore change bookings for business customers.

User Meyers on the other hand, is only authorized to display the records (S_TRVL_CUS1) and therefore cannot change bookings.

Reward points if useful

Regards

Ashu

how do we do authorisation Check and what is m_iseg_wm_iseg_wib

9 REPLIES 9
Read only

Former Member
0 Likes
1,694

Hi

In general different users will be given different authorizations based on their role in the orgn.

We create ROLES and assign the Authorization and TCODES for that role, so only that user can have access to those T Codes.

USe SUIM and SU21 T codes for this.

Much of the data in an R/3 system has to be protected so that unauthorized users cannot access it. Therefore the appropriate authorization is required before a user can carry out certain actions in the system. When you log on to the R/3 system, the system checks in the user master record to see which transactions you are authorized to use. An authorization check is implemented for every sensitive transaction.

If you wish to protect a transaction that you have programmed yourself, then you must implement an authorization check.

This means you have to allocate an authorization object in the definition of the transaction.

For example:

program an AUTHORITY-CHECK.

AUTHORITY-CHECK OBJECT <authorization object>

ID <authority field 1> FIELD <field value 1>.

ID <authority field 2> FIELD <field value 2>.

...

ID <authority-field n> FIELD <field value n>.

The OBJECT parameter specifies the authorization object.

The ID parameter specifies an authorization field (in the authorization object).

The FIELD parameter specifies a value for the authorization field.

The authorization object and its fields have to be suitable for the transaction. In most cases you will be able to use the existing authorization objects to protect your data. But new developments may require that you define new authorization objects and fields.

http://help.sap.com/saphelp_nw04s/helpdata/en/52/67167f439b11d1896f0000e8322d00/content.htm

To ensure that a user has the appropriate authorizations when he or she performs an action, users are subject to authorization checks.

Authorization : An authorization enables you to perform a particular activity in the SAP System, based on a set of authorization object field values.

You program the authorization check using the ABAP statement AUTHORITY-CHECK.

AUTHORITY-CHECK OBJECT 'S_TRVL_BKS'

ID 'ACTVT' FIELD '02'

ID 'CUSTTYPE' FIELD 'B'.

IF SY-SUBRC <> 0.

MESSAGE E...

ENDIF.

'S_TRVL_BKS' is a auth. object

ID 'ACTVT' FIELD '02' in place 2 you can put 1,2, 3 for change create or display.

The AUTHORITY-CHECK checks whether a user has the appropriate authorization to execute a particular activity.

This Authorization concept is somewhat linked with BASIS people.

As a developer you may not have access to access to SU21 Transaction where you have to define, authorizations, Objects and for nthat object you assign fields and values. Another Tcode is PFCG where you can assign these authrization objects and TCodes for a profile and that profile in turn attached to a particular user.

Take the help of the basis Guy and create and use.

<b>Reward points for useful Answers</b>

Regards

Anji

Read only

Former Member
0 Likes
1,694

User Authorization Checks

Definition

The authorization to carry out various archiving object programs is checked by the authorization object S_ARCHIVE. The Archive Development Kit (ADK) performs the check when an archive file is opened for one of the following actions:

· Write

· Delete

· Read

· Reload

Use

The following authorizations can be given per archiving object and solution, (such as mySAP Financials or mySAP Human Resources):

· Everything is allowed

Write, read, and reload archives; execute delete programs; change mode in archive management

· Change mode in archive management

Maintain notes

· Read and analyze archives and display mode in archive management

There may also be additional access authorization checks for specific application components.

See also:

Authorization Checks in Archiving Programs

http://help.sap.com/saphelp_nw04/helpdata/en/8d/3e4e19462a11d189000000e8323d3a/frameset.htm

Read only

Former Member
0 Likes
1,694

Hi ramesh,

Welcome to SDN

Just refer to this link to get the idea about SAP Authorization.

http://help.sap.com/saphelp_nw70/helpdata/en/52/671285439b11d1896f0000e8322d00/content.htm

Regards,

Atish

Read only

Former Member
0 Likes
1,694

hi ,

Authorization Checks

For authorization checks, there are many ways of linking authorization objects with user actions in an R/3 system. The following discusses three possibilities in the context of ABAP programming.

Authorization Check for Transactions

You can directly link authorization objects with transaction codes. You can enter values for the fields of an authorization object in the transaction maintenance. Before the transaction is executed, the system compares these values with the values in the user master record and only starts the transaction if the appropriate authorization exists.

Authorization Check for ABAP Programs

For ABAP programs, the two objects S_DEVELOP (program development and program execution) and S_PROGRAM (program maintenance) exist. They contains a field P_GROUP that is connected with the program attribute authorization group. Thus, you can assign users program-specific authorizations for individual ABAP programs.

Authorization Check in ABAP Programs

A more sophisticated, user-programmed authorization check is possible using the Authority-Check statement. It allows you to check the entries in the user master record for specific authorization objects against any other values. Therefore, if a transaction or program is not sufficiently protected or not every user that is authorized to use the program can also execute all the actions, this statement must be used.

AUTHORITY-CHECK OBJECT 0.

MESSAGE e184(sabapdocu) WITH text-010.

ENDIF.

START-OF-SELECTION.

SELECT carrid connid fldate seatsmax seatsocc

FROM sflight

INTO CORRESPONDING FIELDS OF wa_flights

WHERE carrid = pa_carr.

WRITE: / wa_flights-carrid,

wa_flights-connid,

wa_flights-fldate,

wa_flights-seatsmax,

wa_flights-seatsocc.

ENDSELECT.

In this example, the system checks with the authorization object S_CARRID whether or not the user has a display authorization (03) for the airline entered on a selection screen. If this is not the case, or a different error occurs, the Selection Screen Processing goes back to the display of the selection screen.

regards

reena

Read only

Former Member
0 Likes
1,694

Hai,

To do this, the programmer should create authorization fields (ACTVT and CUSTTYPE) and assign for each field defined the value to be checked (02, B). Authorization fields are created under Tools ® ABAP Workbench ® Development ® Other tools ® Authorization objects ® Fields (transaction SU20).

Programmers should also create an authorization object (here S_TRVL_BKS) and assign the authorization object to an object class.

Authorization fields are created under Tools ® ABAP Workbench ® Development ® Other tools ® Authorization objects ® Objects (transaction SU21). Authorization objects can also be created in the Object Navigator (transaction SE80).

You program the authorization check using the ABAP statement AUTHORITY-CHECK.

AUTHORITY-CHECK OBJECT 'S_TRVL_BKS'

ID 'ACTVT' FIELD '02'

ID 'CUSTTYPE' FIELD 'B'.

IF SY-SUBRC <> 0.

MESSAGE E...

ENDIF.

The AUTHORITY-CHECK checks whether a user has the appropriate authorization to execute a particular activity.

When this happens, the system checks the authorization profiles in the user’s master record for the appropriate authorization object (S_TRVL_BKS). If the authorization is found and it contains the correct values, the check is successful.

The system administrator has defined the following authorizations for the authorization object S_TRVL_BKS:

· S_TRVL_CUS1 with the following values:

  • for customer type ( CUSTTYPE field) and

03 for activity (field: ACTVT).

Users with this authorization can display all customer bookings (activity 03 = display).

· S_TRVL_CUS2 with the following values:

B for customer type ( CUSTTYPE) and

02 for activity (ACTVT).

Users with this authorization can change all business customers (activity 02 = change).

When assigning profiles, the system administrator gave different authorizations to different users.

User Miller has been assigned a profile containing both of these authorizations (S_TRVL_CUS1 and S_TRVL_CUS2). Miller can therefore change bookings for business customers.

User Meyers on the other hand, is only authorized to display the records (S_TRVL_CUS1) and therefore cannot change bookings.

For Authorization Check Program go thru the following Link,

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/9000821b-666a-2910-499a-aaffde14...

Regards,

Padmam.

Read only

Former Member
0 Likes
1,695

hi...

go through this hope it ll help you to give some idea about the authorization check.

A programmer wants to make an authorization check before bookings for business customers can be changed.

To do this, the programmer should create authorization fields (ACTVT and CUSTTYPE) and assign for each field defined the value to be checked (02, B). Authorization fields are created under Tools ® ABAP Workbench ® Development ® Other tools ® Authorization objects ® Fields (transaction SU20).

Programmers should also create an authorization object (here S_TRVL_BKS) and assign the authorization object to an object class.

Authorization fields are created under Tools ® ABAP Workbench ® Development ® Other tools ® Authorization objects ® Objects (transaction SU21). Authorization objects can also be created in the Object Navigator (transaction SE80).

You program the authorization check using the ABAP statement AUTHORITY-CHECK.

AUTHORITY-CHECK OBJECT 'S_TRVL_BKS'

ID 'ACTVT' FIELD '02'

ID 'CUSTTYPE' FIELD 'B'.

IF SY-SUBRC <> 0.

MESSAGE E...

ENDIF.

The AUTHORITY-CHECK checks whether a user has the appropriate authorization to execute a particular activity.

When this happens, the system checks the authorization profiles in the user’s master record for the appropriate authorization object (S_TRVL_BKS). If the authorization is found and it contains the correct values, the check is successful.

The system administrator has defined the following authorizations for the authorization object S_TRVL_BKS:

· S_TRVL_CUS1 with the following values:

  • for customer type ( CUSTTYPE field) and

03 for activity (field: ACTVT).

Users with this authorization can display all customer bookings (activity 03 = display).

· S_TRVL_CUS2 with the following values:

B for customer type ( CUSTTYPE) and

02 for activity (ACTVT).

Users with this authorization can change all business customers (activity 02 = change).

When assigning profiles, the system administrator gave different authorizations to different users.

User Miller has been assigned a profile containing both of these authorizations (S_TRVL_CUS1 and S_TRVL_CUS2). Miller can therefore change bookings for business customers.

User Meyers on the other hand, is only authorized to display the records (S_TRVL_CUS1) and therefore cannot change bookings.

Reward points if useful

Regards

Ashu

Read only

Former Member
0 Likes
1,694

Hi,

You can use authority check for a particular Sales Organization, distribution channel, Division as below,

AUTHORITY-CHECK OBJECT 'V_VBAK_VKO'

ID 'VKORG' FIELD '__________'

ID 'VTWEG' FIELD '__________'

ID 'SPART' FIELD '__________'

ID 'ACTVT' FIELD '__________'.

u can find object in su21. if object it not there u can make it.

http://help.sap.com/saphelp_erp2004/helpdata/en/9f/dbaccb35c111d1829f0000e829fbfe/frameset.htm

<b>Reward points</b>

Regards

Read only

Former Member
Read only

Former Member
0 Likes
1,694

HI

Authorization Check Program

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2006 SAP AG 1

Authorization Check Program Applies to: 4.6c Summary This program creates a report based on: Composite profiles, Single Profiles, Objects, Authorizations, and their Values. Author(s): Aveek Ghose Company: IBM India Created on: 23 August 2006 Author Bio Aveek Ghose has 12 years of IT experience and has worked across the globe in SAP Implementations. Aveek has an MS in Information Systems from George Mason University in USA and a MS in Economics from Virginia Tech in USA and is currently working for IBM India.

Authorization Check Program

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2006 SAP AG 2

*&----


  • *& Report ZCHECKAUTH *& *&--------------------------------------------------------------------

  • REPORT ZAUTHRPT LINE-SIZE 132 NO STANDARD PAGE HEADING MESSAGE-ID ZZ. *-------------------------------------------------------------

  • This program creates a report based on: * Composite profiles, Single Profiles, Objects, * Authorizations and their Values. *----

-


TABLES: USR03, USR04, USR10, USR12, TOBJT, DFIES. SELECT-OPTIONS BNAME FOR USR04-BNAME DEFAULT SY-UNAME. PARAMETERS: DO-EXPRT(1) DEFAULT ' ' NO-DISPLAY. DATA: BEGIN OF INTFIELD OCCURS 10, FIELDNAME LIKE TOBJ-FIEL1, LNG TYPE I, TYPE, FTEXT LIKE DFIES-SCRTEXT_L, CONVEXIT LIKE DFIES-CONVEXIT, END OF INTFIELD. DATA: BEGIN OF TABUSR OCCURS 500, USERID LIKE USR04-BNAME, PROFILE LIKE XU213-PROFILE, END OF TABUSR. DATA: BEGIN OF TABPRO OCCURS 500, USERID LIKE USR04-BNAME, PROFILE LIKE XU213-PROFILE, END OF TABPRO. DATA: BEGIN OF TABAUTH OCCURS 500, USERID LIKE USR04-BNAME, "Userid PROFILE LIKE XU213-PROFILE, "Profile OBJECT LIKE USR12-OBJCT, "Object RULE LIKE USR12-AUTH, "Authorization END OF TABAUTH. DATA: BEGIN OF TABVAL OCCURS 500, USERID LIKE USR04-BNAME, PROFILE LIKE XU213-PROFILE, OBJECT LIKE USR12-OBJCT, RULE LIKE USR12-AUTH, "Authorization SFIELD LIKE TOBJ-FIEL1, "Field Name VON(18), "Value From BIS(18), "Value To USED-IN-REPORT-ALREADY, END OF TABVAL. DATA: MAXUSR TYPE I VALUE 300, MAXCPF TYPE I VALUE 300, MAXPRO TYPE I VALUE 170, PROFLNG LIKE SY-FDPOS VALUE 12, "Profile OBJLNG LIKE SY-FDPOS VALUE 10, "Object AUTHLNG LIKE SY-FDPOS VALUE 12, "Authorization FLDLNG LIKE SY-FDPOS VALUE 10, "Field TEMP-USERID LIKE USR04-BNAME, PREV-OBJECT LIKE USR12-OBJCT, PREV-RULE LIKE USR12-AUTH, "Authorization

Authorization Check Program

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2006 SAP AG 3

PREV-SFIELD LIKE TOBJ-FIEL1, TEMP-PROFILE LIKE XU213-PROFILE, USER-NAME LIKE USR03-NAME1, SYST_LANGUAGE VALUE 'D', USER-DEPT(31), USER-COST-CENTER(31), PREV-PROFILE LIKE XU213-PROFILE. FIELD-SYMBOLS: . START-OF-SELECTION. SELECT * FROM USR04 WHERE BNAME IN BNAME. "Userid PERFORM 100_LOAD_TABUSR. ENDSELECT. SORT TABUSR BY PROFILE ASCENDING USERID ASCENDING. PERFORM 200_PROCESS_PROFILES. PERFORM 400_PROCESS_AUTH_VALUES. SORT TABVAL BY USERID ASCENDING PROFILE ASCENDING OBJECT ASCENDING RULE ASCENDING SFIELD ASCENDING. TEMP-USERID = SPACE. PREV-PROFILE = SPACE. IF DO-EXPRT EQ 'X'. EXPORT TABVAL TO MEMORY ID 'ZAUTHRPT'. ELSE. PERFORM 500_PROCESS_REPORT. ENDIF. END-OF-SELECTION. *----


  • Form 100_LOAD_TABUSR *----------------------------------------------------------------

  • Load internal User Name and Profiles to internal table. *----------------------------------------------------------------

FORM 100_LOAD_TABUSR. DATA: NRPRO TYPE I, OFF TYPE I. OFF = 2. NRPRO = USR04-NRPRO / 12. IF NRPRO > MAXUSR. NRPRO = 0. ENDIF. DO NRPRO TIMES. ASSIGN USR04-PROFS+OFF(PROFLNG) TO TO TABUSR-PROFILE. APPEND TABUSR. OFF = OFF + PROFLNG. ENDDO. ENDFORM. *----


  • Form 200_PROCESS_PROFILES *----

-


Authorization Check Program

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2006 SAP AG 4

  • Get all authorizations based on the profile name. *--------------------------------------------------------------- FORM 200_PROCESS_PROFILES. LOOP AT TABUSR. SELECT * FROM USR10 WHERE PROFN = TABUSR-PROFILE. MOVE TABUSR-USERID TO TEMP-USERID. MOVE TABUSR-PROFILE TO TEMP-PROFILE. PERFORM 250_GET_AUTHORIZATIONS. ENDSELECT. ENDLOOP. SORT TABPRO BY PROFILE ASCENDING USERID ASCENDING. * Process the profiles under the composite profile LOOP AT TABPRO. SELECT * FROM USR10 WHERE PROFN = TABPRO-PROFILE. MOVE TABPRO-USERID TO TEMP-USERID. MOVE TABPRO-PROFILE TO TEMP-PROFILE. PERFORM 250_GET_AUTHORIZATIONS. ENDSELECT. ENDLOOP. ENDFORM. *------------------------------------------------------------- * Form 250_GET_AUTHORIZATIONS *------------------------------------------------------------- * Distinguish between Single and composite profiles *------------------------------------------------------------- FORM 250_GET_AUTHORIZATIONS. CASE USR10-TYP. WHEN 'C'. "Composite Profile PERFORM 260_PROCESS_COMP_PROFILES. WHEN 'S'. "Single Profile PERFORM 280_PROCESS_SINGLE_PROFILES. WHEN OTHERS. EXIT. ENDCASE. ENDFORM. *-----------------------------------------------------------------* * FORM 260_PROCESS_COMP_PROFILES * *-----------------------------------------------------------------* * Composite profiles are loaded to internal table to be * * processed later. * *-------------------------------------------------------------------* FORM 260_PROCESS_COMP_PROFILES. DATA: NRAUT TYPE I, OFF TYPE I. OFF = 2. NRAUT = USR10-NRAUT / 12. "Number of authorizations IF NRAUT > MAXCPF. NRAUT = 0. ENDIF. DO NRAUT TIMES. ASSIGN USR10-AUTHS+OFF(PROFLNG) TO <TEXT>. WRITE <TEXT> TO TABPRO-PROFILE. MOVE TEMP-USERID TO TABPRO-USERID. APPEND TABPRO. OFF = OFF + PROFLNG. ENDDO.

Authorization Check Program

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2006 SAP AG 5

ENDFORM. *----


  • * FORM 280_PROCESS_SINGLE_PROFILES * *--------------------------------------------------------------------

  • * Load all authorizations under a single profile to an internal * * table. * *--------------------------------------------------------------------

  • FORM 280_PROCESS_SINGLE_PROFILES. DATA: NRAUT TYPE I, OFF TYPE I. OFF = 2. NRAUT = USR10-NRAUT / 22. IF NRAUT > MAXPRO. NRAUT = 0. ENDIF. DO NRAUT TIMES. ASSIGN USR10-AUTHS+OFF(OBJLNG) TO <TEXT>. WRITE <TEXT> TO TABAUTH-OBJECT. OFF = OFF + OBJLNG. ASSIGN USR10-AUTHS+OFF(AUTHLNG) TO <TEXT>. WRITE <TEXT> TO TABAUTH-RULE. MOVE TEMP-USERID TO TABAUTH-USERID. MOVE TEMP-PROFILE TO TABAUTH-PROFILE. APPEND TABAUTH. OFF = OFF + AUTHLNG. ENDDO. ENDFORM. *----------------------------------------------------------------

  • Form 400_PROCESS_AUTH_VALUES *----------------------------------------------------------------

  • Load internal table with Userid, Profile, Object, * Authorizations and Values *----------------------------------------------------------------

FORM 400_PROCESS_AUTH_VALUES. LOOP AT TABAUTH. SELECT * FROM USR12 WHERE OBJCT = TABAUTH-OBJECT AND AUTH = TABAUTH-RULE. PERFORM 450_LOAD_TABVALS. ENDSELECT. ENDLOOP. ENDFORM. *----


  • * FORM 450_LOAD_TABVALS * *--------------------------------------------------------------------

  • * NOTE: Search SAPMS01J function FILL_TABUSR * * Must be in workbench. * *----

-


  • FORM 450_LOAD_TABVALS. DATA: INTFLAG TYPE I VALUE 0, OFF TYPE I, VTYP, LNG TYPE I, CLNG(2), GLNG(2). OFF = 2. ASSIGN USR12-VALS+OFF(1) TO <TEXT>. WRITE <TEXT> TO VTYP. WHILE VTYP <> ' ' AND OFF < USR12-LNG. OFF = OFF + 1. CASE VTYP. WHEN 'F'.

Authorization Check Program

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2006 SAP AG 6

OFF = OFF + 5. ASSIGN USR12-VALS+OFF(2) TO TO CLNG. GLNG = CLNG. OFF = OFF + 2. ASSIGN USR12-VALSOFF(LNG) TO <TEXT>. IF INTFLAG = 0. WRITE <TEXT> TO TABVAL-VON. WRITE '*' TO TABVAL-VONGLNG. ELSE. WRITE TO VTYP. ENDWHILE. ENDFORM. *----


  • * FORM 480_PROCESS_MOVES * *--------------------------------------------------------------------

  • * ........ * *--------------------------------------------------------------------

  • FORM 480_PROCESS_MOVES. MOVE TABAUTH-USERID TO TABVAL-USERID. MOVE TABAUTH-PROFILE TO TABVAL-PROFILE. MOVE TABAUTH-OBJECT TO TABVAL-OBJECT. MOVE TABAUTH-RULE TO TABVAL-RULE. ENDFORM. *--------------------------------------------------------------

  • FORM 500_PROCESS_REPORT *--------------------------------------------------------------

  • Create a report *--------------------------------------------------------------

FORM 500_PROCESS_REPORT. LOOP AT TABVAL. AT NEW USERID. NEW-PAGE. SELECT SINGLE * FROM USR03 WHERE BNAME = TABVAL-USERID. IF USR03-NAME1 = SPACE. MOVE 'User Name NOT Available' TO USER-NAME. ELSE. MOVE USR03-NAME1 TO USER-NAME. ENDIF. *----


  • If you want to display the Department comment back in *----

-


  • IF USR03-ABTLG = SPACE. * MOVE 'Users Department NOT Available' TO USER-DEPT. * ELSE. * MOVE USR03-ABTLG TO USER-DEPT. * ENDIF. IF USR03-KOSTL = SPACE. MOVE 'Users Cost Center NOT Available' TO USER-COST-CENTER. ELSE. MOVE USR03-KOSTL TO USER-COST-CENTER. ENDIF. ENDAT. AT NEW PROFILE. WRITE: / TABVAL-PROFILE. ENDAT. AT NEW OBJECT. WRITE: /15 TABVAL-OBJECT. SELECT SINGLE * FROM TOBJT WHERE LANGU = SY-LANGU AND OBJECT = TABVAL-OBJECT. WRITE: 30 TOBJT-TTEXT. SKIP.

Authorization Check Program

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2006 SAP AG 8

ENDAT. IF ( TABVAL-RULE = PREV-RULE ) AND ( TABVAL-OBJECT = PREV-OBJECT ). PERFORM 550-CHECK-PREV-FIELD. ELSE. PERFORM 600-GET_FIELD_NAME. WRITE: /40 TABVAL-RULE, 60 INTFIELD-FTEXT, "Field text 110 TABVAL-VON, "Value From 118 TABVAL-BIS. "Value To MOVE TABVAL-RULE TO PREV-RULE. MOVE TABVAL-OBJECT TO PREV-OBJECT. MOVE TABVAL-SFIELD TO PREV-SFIELD. ENDIF. * BREAK-POINT. ENDLOOP. ENDFORM. *----


  • * FORM 550-CHECK-PREV-FIELD * *--------------------------------------------------------------------

  • * To avoid redundant printing of the field name. * *--------------------------------------------------------------------

  • FORM 550-CHECK-PREV-FIELD. IF TABVAL-SFIELD = PREV-SFIELD. WRITE: /110 TABVAL-VON, "Value From 118 TABVAL-BIS. "Value To ELSE. PERFORM 600-GET_FIELD_NAME. WRITE: /60 INTFIELD-FTEXT, "Field text 110 TABVAL-VON, "Value From 118 TABVAL-BIS. "Value To MOVE TABVAL-SFIELD TO PREV-SFIELD. ENDIF. ENDFORM. *--------------------------------------------------------------------

  • * FORM 600-GET_FIELD_NAME * *--------------------------------------------------------------------

  • * Get the text name using the technical field name * *--------------------------------------------------------------------

  • FORM 600-GET_FIELD_NAME. CALL FUNCTION 'AUTH_FIELD_GET_INFO' EXPORTING FIELDNAME = TABVAL-SFIELD IMPORTING DATEL = DFIES-ROLLNAME LNG = DFIES-OUTPUTLEN * RC = SY-SUBRC TEXT = DFIES-FIELDTEXT TYPE = DFIES-INTTYPE. IF SY-SUBRC <> 0. INTFIELD-FTEXT = TABVAL-SFIELD. IF SY-LANGU <> SYST_LANGUAGE. CALL FUNCTION 'AUTH_FIELD_GET_INFO' EXPORTING FIELDNAME = TABVAL-SFIELD LANGU = SYST_LANGUAGE IMPORTING DATEL = DFIES-ROLLNAME LNG = DFIES-OUTPUTLEN * RC = SY-SUBRC TEXT = DFIES-FIELDTEXT

Authorization Check Program

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2006 SAP AG 9

TYPE = DFIES-INTTYPE. IF SY-SUBRC <> 0. MESSAGE A999 WITH 'Could not Get Info of Field Authority'. ENDIF. ELSE. MESSAGE A999 WITH 'System Language Invalid'. ENDIF. ELSE. IF DFIES-FIELDTEXT <> SPACE. INTFIELD-FTEXT = DFIES-FIELDTEXT. ELSE. INTFIELD-FTEXT = TABVAL-SFIELD. ENDIF. ENDIF. ENDFORM. INCLUDE ZCONINC3. SKIP 2. WRITE: / 'User-ID=', TABVAL-USERID, 'User Name=', USER-NAME. WRITE: /30 'Object', 113 'Values'. WRITE: / 'Profile', 15 'Object', 30 'Text', 40 'Authorization', 60 'Field Name', 110 'From', 118 'To'. ULINE: /(7),15(6),30(6),40(13),60(11),110(10). SKIP.

Authorization Check Program

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2006 SAP AG 10

Disclaimer and Liability Notice This document may discuss sample coding or other information that does not include SAP official interfaces and therefore is not supported by SAP. Changes made based on this information are not supported and can be overwritten during an upgrade. SAP will not be held liable for any damages caused by using or misusing the information, code or methods suggested in this document, and anyone using these methods does so at his/her own risk. SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this technical article or code sample, including any liability resulting from incompatibility between the content within this document and the materials and services offered by SAP. You agree that you will not hold, or seek to hold, SAP responsible or liable with respect to the content of this document.

reward all helpfull answers.

Jay