cancel
Showing results for 
Search instead for 
Did you mean: 

ui configuration at run time using role config key and object type

Former Member
0 Kudos

Hi experts,

Let me start by admitting that I am very new to the crm webui. I have a requirement in which I need to create a few z business roles and unique role config keys for them. And I have been given some requirements like below.

- Access to Account, Service Request, Knowledge Article and FACT sheet data

- Able to display all service requests.

below is the processing logic that I have been told.

Using the role config key, different view configurations would be created for respective components in

the component workbench.

Based on the business role, respective role config key would be picked up and the corresponding

view would be displayed on UI.

In addition to this, in the IMPL class of the component work bench, DO_CONFIG_DETERMINATION

method could also be used to specify which role config should be picked up.

Do they mean that using same role config key, I need to create more than one UI configuration? I was also told by some one that I need to create the configuration according to ui objects and sub object and then inside the DO_CONFIG_DETERMINATION methode, I can check the role config key and hard code the ui object and the sub object. But I do not know how to create them.

Could anyone tell me from where I can start and how to achieve this task?

I apologize if my question is very basic.

Accepted Solutions (1)

Accepted Solutions (1)

kavindra_joshi
Active Contributor
0 Kudos

Do they mean that using same role config key, I need to create more than one UI configuration? I was also told by some one that I need to create the configuration according to ui objects and sub object and then inside the DO_CONFIG_DETERMINATION methode, I can check the role config key and hard code the ui object and the sub object. But I do not know how to create them.

Could anyone tell me from where I can start and how to achieve this task?

I apologize if my question is very basic.

You can do the following

a) Go to the view you want to create a new configuration.

b) Choose 'Copy Configuration' .

c) There you would be asked to enter the Role Config Keys , Object Name & Sub Object Name. You can choose your own names for Object Names & Sub Object Name.

d) go to DO_CONFIG_DETERMINATION. There based on your logic you can load the configurations this way


        IF (your_condition) EQ abap_true.

          CALL METHOD me->set_config_keys
            EXPORTING
              iv_object_type          = 'your_object_type'
              iv_object_sub_type      = 'your_sub_obj_type'
              iv_propagate_2_children = abap_false.

Regards

Kavindra

Former Member
0 Kudos

Thanks for the quick reply Kavindra,

I have tried to copy the configuration, as you have mentioned. When I give a ui object type and sub type as zserviceo and zserviceso, it is giving the error message that they are not defined. I went to spro and defined the Object type and defined the zserviceo object type. How can I define the sub object type?

And I f I succeed in copying a view configuration. I guess I can add or remove the feilds in that view. However I still do not know how I can achieve the requirements. One of them I will mention below.

- Access to Account, Service Request, Knowledge Article and FACT

sheet data.

Could you please tell me how I can do this?

Thanks

Ajith C

kavindra_joshi
Active Contributor
0 Kudos

You can allow the sub_object_type to be <DEFAULT>.\

Yes once you have assigned this you would be able to load the new configuration after you make changes to the view. I have mentioned the code already how to do this.

I don't know specifically the objects that you have asked for.

Former Member
0 Kudos

Hi Kavindra,

Thanks again for helping me. I got what you have told. I have created a new view configuration. Now, my requirement is to load this configuration only when I log on using a particular Role configuration key. I went to the methode DO_CONFIG_DETERMINATION which is in class CL_BP_HEAD__MAINSEARCH_IMPL. Could youy please tell me how I can edit thie methode to add the piece of code, and also how can I write the condition so that the new UI configuration gets loaded only when I log on using the specific Role configuration key?

Thanks for your time and consideration.

Ajith C

kavindra_joshi
Active Contributor
0 Kudos

You should not edit standard SAP class but create an Enhancement using the Enhancement Set concept.

Regards

Kavindra

Former Member
0 Kudos

Thank you so much Kavindra,

In fact this is the only help that is available to me at the moment. I have created an enhancement for my view and a ZCL_BP_HEAD__MAINSEARCH_IMPL is generated which contains the DO_CONFIG_DETERMINATION methode.

Now it is the coding part. My requirement is that when the user logs in using the Role configuration key zajser which I have created, the UI configuration that I have created should load. I guess I can give the Object type and the sub object as zaj ( I created this) and <default>. How can I write the IF condition statement? Since the methode does not have a parameter for Role configuration key, how would I do this task?

Thanks in advance.

Ajith C

Edited by: ajithfin_c on Feb 6, 2012 2:54 PM

kavindra_joshi
Active Contributor
0 Kudos

Hi ,

You can do the following in the DO_CONFIG_DETERMINATION, you can write the following


if cl_crm_ui_profile->get_profile( ) <> 'Name_of_your_business_role"
         CALL METHOD me->set_config_keys
            EXPORTING
              iv_object_type          = 'your_object_type'
              iv_object_sub_type      = 'your_sub_obj_type'
              iv_propagate_2_children = abap_false.
endif.

The Business roles and Role config keys are closely tied. For a particular business role you would have one role config key. Hence you can realize your requirement like this.

Regards

Kavindra

Former Member
0 Kudos

Hi Kavindra,

Thank you very much. I have been able to successfully load the custom ui configuration for the business role as you have mentioned. Now, how do I incorporate the authorizations to the business role. For example, if there are two business roles ( an agent and a manager ) the agent should be able only to view his lead and a manager should be able to view all the leads and perform some edit operations on them? Now I am able to load different view configurations only. Could you also suggest me any document which has all the necessary basics?

Thank you so much for your time and consideration,

Ajith C

Answers (0)