Skip to Content
Author's profile photo santanu debnath

How to add icon image to tab strip in webdynpro abap and change the icon dynamically

The actual requirement: The employee data will be displayed in various tabs as check boxes (with some labels). Now each tab should have an incomplete icon besides the tab name. And as soon as employee fill up all the mandatory fields of that tab the icon should be changed to complete icon. Now this check need to implement in final save button or while navigating to other tab.

Here I have created a screen with tab strip, check box and icons to explain the requirement and also how I have achieved that. This is pretty simple indeed.


To achieve the requirement, first of all we have to create a node with an attribute type string.

Then go to the tab strip and click on individual tabs CAPTION UI element in your view. There you can find a meta attribute called imagesource. Now simply find the created context node with that attribute.


Now click on main tab strip UI element. There you will find a OnSelect event under EVENTS meta tag. Simply create a method there. This method will trigger whenever you try to toggle from one tab to another tab.


Now in that method you have to write the code for each tabs mandatory field populated/filled or not. Based on that check simply assign the icon text to the attribute bind with the tab icon.

CASE tab.


*Check for TAB mandatory fields


wd_this->fire_to_tab(      ).


*Check for TAB mandatory fields


wd_this->fire_to_tab_1(        ).


*Check for TAB mandatory fields


wd_this->fire_to_tab_2(    ).


*Check for TAB mandatory fields


wd_this->fire_to_tab_3(    ).


Now the code in that assistance class method will be something like below:

Method check_mandt_data.

Check each attribute is initial or not. Write your own code here. Then based on that check the below condition to set the icon attribute.

  IF lv_field_check IS INITIAL.

    ls_n_image_tab-tab_image_icon = ‘~Icon/Done’.


    ls_n_image_tab-tab_image_icon = ‘~Icon/incomplete’.


Here lv_field_check = space means all fields are checked. means tab complete. Here you can put any icon text as per your requirement.

Assigned tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.