Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 8419

Visual Composer 7.1 and up and BW Query with two structures

$
0
0

Problem:

 

In Visual Composer 7.11 and up in WebDynpro runtime all Bex Query structures are displayed in columns.


Example:

Bex Query below contains two different structures.

1.png

 

The result of the query’s execution in Bex Analyzer is as following:

 

 

2.png

The result of the query’s execution in VC WebDynpo runtime:

3.png

Reason:

 

In VC 7.11 and up BI data is displayed in WebDynpro ALV table.

ALV table cannot display structure in rows. Therefore all query structures are displayed in the columns of ALV (please refer to the following on-line documentation):


http://help.sap.com/saphelp_nwce72/helpdata/en/48/e8b38783d4105ee10000000a42189d/frameset.htm


    • Note that BI queries and query views in SAP List Viewer (ALV) are not displayed in the same way as in BEx Analyzer or BEx Web. For example:
      • All query structures are displayed in the columns.

     

    http://help.sap.com/saphelp_nwce72/helpdata/en/48/e8b3fc83d4105ee10000000a42189d/frameset.htm

     

      • If the BI object contains a key figure structure and another structure, these three fields are generated for each member combination of the two structures.


    Solution:

     

    The issue can be solved by modeling in Visual Composer Design Time.  As a result of the issue the output of the Query comes in one single row with the crisscrossed columns:


    3.png

    So the objective of the modeling solution is to split the row in such a way that there will be tree columns:

    1. The read only column of “2004” and “2003”

    2. The column of Net Sales

    3. The column of Lost Deals



    In order to implement the solution please follow the step by step instruction below:

    1. Create a White Service (Service Component); let’s call it “DoTranspose”
    2. Add DataIn (in1) connector to the Service Component and define its data as following:




    4.png



    We defined two text fields for the headers of the rows (it will be “2003” and “2004”) and 4 fields for the key figures.

    Make sure that the types of the fields are correct.

     

     

         3.     Add Union operator with two input ports and connect it with DataIn

    Note: the number of Union operator ports should be equivalent to the number of rows – in our case it is 2 rows: for 2003 and for 2004



    5.png

     

         4.     Right click on the Union and choose command “Define Operator”



    6.png


         5.     Define the Union operator as following:

     

         Field Name defines the columns` headers.

         In the row of Year put the fields that represent year (@year2003 and @year2004)

         In the row of Net Sales put the fields of NetSales (for 2003 and for 2004 respectively)

         In the row of Lost Deals put the fields of LostDeals  (for 2003 and for 2004 respectively)


    7.png


    When you define the Union operator, you can use the values in the Drop Down, it will save your time:


    8.png


         6.     Connect the output port of Union operator with DataOut connector.



    9.png

    Open the Define Data dialog of the DataOut connector and make sure that its fields are the columns` headers:



    10.png




         7. Save the ServiceComponent. It should look like the following:


    11.png

         8. Create a model , add the Query to it, connect the Query with StartPoint



    12.png


         9.     Add the ServiceComponent to the model



    13.png

         10. Connect the DATA port of the Query with the in1 port of the SericeComponent and maintain the mapping in the following way:

     

    14.png




    Assigned value of the field year2003 should be string “2003” (constant string)

    Assigned value of the field year2004 should be string “2004” (constant string)

    Note: Field’s year2003 and year2004 will serve for the most left column of the table.

     

    Assigned value of the numeric fields should be chosen from the drop down respectively. The drop down contains the list of key figures that comes from the back end.

    For example, for NetSales2003 choose the value of Net Sales(2003)

    As a result we have the following mapping:

     

    15.png

     

         11.    Connect a table with the out1 port of the Service Component and name it ‘Fixed Table’

         12.    Connect a table with DATA port of the Query and name it ‘Original Table’

     

    16.png

     

         13.    Deploy the model and run it. Check the result:

     

     

    17.png

     

     

         14.   Go to Layout and make the column “Year” of the Fixes Table to be read only. The result will be the same as in Bex Analizer:

     

    18.png


    Viewing all articles
    Browse latest Browse all 8419

    Trending Articles



    <script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>