Ansicht
Dokumentation
FI_AUTHORITY_ITEM - Enhance Authorization Check for Document Display
rdisp/max_wprun_time - Maximum work process run time General Data in Customer MasterThis documentation is copyright by SAP AG.
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.
The corresponding authorization objects exist, and the authorizations have been defined.
After you have called the IMG activity, proceed as follows:
- In the following dialog box, enter in the field "Implementation" a name for the BAdI implementation and choose Copy.
- If implementations have already been created for the BAdI, a dialog box with the existing implementations will be displayed. In this dialog box, choose Create.
- In the corresponding field, enter a short text for implementation .
- In the tab Propertiesenter filter properties - if this is a filter-dependent BAdI.
- Choose the tab Interface.
- The name of the implementing class is generated by the system based on the name of your impmlementation. You can change the name.
- If the BAdI is a menu exit, the tab FCodes also appears.Enter a function here and, if necessary, additional data.
- Save your entries and assign a package.
- Position the cursor on a method. Call up the Class Builder by double-clicking it.
- Between the statements method <Interface-Name>~<Name of Method>. and endmethod, enter the coding you request for the implementation.
- Save and activate your coding, and navigate back to the screen Change Implementation.
- Save on the screen Change Implementation.
- Note: You can first create an implementation for the BAdI and then activate this later on. In this case, close the processing function at this time.
- Choose Activate.
- When the application program is executed, the coding you have created will be run.
Methods:
BAL_S_LOG - Application Log: Log header data General Data in Customer Master
This documentation is copyright by SAP AG.
Length: 6305 Date: 20240523 Time: 194949 sap01-206 ( 69 ms )