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.
No | FM- Name | Remarks |
1 | RSD_IOBJ_GET | Verifying the existence of info object and its properties ,Viz. whether texts are maintained for it. |
2 | RSD_CHKTAB_GET_FOR_CHA_BAS | To get the master data and text data table name. |
3 | RSAU_READ_MASTER_DATA | To extract the master data for the infoobject. |
Function module parameters with their usage requirement are given below :
No. | Parameter | Type | Remarks |
1 | I_INFOOBJECT | Import | Name of the infoobject whose master data values need to be shown as drop down list |
2 | I_SHOWTEXT | Import | 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. |
3 | E_VALUE_HELP | Export | 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. |
4 | E_RETURN | Export | 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’
FUNCTION Z_VC_GET_DROPDOWN_LIST. |
"----
!https://weblogs.sdn.sap.com/weblogs/images/64545/DLW082007_002.JPG|height=277|alt=Figure 1|align=left|width=599|src=https://weblogs.sdn.sap.com/weblogs/images/64545/DLW082007_002.JPG|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.
!https://weblogs.sdn.sap.com/weblogs/images/64545/DLW082007_004.JPG|height=283|alt=Figure 2|align=left|width=402|src=https://weblogs.sdn.sap.com/weblogs/images/64545/DLW082007_004.JPG|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.
!https://weblogs.sdn.sap.com/weblogs/images/64545/DLW082007_006.JPG|height=227|alt=Figure 3|width=577|src=https://weblogs.sdn.sap.com/weblogs/images/64545/DLW082007_006.JPG|border=1!
Choose the developed RFC FM service from search list .
!https://weblogs.sdn.sap.com/weblogs/images/64545/DLW082007_004.JPG|height=1|alt=Figure 4|align=left|width=1|src=https://weblogs.sdn.sap.com/weblogs/images/64545/DLW082007_004.JPG|border=0!!https://weblogs.sdn.sap... 4|align=left|width=519|src=https://weblogs.sdn.sap.com/weblogs/images/64545/DLW082007_008.JPG|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’.
!https://weblogs.sdn.sap.com/weblogs/images/64545/DLW082007_010.jpg|height=1|alt=Figure 5|align=left|width=1|src=https://weblogs.sdn.sap.com/weblogs/images/64545/DLW082007_010.jpg|border=0!
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.
!https://weblogs.sdn.sap.com/weblogs/images/64545/DLW082007_012.JPG|height=227|alt=Figure 6|width=377|src=https://weblogs.sdn.sap.com/weblogs/images/64545/DLW082007_012.JPG|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.
!https://weblogs.sdn.sap.com/weblogs/images/64545/DLW082007_016.JPG|height=283|alt=Figure 8|align=left|width=378|src=https://weblogs.sdn.sap.com/weblogs/images/64545/DLW082007_016.JPG|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 .