Skip to Content
0
Jan 07, 2008 at 07:30 AM

Badi for Authorization check

236 Views

Dear Friends

I am working on a issue to check authorizations for role in my CRM BSP application. I am checking the authorization to give access to the application, like

when user id = sold to party allow only display and edit.

when user id = bill to party allow display

when none of the above No access..

to achieve this i am using this badi

IF_EX_CRM_ORDER_AUTH_CHECK~CRM_ORDER_ADD_AUTH_CHECK

Here I am passing guid id to crm_order_read.

but I am not recieving any data back in importing parameter.

I am just passing the guid_id + authorization flag set 'X'.

would you like to tell me what is this guid_id. is it what partner_guid ?

This is my primary code:

MOVE iv_header_guid TO wa_order_guid.

APPEND wa_order_guid TO order_guid.

CALL FUNCTION 'CRM_ORDER_READ'

EXPORTING

it_header_guid = order_guid

iv_no_auth_check = auth_check_flag

IMPORTING

et_orgman = org

et_partner = partner_order

CHANGING

cv_log_handle = y_lv_log_handle

EXCEPTIONS

document_not_found = 1

error_occurred = 2

document_locked = 3

no_change_authority = 4

no_display_authority = 5

no_change_allowed = 6

others = 7.

IF partner_order IS NOT INITIAL.

flag = 'X'.

Else.

flag1 = 'X'.

endif.

IF flag1 EQ 'X'..

RAISE no_authority .

ENDIF.

endmethod.

please tell me where i am doing wrong. In order to achieve this task what else need to be done.

Any help will be appreciated..

Thanking you

Regards

Naeem