cancel
Showing results for 
Search instead for 
Did you mean: 

Authorization Check for Charge

Clark_Huang
Advisor
Advisor
0 Kudos

Hi Expert,

There is one requirement aboutt authorization check for Pricing.

If the user don't have Display auth, the charge should not display.

If the user don't have Update auth, the charge should be read only.

We try to achive this on BOPF authorization check framework. But it seems don't work.

Do you have any suggestions about it?

Best Regards

Clark Huang

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Clark,

You can create a determination for that node, and in that determination class you can check the authorization for particular user using authorization check functional module.

After that check the value of sy-subrc. if it is not initial then you can make that field invisible using lo_property.

check out the following code.

DATA : LO_PROPERTY TYPE REF TO /BOBF/CL_LIB_H_SET_PROPERTY.

  CREATE OBJECT LO_PROPERTY
    EXPORTING
      IS_CONTEXT = IS_CTX    " Context Information for Determinations
      IO_MODIFY  = IO_MODIFY.   " Interface to Change Data

you can set your field properties using following code

   LO_PROPERTY->SET_ATTRIBUTE_READ_ONLY(
      EXPORTING
        IV_ATTRIBUTE_NAME = <your constant interface name>=>SC_NODE_ATTRIBUTE-<your Node name>-<Fieldname>  " Name of the attribute for which the property is to be set
        IV_KEY            =  <your instance key>   " Key of the instance for which the property is to be set
    IV_VALUE          = ABAP_FALSE    " New value of this property (true/false)
    ).

Thanks and regards,

Chetan P. Patil

Answers (0)