SAP ABAP IMG Activity FI_AUTHORITY_ITEM (Enhance Authorization Check for Document Display)
Hierarchy
SAP_FIN (Software Component) SAP_FIN
   FI-GL (Application Component) General Ledger Accounting
     FAGL_DOCUMENT_SERVICES (Package) Service Modules for Displaying/Entering FI Documents
IMG Activity
ID FI_AUTHORITY_ITEM Enhance Authorization Check for Document Display  
Transaction Code S_SL0_21000029   (empty) 
Created on 20040428    
Customizing Attributes FI_AUTHORITY_ITEM   Enhance Authorization Check for Document Display 
Customizing Activity FI_AUTHORITY_ITEM   Enhance Authorization Check for Document Display 
Document
Document Class SIMG   Hypertext: Object Class - Class to which a document belongs.
Document Name FI_AUTHORITY_ITEM    

Use

This Business Add-In (BAdI) is used in Financial Accounting (FI).

Using this BAdI, you can add authorization checks to existing ones at the item level in the FI document display and change functions.

Up to and including SAP enhancement package 6 for SAP ERP 6.0 (SAP_APPL 606), this BAdI has only one method:
FI_AUTHORITY_ITEM

Example 1:

AUTHORITY-CHECK OBJECT 'XYZ'

ID 'ACTVT' FIELD i_beract

ID 'FISTL' FIELD i_bseg-fistl.

IF sy-subrc NE 0.

IF i_beract = '02'.

AUTHORITY-CHECK OBJECT 'XYZ'

ID 'ACTVT' FIELD '03'

ID 'FISTL' FIELD i_bseg-fistl.

IF sy-subrc NE 0.

c_rcode = 4.

ELSE.

c_bmodz = 'A'.

ENDIF.

ELSE.

c_rcode = 4.

ENDIF.

ENDIF.

As of SAP enhancement package 6 for SAP ERP 6.0, version for SAP HANA 1.0 (SAP_APPL 616), this BAdI offers two additional methods:
GET_FIELDLIST and
GET_WHERE_CLAUSE

You can use both of these methods to adapt the implementation of the BAdI to in-memory databases. These methods are only used in this case and only if you have implemented the previous BAdI method.

Example 2:

You want to optimize the above example for in-memory databases. For this, you need to implement one of the two new BAdI methods.

Method ET_FIELDLIST:

DATA: ls_field TYPE LINE OF ET_FIELDS.

ls_field = 'FISTL'.

APPEND ls_field TO ET_FIELDS.

EV_SUPPLIED = 'X'.

Method GET_RANGE:

DATA: lt_fistl TYPE TABLE OF FISTL.

FIELD-SYMBOLS: <fistl> type fistl.

SELECT fistl FROM FMFCTR INTO TABLE lt_fistl.

LOOP AT lt_fistl ASSIGNING <fistl>.

AUTHORITY-CHECK OBJECT 'XYZ'

ID 'ACTVT' FIELD '03'        "at least authority to display

ID 'FISTL' FIELD <fistl>-fistl.

IF sy-subrc EQ 0.

ls_range-SIGN = 'I'.

ls_range-OPTION = 'EQ'.

ls_range-LOW = <fistl>-fistl.

APPEND ls_range to et_range.

ENDIF.

ENDLOOP.

Depending on the type of authorization check, it may be preferable to use method GET_FIELDLIST or method GET_WHERE_CLAUSE; the number of entities dictates essentially which method is preferable. For example, if there are very few possible values, it is preferable to use method GET_WHERE_CLAUSE. If you want to use different authorizations for different authorization activities, you still have to implement GET_FIELDLIST in any case.

  • When you implement GET_FIELDLIST for an authorization check, the implementation of the previous method remains untouched.
  • When you implement GET_WHERE_CLAUSE, you can generally delete the implementation of the previous method in method FI_AUTHORITY_ITEM.

Requirements

The corresponding authorization objects exist, and the authorizations have been defined.

Standard settings

Activities

After you call the IMG activity, the system displays a dialog box where you enter a name for the implementation.

If implementations of this Business Add-In have already been created, the system displays them in a dialog box. You then choose one of them by choosing Create, and continue as follows:

  1. In the dialog box, enter a name for the implementation of the Add-In and choose Create.
    The system displays the initial screen for creating Business Add-In implementations.
  2. On this screen, enter a short description for your implementation in the Implementation Short Text field.
  3. If you choose the Interface tab, you will notice that the system has populated the Name of the Implementing Class field automatically, by assigning a class name based on the name of your implementation.
  4. Save your entries and assign the Add-In to a package.
  5. To edit a method, double-click its name.
  6. Enter your implementation code between the method <Interface Name>~<Name of Method>. and endmethod. statements.
  7. Save and activate your code. Navigate back to the Change Implementation screen.
    Note: You can also create an implementation for an Add-In and not activate it until later. If you want to do this, do not perform the following step:
  8. Choose Activate.
    When the application program is executed, the code you created is run through.

Example

See also

Methods:

FI_AUTHORITY_ITEM

GET_FIELDLIST

GET_WHERE_CLAUSE

Business Attributes
ASAP Roadmap ID 209   Establish Authorization Management 
Mandatory / Optional 2   Optional activity 
Critical / Non-Critical 2   Non-critical 
Country-Dependency A   Valid for all countries 
Assigned Application Components
Documentation Object Class Documentation Object Name Current line number Application Component Application Component Name
SIMG FI_AUTHORITY_ITEM 0 HLA0009201 O HLA0009204 O HLA0009203  
Maintenance Objects
Maintenance object type E   Business Add-In - Definition 
History
Last changed by/on SAP  20040512 
SAP Release Created in 500