CRM Bol programming Make fields editable and display only · IT Consulting & Development | Custom Software, SAP, Microsoft

CRM Bol programming Make fields editable and display only

Home / Blogs / CRM Bol programming Make fields editable and display only

This article covers the basics of how you could control the UI element using CRM bol programming and understand the technical objects which can be used to modify the display property on the UI. The article covers these 5 topic areas below:
1. Requirement
2. Finding the UI component
3. Opening the corresponding UI component from backend
4. Find relevant technical objects to modify
5. Code changes to make the field display only or editable

1. Requirement: Disable a UI element

For customer overview screen when user clicks on edit to update the address information the next screen should be editable / display based on business rules.

Check the below screen phone/ fax mobile screen should be editable based on mobile Number

2.    Find the UI component

Right click on the specific field and press F2 and you would be able to see the technical details

Make a note of the UI component and View as below

UI Component is BP_ADDR and View is BP_ADDR/AccountCommNumbersEL

3.    Open the UI component in backend

Use transaction obsp_wd_cmpwb to be able to open the component in backend CRM system

Enter the component found above as BP_ADDR you can use an existing enhancement or create a new one. IN my case I am using an existing enhancement as ZCRM

Find the UI component and View associated with it

It shows the different view components as seen below

In order for us to change the section for communication we need to focus on the controller implementation class Implementation Class ZL_BP_ADDR_ACCOUNTCOMMNUM_IMPL

And View layout AccountCommNumbersEL.htm

4.    Find relevant technical objects to modify

If you have never used the UI object above, then the methods would needs to be redefined. You could right click and choose redefine.

I already used the class before so no need to redefine hence using the class ZL_BP_ADDR_ACCOUNTCOMMNUM_IMPL.

The class ZL_BP_ADDR_ACCOUNTCOMMNUM_IMPL is one of the important class which has a method DO_PREPARE_OUTPUT where you can control to make view editable or display only. This class is a  bol entity of type CL_BSP_WD_VIEW_CONTROLLER

IN this class you get attributes by default which can be used to control the context behavior. For this case we would be using VIEW_GROUP_CONTEXT

This further reference an associated interface IF_BSP_WD_VIEW_GROUP_CONTEXT

5.    CRM Bol programing Code changes to display /edit the section

Below code was added in method DO_PREPARE_OUTPUT

me->view_group_context->set_all_display_only( )..

Breakpoints can be set and after changes you would notice that you are still able to edit the BP header section

Let’s add an additional line of code which says.

me->zaddress_display = ' '.

Now when the program runs it is able to show the field as display only.

The additional setting is to create an attribute in the class

This attribute value is then passed on the BSP page as below. Where the code should say:

displayMode           = "<%= controller->zaddress_display %>"

To make all fields editable below code should be used

me->view_group_context->set_all_editable( ).
me->zaddress_display = ' '.

And in the HTM page, the value of ZAddress would now be passed as Blank which would make the field editable.

Hope this article was useful to help you to edit/display UI elements on CRM WEB UI

Please let us know by posting a comment if you liked the article or if anything else which we could add to improve the article.

Thanks for reading..!


Learn more about our SAP service offerings in the below links.

Contact us for any business inquiry and sending us a message here

For any business enquiry please use the contact us form to get in touch.

Contact Us


SAP Consulting

SAP Procurement



Leave a Reply

Your email address will not be published. Required fields are marked *

× How can I help you?