Skip to Content
Author's profile photo Former Member

Visual Composer :Get drop down list values from BI InfoObject master data

Introduction : 

Visual Composer is a easy to use GUI based Tool for designing impressive GUIs. At our end we are using it extensively for BI query dashboards.
 I have been exploring it recently and enjoying the learning curve with help of multiple Weblogs & Forum inputs at SDN. Here I am discussing one of the value help option for query parameters based on infoObject master data. It provides for a drop down list with values extracted from master  data of info object .

   Its inspired from one of the option discussed in Thomas Jung’s weblog for value help options in VC – Visual Composer: Value Help Data Service .

h5. Solution Components :

          This solution is based on RFC enabled Function module in  SAP BW instance which is later called at the time of dynamic determination of values for a Dropdown element in Visual Composer  .
 I am presenting here the RFC FM first and then  configuration steps required in VC to call it during Drop down list creation.

h5.  Master Data Extraction FM in ABAP :  

   Major components of this FM are following three BIW infoObject meta data and  master data related function modules  .
 Purpose of calling  respective FM is also mentioned in remarks.


 FM- Name




 Verifying the existence of info object and its properties ,Viz. whether texts are maintained for it.



 To get the master data and text data table name.



 To extract the master data for the infoobject.


Function module parameters with their usage requirement are given below :








 Name of the infoobject whose master data values need to be shown as drop down list




 Flag to show the master data text values in drop down list . If kept initial the master data values will  be shown in drop down list.




 Table  with master data list values . This is mapped to Key field and Value field of the drop down list elements in the VC story board.




 This is used to process the error .The error is also shown in the drop down list in VC.

Code extract of RFC enabled function module – ‘Z_VC_GET_DROPDOWN_LIST’



<br />“Local Interface:<br />” IMPORTING

<br />* RSSB_AUTHORITY_CHARACTERISTIC<br />data : v_tab TYPE RSDCHKVIEW,<br />v_text type RSTXTTAB,<br />v_objname type rsdiobjv-FIELDNM,<br />v_msgno type T100-MSGNR.<br />tables : rsdchabas.<br />data: i_tab type ref to data,<br />i_vhelp type SHSVALTAB,<br />wa_vhelp type SHSVALSTR,<br />wa_tab type ref to data,<br />wa_texttab type ref to data,<br />wa_viobj type rsd_s_viobj,<br />wa_vcha type rsdvcha,<br />wa_cond type string.<br />DATA: BEGIN OF i_cond OCCURS 0 ,<br />line(60) TYPE c ,<br />END OF i_cond .<br /> <br />field-symbols: <i_tab> type standard table,<br /><wa_texttab> type any.<br />field-symbols : <wa_tab> type any,<br /><v_attr> type any,<br /><v_key> type any.<br />* validate info object existence and properties
i_iobjnm = I_INFOOBJECT
e_s_viobj = wa_viobj
E_S_VCHA = wa_vcha
iobj_not_found = 1
illegal_input = 2
IF sy-subrc <> 0.
— get the name of text and master data tables for the infoobject<br />CALL FUNCTION ‘RSD_CHKTAB_GET_FOR_CHA_BAS'<br />EXPORTING<br />I_CHABASNM = I_INFOOBJECT<br />IMPORTING<br />E_CHKTAB = v_tab<br />E_TXTTAB = v_text<br />EXCEPTIONS<br />NAME_ERROR = 1<br />OTHERS = 2.<br />IF SY-SUBRC <> 0.<br />E_RETURN-id = SY-MSGID.<br />E_RETURN-type = SY-MSGTY.<br />E_RETURN-number = SY-MSGNO.<br />E_RETURN-MESSAGE_V1 = SY-MSGV1.<br />E_RETURN-MESSAGE_V2 = SY-MSGV2.<br />E_RETURN-MESSAGE_V3 = SY-MSGV3.<br />E_RETURN-MESSAGE_V4 = SY-MSGV4.<br />else.<br />— create dynamic table and work area for the master data table— get the master data attribute field name for the infoobject<br />v_objname = wa_viobj-FIELDNM.<br />— building dynamic where clause.— create the text table for the text values dynamically<br />CREATE DATA wa_texttab TYPE (v_text).<br />assign wa_texttab-> to Step 1 :  Create a demo model in VC with BI query as data component and display results in a  chart or List .
In this case I am using Sales organisation as  input parameter and showing  Division wise sales in the Pie Chart using a custom BIW query. In  Input form I am selecting  sales organisation as the only input field .

!|height=277|alt=Figure 1|align=left|width=599|src=|border=1!

















Note that I am not using submit button either as I will be using dropdown selection event  itself to trigger ‘SUBMIT FORM’ action. 

Step 2 : Double click on Sales_Organization element to configure it . Change  control type to ‘Drop-down List’ in general tab.  

!|height=283|alt=Figure 2|align=left|width=402|src=|border=1!
















Step 3 : In  entry list tab select radio button  ‘Dynamic’ and in the pop up for data service select your BW system configured for accessing RFC services.

!|height=227|alt=Figure 3|width=577|src=|border=1!

Choose the developed RFC FM service from  search list .

!|height=1|alt=Figure 4|align=left|width=1|src=|border=0!!|height=283|alt=Figure 4|align=left|width=519|src=|border=1!
















Step 4 : Fill input port fields I_INFOOBJECT with name of the infoObject whose master data values we want in drop down .
Map KEY and VALUE field of Value help table to VALUE and TEXT fields as shown below.
If you want  texts maintained for the master data key is to be displayed in dropdown enter ‘X’ to parameter ‘I_SHOWTEXT’.

!|height=1|alt=Figure 5|align=left|width=1|src=|border=0!

figure 5
















Step 5 :Since we are not using  submit button in our form , go to  ‘ACTION’ tab select radio button as ‘System Action’ and choose ‘SUBMIT FORM’ as the action .
This will execute query whenever you select a value from drop down list.

!|height=227|alt=Figure 6|width=377|src=|border=1!

Step 6 :  Now compile and deploy your model to see master data values in drop down.

















Step 7 : You can also observe that  results change whenever you  select a new value from dropdown.
Since we have opted to execute system event ‘SUBMIT FORM’ at every selection in drop down.

!|height=283|alt=Figure 8|align=left|width=378|src=|border=0!


















WindingUp :
We can further look into possibilities of restricting the dropdown values as per user authorisations for a authorisation relevant Info Object . I am exploring on it will update if anything happens on that front .

Assigned Tags

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