Integrating SAP Analytics Cloud and SAP BW

| Analytics , SAP Analytics Cloud , SAP Business Warehouse , SAP BW ,

SAP Analytics Cloud can be directly connected to SAP BW using the LIVE DATA CONNECTIONS, this type of connectivity will always let the data remain in SAP BW behind the corporate firewall. We noticed that a lot of customers are not yet on the SAP Netweaver version 7.52, so we documented the steps to configure connectivity for SAP Netweaver releases lower than 7.52. Follow the steps to setup the live connection type for SAP BW.

Step 1: Configure CORS 

  • Create a “cors rewrite” file on the ABAP Server under the profile folder.
    /usr/sap/<SID>/SYS/profile/cors_rewrite

configure-sap-bw-with-sac

Add the following content in the rewrite file.

Note: Replace <HOSTNAME> with your SAP Analytics Cloud host name.

            if %{HEADER:isSACOriginAllowed} = true
                    setHeader isSACOriginAllowed false

           if %{HEADER:ORIGIN} regimatch ^(https:\/\/)?<HOSTNAME> [AND]
           if %{PATH} regimatch (\/sap(\(.*\))*\/bw\/ina\/*) 
               setHeader isSACOriginAllowed true

           if %{HEADER:isSACOriginAllowed} = true [AND]
           if %{REQUEST_METHOD} regimatch (GET|POST)
           begin
              setResponseHeader Access-Control-Allow-Origin %{HEADER:ORIGIN}
              setResponseHeader Access-Control-Expose-Headers x-csrf-token,sap-rewriteurl,sap-url-session-id,sap-perf-fesrec,sap-system
              setResponseHeader Access-Control-Allow-Credentials true
             setResponseHeader Vary origin
          end

          if %{HEADER:isSACOriginAllowed} = true [AND]
          if %{REQUEST_METHOD} stricmp OPTIONS
         begin
            regRewriteUrl ^/(.*) /sap/public/ping
            setResponseHeader Access-Control-Allow-Origin %{HEADER:ORIGIN}
            setResponseHeader Access-Control-Allow-Methods GET,POST
            setResponseHeader Access-Control-Allow-Headers x-csrf-token,x-sap-cid,authorization,mysapsso2,x-request-with,sap-rewriteurl,sap-url-session-id,content-type
          setResponseHeader Access-Control-Max-Age 600
          setResponseHeader Access-Control-Allow-Credentials true
          setResponseHeader Vary origin
          removeResponseHeader Set-Cookie
          removeResponseHeader Expires
      end

Adjust ICM parameter pointing to the CORS file path.

            icm/HTTP/mod_0 = PREFIX=/,FILE=<Path_To_CORS_Rewrite_File>

Restart ABAP Server.

Step 2: Add custom web content

Run transaction SE24, and create object ZCL_DUMMYAUTH_SERVICE 

add-custom-web-content-sap-analytics-cloud

Go to the Interfaces tab, and add IF_HTTP_EXTENSION

class-builder-sap-bw-sap-analytics-cloud

Verify the below details under the Methods tab

Double click on IF_HTTP_EXTENSION~HANDLE_REQUEST and add the following code, and then SAVE and ACTIVATE.                          method IF_HTTP_EXTENSION~HANDLE_REQUEST.
             DATA:
                             html_content TYPE string.
             html_content = ‘<html><script type=”text/javascript”>window.close();</script></html>’.
             server->response->set_cdata( data = html_content ).
endmethod.

class-builder-sap-analytics-cloud       

Enter Transaction SICF, enter the path /sap/bw/ina, and then press Enter.

sap-bw-with-sap-analytics-cloud

Under default_host -> sap -> bw, right click ina, then choose New Sub-Element.

sap-bw-with-sap-analytics-cloud

In service name, enter auth, and click enter.

sap-bw-with-sap-analytics-cloud

Add a description, and then navigate to Handler List tab, and enter ZCL_DUMMYAUTH_SERVICE

Save and return to the main menu.

sap-bw-with-sap-analytics-cloud

Right click and test the service.

sap-bw-with-sap-analytics-cloud

Make sure you are redirected to the login page, and not getting 404 page after login.

Step 3: Add BW Live connection in SAP Analytics Cloud

Log onto SAP Analytics Cloud and go to Main Menu -> Connection.

sap-bw-with-sap-analytics-cloud

(Add Connection) -> Live Data Connection -> SAP BW.

sap-bw-with-sap-analytics-cloud

Enter the connection name, and set the connection type to Direct and add your SAP BW host name, HTTPS port, and Client.

sap-bw-with-sap-analytics-cloud

Under Authentication Method select SAML Single Sign On and click OK.

sap-bw-with-sap-analytics-cloud

You should now be able to connect to SAP BW using the LIVE DATA CONNECTIVITY.

Share with:

FacebookTwitterLinkedIn