cancel
Showing results for 
Search instead for 
Did you mean: 

Two Business roles to change alternately, is it feasible?

0 Kudos

Hi,

     I have a requirement where i hv to create one business role (zaccountant1) by copying existing role(zaccountant) with few changes. Now, client want that the new role should be assigned during mid month and month end (eg on 15th & 16th Jan then on 30th 31st Jan). rest of the days Zaccountant role should work.day

Role     Zaccountant1- for mid and month end

           Zaccountant - rest 27 days of the month.

  Is it possible to change the role automatically, so that we need not to assign it again and again?? possible?

Please share your views and possibility.

Regards,

Himanshu

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Himanshu,

  You can do it automatically.Just try below steps.

  • Implement COMPONENT_LOADING BAdi in SE18.

  Note :- If you know any other BAdi which is getting called during web ui loading use it.

  • Write you logic , and use below code snippet for changing business role during runtime.

DATA lr_ui_profile TYPE REF TO cl_crm_ui_profile.

   lr_ui_profile ?= cl_crm_ui_profile=>get_instance( ).

   IF sy-datum = '20130104'.

     lr_ui_profile->if_crm_ui_profile~set_profile(

         iv_profile = 'SALESPRO'

            ).

   ELSE.

     lr_ui_profile->if_crm_ui_profile~set_profile(

       iv_profile = 'SERVICEPRO'

          ).

   ENDIF.

Regards.

Rajarama U

0 Kudos

Thanks Raja..I have another issue raised before implementing this. Enclosing here a screens shot. where i want to hide or deactivate the corporate/individual account option and only search criteria should be there. I tried in Business role and could hide the whole Accounts option. Though i need to hide only create corp/individual accounts option. please share your inputs.thanks

former_member206638
Participant
0 Kudos

Hi Himanshu.

What you need to do is more or less explained here: http://blog.acorel.nl/2012/01/how-to-hide-buttons-for-unauthorized.html

Just redefine the DO_PREPARE_OUTPUT in the relevant View, and grey out (or delete) the undesired buttons.

You could also create a custom authorization object and validate it in the method redefinition, using the Authority check result to hide the buttons your users are not authorized to see. The standard method code will surely be or great help.

Hope it helps.

Regards,

Federico

kumar5
Active Contributor
0 Kudos

Hi Himanshu,

For this you simply need to enhance component 'BP_HEAD_SEARCH' and the view '/MainSearchResult ' after that just go to DO_PREPARE_OUTPUT method of this view and and comment out the code for buttons that you want to delete otherwise if you want to only disable these buttons then you need to make

ls_button-enabled  parameter as false .

Hope it helps.

Thanks

Kumar.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Himanshu,

  Can you share the logic that you used to solve your Original requirement of changing Business Roles?

Regards

Rajarama U

0 Kudos

Hi Raja,

              Instead of using two roles, we used only one role. Here, we created a Ztable in CRM, which will have business cycle end dates(which we used to change the dates). Made changes in the program in

component 'BP_HEAD_SEARCH' and the view '/MainSearchResult ', DO_PREPARE_OUTPUT(as given by Gaurav below)

and assign the new role in org structure.

Now its is in production for testing purpose as our client has two closings in a month. Let me know if you want to have a detail document from the same

Cheers!

Himanshu