When you want to create cool Analytical Fiori-like Apps then APF is the way to go. I blogged about it here: http://scn.sap.com/community/developer-center/front-end/blog/2015/04/01/analysis-path-framework-a-hidden-gem-for-creating-awesome-analytical-apps. So it is about advanced charting in analytical Fiori Apps. You can use APF when you have SAP UI5 resp. Fiori, you need HANA SPS08 or higher and „SAP HANA Analytics Foundation“ (SHAF)” which is part of SAP Suite-on-HANA.

If you don’t know what I mean I recommend to play around with the demo app: https://www.sapfioritrial.com/sap/hana/uis/clients/ushell-app/shells/fiori/FioriLaunchpad.html?helpset=trial&sap-client=001#DaysSalesOutstanding-analyzeDSO or an application in exploratory data analysis which is shown here:


In this blog entry I will describe how to get APF started. And I want to thank everyone at SAP who helped me: you get a free beer when we meet at Markstube in Walldorf 😆

Prerequisites

You need the following for APF:

  • AS ABAP – in the blog I describe a scenario for an AS ABAP 7.40 which is a Fiori Frontend Server.
  • HANA – of course with XS Engine running
  • Web Dispatcher

This is the easy task – you need following skills:

  • HANA administration: skills of HANA Lifecycle Manager and granting roles and analytical privileges – SSO enablement is necessary if you want to avoid loggin screens which is of course necessary for production
  • Web Dispatcher: an analytical app or the APF configuration modeler are JavaScript apps that also consume XSOData services.
  • ABAP administration: installation of a software component and implementing the Fiori Launchpad and can grant ABAP Roles

I also recommend Google Chrome because of the developer tools.

The installation is described here: http://help.sap.com/saphelp_uiaddon10/helpdata/en/ec/f70adefd71445586b2fbe264306fdd/content.htm?frameset=/en/ec/699e0817fb46a0817b0fa276a249f8/frameset.htm&node_id=699

In the following I will describe some details at the installation process which might be interesting for you. At first check that XS Engine is running. Usually it is on port 80<instance number> of your HANA and you should see something like the following on your browser:

xs.PNG

APF on FES and Fiori Lanchpad

After software component UISAFND1 is installed you need two roles on the Frontend Server: SAP_APF_DT_TCR_A (and later you also need  SAP_APF_RT_TCR_A). Then you should see the following tile on your Launchpad:

1_FLP.PNG

Please remark that according to note 2183947 – Smart Business for SoH (Suite on Hana) delivery current SP of software component UISAFND1 also includes the Smart Business Content that was before in software component UISKPI01 which is now obsolete.

HANA Content

You need also HANA Content: HANA CONTENT HBA APF CORE 100 (technical name: HCO_HBA_R_APF_CORE). The installation is described in OSS note: 2183947 – Smart Business for SoH (Suite on Hana) delivery. You find a new software component for the frontend server here for Smart Business which is useful in the future. On the HANA system you can find two software packages:

  • HANA CONTENT HBA AF CORE 100 (HCOHBARSBCORE03P_1-20012110.ZIP)
  • HANA CONTENT HBA AF TRANSP 100 (HCOHBARSBTP00_0-70000744.ZIP)

I am describing the installation using HANA Application Lifecycle Manager (HALM) which is described here: https://help.sap.com/saphelp_hanaplatform/helpdata/en/bd/b7a459c3144fcab1c5641c72c1158d/frameset.htm. Put the zip file on the database server and execute a command like the following:

/sapmnt/<system>/hdbclient/hdbalm -h sh021 -p 8066 -u <adminuser> install /SAPINST/HANA/HANA_AddOns/SAP_ANALYTICS_FOUNDATION/HCOHBARSBTP00_0-70000744.zip


The administration user need sufficent authorizations which are describes in the following knowledge base articels:


Two roles are important for installation: sap.hana.xs.admin.roles:Administrator and sap.hana.xs.admin.roles:HTTPDestAdministrator.


After that execute SQL-Statements described in OSS note 2118742 – Analyzing HANA Live content package deployment problems to control the installation.

As developer you should see the following content in HANA studio now:

systems_content.PNG

On older HANA revisions you need the Application Lifecycle Manager but I won’t describe the details here.


OSS note 2183947 – Smart Business for SoH (Suite on Hana) delivery also describes how to install the SmartBusiness Content:

“Smart Business Hana contents can be found within the download object titled “SAP ANALYTICS FOUNDATION 1.0″ within the same link above. Within this download object, HCOHBARSBCORE03_0.ZIP and HCOHBARSBTP00_0.ZIP are the zip files that contain the two Smart Business Hana Delivery Units (DUs) – HCO_HBA_R_SB_CORE and HCO_HBA_R_SB_TP”

You should also install this content since you will start APD installations from Smart Business KPI/OPI tiles. In fact there is another possibility but at least for testing reasons you will definitely need this content.

Web Dispatcher

Since APF Configuration Modeler as well as analytical apps consume resources both from the Frontend Server (Gateway Hub) but also from the HANA so you need the web dispatcher to overcome the cross origin policy restrictions.

There are many good documents that explain how a web dispatcher works:

It is possible to install more than one web dispatcher. As developer you start the Launchpad and use a different HTTP port. This could be necessary in scenarios when there a more or different systems involved.

I describe a typical configuration with (frontend server fes.acme.com), a backend (be.acme.com) and a HANA XS (hana.acme.com).

wdisp/system_0 = MSHOST= https://fes.acme.com, MSPORT=????, SID=COT, NR=??, CLIENT=???, SRCSRV=*:*, SRCURL=/sap/opu;/sap/bc;/sap/public

wdisp/system_1 = MSHOST= https://be.acme.com, MSPORT=????, SID=CCT, NR=??, CLIENT=???, SRCSRV=*:*, SRCURL=/sap/es

wdisp/system_2 = SID=EXT, EXTSRV= https://hana.acme.com:?, SRCSRV=*:*, SRCURL=/sap/hba;/sap/hana

Also useful are the following parameters:

wdisp/system_conflict_resolution = 1

wdisp/add_clientprotocol_header = 1

wdisp/handle_webdisp_ap_header = 1

wdisp/add_xforwardedfor_header = true

I don’t want to discuss rewriteitign files and integration of Enterprise Search (/sap/es) which is necessary for Fiori factsheets. Please also note that this configuration has to be changed if you develop own XSOData services in own HANA packages.


If the web dispatcher has a wrong configuration then the configuration modeler won’t react if you start to develop a configuration and you will get messages like the one here with Chrome developer tools: “APF message (1): 10005 – Bad HTTP request returned status 404 with text Not found” and “APF message (2): 5101 – Unexpected internal error: No XSRF Token availanble. Contact SAP” and “APF message (3): 9000 – Unknown exception Uncaught Type Error: Cannot read property ‘setAndSave’”

3_wrong_disp.PNG

By the way, you will get similar messages if you don’t have SSO and the HANA DB will require a password change. Then you should try to access the problematic resource with the browser and you will see a message like this:

Password change required to complete authentication. Please change your password here: http://…/sap/hana/xs/formLogin/login.html

Changing the password solves the issue.


Fight for your Rights!

You need HANA privileges that can be granted by your administrator. Then check them in HANA studio you should see at least the first two here:

/wp-content/uploads/2015/11/system_users_826158.png


You need also analytical privileges which is describe in the installation documentation mentioned above. But in a test scenario you should convince your administration to give you a kind of SAP_ALL for accessing all information views which is reasonable in test systems (only):

sap_all.PNG

By the way, you see all your privileges in detail with an SQL statement:

2_grant.PNG

If you don’t have enough privileges you will get the following messages in Chrome developer tools:

“APF message (1): 5001  Request /sap/hba/r/apf/core&odata/modeler/AnalyticalConfiguration.xsodata/$batch to server failed with http status code 403…”

FLP and GW Authorizations

You need additional  authorizations on the Fiori Frontend Server:

  • access of GW Services: authorization object S_SERVICE with SRV_NAME * is strong but reasonable for an APF developer
  • page builder: authorization objects S_PB_CHIP and /UI2/CHIP

As usual transaction SU53 will be your best friend.


For APF modeling you neer these roles:

  • SAP_APF_DT_TCR_A
  • SAP_APF_RT_TCR_A


For Smart Business you need the following roles:

  • /UI2/SAP_KPIFRW5_TCR_S
  • /UI2/SAP_KPIMOD_TCR_S


Smoketest

Now you perform a smoketest. Enter the configuration modeler, and press “+”. Now create a new application and after pressing “Save” it will be saved in the HANA database. When there is a problem then “Save” will not work. In this case open Chrome tools and check the error messages. The description of the errors above will help you to indentify the problem.

smoke.PNG

Since you will start your first APF applications using the KPI modeler you should see on your lauchpad as well tiles from the KPI modeler. If your web dispatcher doesn’t point the the HANA system or the Smart Business HANA content isn’t installed, you will see on your launchpad error messages for the KPI modeler tool instead. The error messages on the tiles say that tiles couldn’t be loaded:

kpi-blog.PNG

Summary

It’s not that difficult to install APF if you know how to do it. But you should have a sixpack of cold beer or some sparkling wine to captivate and win the hearts of your administrators. They deserve it.

To report this post you need to login first.

18 Comments

You must be Logged on to comment or reply to a post.

  1. Fabio Pagoti

    Hello Tobias Trapp,


    This seems to be an obvious question as you showed HANA so much but, is it possible to reuse APF without HANA or Fiori?


    I have to build some custom UI5 apps (so no standard Fiori apps involved) and some of them require features to analyse KPIs. There is no HANA in the landscape neither Fiori Launchpad is used. UI5 version is 1.28.19.


    By the APF architecture presented in the official documentation it seems that APF consumes oData. So I am in doubt if I could create some services in SAP Gateway in replace of HANA xsodata artifacts to expose graph data. Of course I would have no worry about performance as I have no HANA views but I wonder if I could reuse at least some APF functions as it seems a great tools to analyse KPIs.


    Thanks!

    (0) 
    1. Tobias Trapp Post author

      Hi Fabio,

      as far as I know and from documentation HANA is a necessary prerequsite for APF.

      BTW: data exploration without HANA is no fun since the SELECTs take too much time.

      Best Regards,

      Tobias

      (0) 
      1. Fabio Pagoti

        Thank you for the fast answer Tobias.

        Yeah.. I will have to live with that… at least the KPIs I need won’t work with tables with huge amount of data. It seems I will have to create charts using sap.viz.

        Thank you!

        (0) 
    2. Wolfgang Schaper

      Hi,

      As Tobias said, HANA is a prerequisite of APF. But HANA XS is not. So you can use APF with HANA Calculation Views (HANA XS). But you also can use it with BW on HANA or SAP NetWeaver Gateway. And there are more platforms to come, which we will announce when they will be available.

      Best regards,

      Wolfgang

      (0) 
  2. Anni Pang

    hi Tobias,

    I was trying to configure APF, but I was unable to install UISAFND1, our backend server is S/4 HANA premise 1511, the error is “doen’t match the current software component”, our SAP-Basis is 750, can you help me out?

    Thanks,

    Anni

    (0) 
    1. Tobias Trapp Post author

      Hi Anni,

      my blog described the installation on a Fiori Frontend Server NW 7.40 and we have SAP_UI 750 installed.

      The shipment for S/4HANA is different – see OSS note  2018360 (Release Information Note for SAP SMART BUSINESS). This note points to note 2189824 which is not released at the moment. You should open an OSS note no open it.

      Best Regards,

      Tobias

      (0) 
  3. Naga Prakash

    Hi Tobias,

    When i am launching APF Configuration Modeler from FLP i got this error on chrome console “Cannot read property ‘setAndSave’” . What i infer from this blog is Web Dispatcher to be configure to resolve this error. Even after configuring the web dispatcher i am still getting the error. Could you please me. Is there any trouble shooting document for APF

    Thanks,

    Naga

    (0) 
  4. Bernd Steinhauer

    Hello Tobias, we have the requirement to implement some analytical apps in the fincial area. For this I’d like to try out APF. Is it necessary to buy any additional components or can I download all I need from the Marketplace? We have a SAP-installation based on NW 7.40 and HANA Thanks, Bernd

    (0) 
    1. Tobias Trapp Post author

      I’m not working für SAP and I am no license guy, so I can’t give you an answer. So you should ask,

      But if I remember correctly is included in SAP Business Suite on HANA license. But there are also good chances if you have license for HANA Live – this was the former SHAF SAP HANA Analytical Foundation), But license topics have become so difficult that you should ask SAP.

      (0) 

Leave a Reply