cancel
Showing results for 
Search instead for 
Did you mean: 

Restrict users from creating orders in a particular company

Former Member
0 Kudos

Hi All,

We have a business requirement where client wants to close a company code (say EK10), which is used till now for procurement purpose in SRM. Since we have open POs, users should be allowed to change the existing POs or confirm

goods receipt. So removing EK10 from user attributes in org. struture is not the solution.

As per my knowledge we need to write some code in BBP_DOC_CHECK_BADI to restrict users from creating shopping carts, purchase orders and contracts. Correct me if wrong. Also let me know other BADIs where we should include the code to

achive the desired result.

We do not have proper technical consultant in the project to help. Appreciate if somebody given the technical instructions.

Thanks in advance

Prasad

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Try to restrict creatinon for shopping cart for company code through authorization profile of the requestor role.

take help of baisis to go to the authorization profile of requestor and for object shopping cart try to restrict that to company code of new company code.

Cheers

Iftekhar Alam

Answers (3)

Answers (3)

Former Member
0 Kudos

Hello Prasad,

Please find the code below it might help you.

In BBP_DOC_CHECK_BADI you can restrict as below

IF iv_val EQ BUS2121.

  • Get the Shopping cart details

CALL FUNCTION 'BBP_PD_SC_GETDETAIL'

EXPORTING

i_guid = iv_doc_guid

IMPORTING

e_header = ls_header

TABLES

e_item = lt_item

e_partner = lt_e_partner

e_messages = lt_messages.

SORT lt_e_partner BY p_guid partner_fct.

LOOP AT lt_item ASSIGNING <fs_item>.

READ TABLE lt_e_partner INTO ls_e_partner WITH KEY p_guid = <fs_item>-guid

partner_fct = ''00000016'.

IF sy-subrc EQ 0.

lv_bp_guid = ls_e_partner -partner_no.

  • *--- Get requestor's USER ID

CALL FUNCTION 'BP_CENTRALPERSON_GET'

EXPORTING

iv_bu_partner_guid = lv_bp_guid

IMPORTING

ev_username = lv_uname.

If this lv_uname (Userid) should not have access to create SC raise an error. (For checking u can create a authorization obj etc)

ls_messages-msgty = 'E'.

ls_messages-msgid = Zbbp_pd.

ls_messages-msgno ='001'.

APPEND ls_messages TO et_messages.

ENDIF.

ENDIF.

ENDLOOP.

ENDIF.

Regards,

Neelima

Former Member
0 Kudos

Hi Prasad,

Yes, I also agree. You can use the BBP_DOC_CHECK_BADI. check the parameter tables, e_account and e_items. you can add validations and restrictions.

Regards,

Saixis

Ramki
Active Contributor
0 Kudos

Hi Prasad,

You are right.

You need to use BBP_DOC_CHECK_BADI to ensure that users do not use the company code while creating a document.

You cannot achieve this with authorizations.

Best regards,

Ramki