Skip to Content

Title.jpg

Applies to:

SAP CRM 7.0, EHP1 and EHP2

Summary

This particular document illustrates the technique to hide the column in the table type view. There are umpteen number of ways of hiding the data in the row(one can use iterator approach where one can define the iterator class BHTML tag <chtml: configtable iterator> and use the customize class with the interface as IF_HTMLB_TABLEVIEW_ITERATOR and then write the logic in the method IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_ROW_START). The other approach is with respect to switch framework where using get_A method in class we can use to hide the data. But over here we need to hide the whole column in table type view. I won’t be able to share the whole scenario as it was related to my project, but will be presenting a very simple value node type example, wherein I’ll be creating the table type view on value node and then will be illustrating the technique to hide the column.

Author(s): Rajwin Singh Sood

Company: Atos

Created on: 27th June 2014

Author Bio

Picture.jpgRajwin Singh Sood is currently working as Team lead/Solution Architect at Atos. He has got experience of more than 9 years in SAP ABAP and SAP CRM web UI. He is also a SAP CRM EHP2 Certified associate consultant. Prior to working with Atos he had worked with SAP India(SAP Global Delivery), Capgemini , Accenture and Infosys. He worked in SAP CRM Web UI areas like BSP enhancements, transaction launchers, BOL Programming, BRFPlus .

Scenario

As mentioned I’ll be using a simple scenario where in I am having a Ztable(as shown in the screenshot you can use any other table no need to use the same) with the fields and I have created the BSP component wherein created search and search result screen using value node to search the data in the Ztable. Please refer to the below screenshots:-

/wp-content/uploads/2014/06/pic1_485990.jpg

/wp-content/uploads/2014/06/pic2_485991.jpg

As I said the scenario doesn’t matter you can use any other scenario. I have used value node as its simple way of illustrating the same.

Steps to achieve the hiding of Column in table type view

  1. As a first step we need to get the configuration data from the repository containing the definition of the fields which we had added in the configuration tab to be displayed on the browser. For this we need to go to layout( .HTM) page and add the following code:-

DATA lv_xml TYPE string.

  lv_xml = controller->configuration_descr->get_config_data( ). Please refer to the below screenshot:-

/wp-content/uploads/2014/06/pic3_485992.jpg

2.     In this step we need a global variable which we need to use to hide the column and would be containing the repository data as per step 1. So we have defined the parameter in controller class of the view

/wp-content/uploads/2014/06/pic4_485993.jpg

3.       Now we need to use this variable in the layout page which is shown in the screenshot above in step1.

/wp-content/uploads/2014/06/pic5_486800.jpg

And also we need to add this variable in the configCellerator BHTML tag in order rebuild the view. Please refer to the below screenshot:-

/wp-content/uploads/2014/06/pic6_486801.jpg

4.     Now comes the main step where we’ll write the logic to hide the column over here I have written the logic in DO_PREPARE_OUTPUT for illustration purpose. It depends upon your requirement whether it could on click of button or for that matter on some other event. Please refer to the code screenshot below with the highlighted area as the logic for hiding the column:-

/wp-content/uploads/2014/06/pic7_486802.jpg

Testing the working model in browser

For testing simply click on the test button of the BSP workbench transaction:-

/wp-content/uploads/2014/06/pic8_486751.jpg

/wp-content/uploads/2014/06/pic10_486865.jpg

In the above screenshot the highlighted one is the one which will be hidden once we click on search operation

/wp-content/uploads/2014/06/pic11_486872.jpg

So the column customer is hidden.

This is the simple illustration for hiding the column. I had used this in complex scenario wherein I was generating the dynamic table columns and then using the same to show and hide by utilizing the technique shown above.

To report this post you need to login first.

9 Comments

You must be Logged on to comment or reply to a post.

  1. Vitaliy Tsarkov

    Good afternoon.
    Thanks for the post, but there is a problem with this way.
    headerdefinition xml is empty after this conversion
    It does not work personalization block. For instance displaying the number of lines per page.

    (0) 
  2. Rajwin Singh Sood Post author

    Hi Vitaliy,

    I never faced this issue for me it worked just fine. I had implemented this as part of my deliverable. Can you please let me know what exactly you did which caused this issue

    (0) 

Leave a Reply