Skip to Content

You have built a Fiori App or SAPUI5 Web Application hosted in the XSEngine of SAP HANA, or a web application developed with ASP.NET/PHP etc. And would like to embed it into SAP Business One as part of B1. As a result, the users can accomplish his/her system-related daily work inside B1 with the same user experience rather than switching between B1 and HANA App/other external web app.

To do so, SAP Business One provides a web browser widget since version 9.0, which allows you to customise the target URL of web application, and then the widget can be showed in the cockpit. But this web browser widget is not available in the new Fiori style cockpit of B1H 9.1(which may be available in the future patch.)

Alternatively, you can use the WebBrowser user control (SAPbouiCOM.BoFormItemTypes.it_WEB_BROWSER)  in UI API of SAP Business One 9.1 to open the web application within an Add-On form. Therefore UI API Add-On as a container is needed to accommodate such a web application in SAP Business One, whatever it is a web app in XSEngine of SAP HANA or any other web app developed with ASP.net hosted in IIS etc.

In order to simplify of embedding SAP HANA App or any other web app into SAP Business One, I have created a container Add-On named “B1xAppContainerAddOn”, which can embed your HANA Apps or any other web apps into B1 with configuration. The sample screenshot as below:

For HANA App:

MyWebApp_HANA.png

For any web app with a given URL:

MyWebApps_SF.png

The features of  B1xAppContainerAddOn

1.Customize menu item(s) in B1xAppContainerAddOn to open your multiple HANA app(s) or any other web app(s):

You can customize multiple menus in  to open several HANA apps or web apps. One menu entry for one web app.

The following options of menu can be customised within B1xAppMenus.xml located in the Add-On folder after installation.

-FatherUID: The father menu id of your menu, by default, it creates a sub folder name “My HANA App” on the top of B1 main menu.

-String: Caption of menu.

-Image: Replace the icon image file of your app with the same name “xApp_icon.png”.

-Position: the position index of menu, starting from 0.

TargetHANAxApp: If the target web app is a HANA app hosted in XSEinge of SAP HANA, specify the package of your entry page.

For example, the full path of your HANA app is open with URL like this. https://<HANAServer>:4300/B1SpatialDemo/ui/index.html

You just need to set the TargetHANAxApp as /B1SpatialDemo/ui/index.html and leave the TargetWebAppFullUrl as blank.

The tool will compose the full url for your HAAN app dynamically by adding the https://<HANAServer>:4300 in prior to TargetHANAxApp.

-TargetWebAppFullUrl: If you have web app which is not hosted in XSEninge of SAP HANA,for example, a web application hosted in IIS, then you can specify the TargetWebAppFullUrl as your web app url. Please noted that TargetWebAppFullUrl has higher priority than TargetHANAxApp, if WebAppFullPath is not empty, then it will be used as the target URL. The TargetHANAxApp will be ignored.

FormTitle: The title of your Web App Form, the default values as “My Web App”

PassB1CredInUrl: “true” or “false” to determine if current user’s B1 credential will be added to URL as parameters including CompanyDB, User and Language, which can be used in your target web app to support connection to dynamic B1 company schema to support multi B1 company.

For example:

https://<HANA_SERVER>:4300/B1SpatialDemo/ui/index.html?CompanyDB=SBODEMOUS&User=manager&Language=ln_English

-PassSLContextInUrl: “true” or “false” are possible values. If set to true the Service Layer Context will be passed in the URL, the SL context is obtained via UI API new SSO method available since B1H 9.2 version (for more information on SL SSO please check the blog http://scn.sap.com/community/business-one-sdk/blog/2016/07/01/sap-business-one-service-layer–sso-with-ui-api).

Url example:

https://<HANA_SERVER>:4300/B1SpatialDemo/ui/index.html?SLCONTEXT=B1SESSION=cd41846e-638f-11e6-8000-005056843a2;;HttpOnly;path=/b1s/v1;ROUTEID=.node2

Note: This feature is only implemented in the source code and not in the prepackaged addon executable and installer. You can download the source code from here.

In my HANA sample app, I have models and procedure deployed to SBODEMOUS, SBODEMOAU for Sales Analysis by Geospatial, using Server Side JavaScript(xsjs) to invoke the procedure to retrieve values from the models. To enable your HANA app work with multiple B1 company schemas, as a best practice, it is recommended to have the Company schema or company package dynamically as parameters into XSJS instead of a static company schema.

https://<HANASERVER>:4300/B1SpatialDemo/services/getCustomerList.xsjs?CompanyDB=SBODEMOUS&User=manager&Language=ln_English


An example of the B1xAppMenus.xml:

<?xml version=1.0encoding=UTF-16?>

<Application>

<Menus>

<action type=add>

<!–Menus for your B1xApp

       It will add an folder on top of B1 Menu.

       You can customize the menus as you like, except below

       1.The naming conversion of menu id as “B1xApp_n” (n=0~9), used to open the xApp.

       2.Image name “xApp_icon.png”, the icon file name must be “xApp_icon.png”.

–>

<Menu Checked=0Enabled=1FatherUID=43520Position=0String=My Web AppsType=2UniqueID=B1xAppImage={0}\xApp_icon.png>

        <Menus>

          <action type=add>

            <Menu Checked=0Enabled=1FatherUID=B1xAppPosition=0String=HANA App#1-Customer/Sales Ana on MapType=1UniqueID=B1xApp_1

                  TargetHANAxApp=/B1SpatialDemo/ui/index.htmlTargetWebAppFullUrl=“” PassB1CredInUrl=false PassSLContextInUrl=”true” FormTitle=Customer and Sales Analysis on Map/>

            <Menu Checked=0Enabled=1FatherUID=B1xAppPosition=1String=Web App#2-SuccessFactorType=1UniqueID=B1xApp_2

                  TargetHANAxApp=“” TargetWebAppFullUrl=https://pmsalesdemo8.successfactors.com/sf/home?_s.crb=RsKr8UXadKuYx%252bJKVgONbYDMjwY%253d

                  PassB1CredInUrl=trueFormTitle=HR – SuccessFactors – Dashboard/KPI/>

          </action>

        </Menus>

</Menu>

</action>

</Menus>

  </

Application>

As a result, the menus created as screenshot below:

HANA_Web_App_menus.png


2.A UI API form embedding a Web Browser to open the web app when click a menu entry

B1xAppContainerAddOn listen to the menu events for the menu id following the pattern “B1xApp_n”(n=0~9), open a UI API form embedding a web browser with the given target url and form title of the web app.

How to use B1xAppContainerAddOn?

You can download the lightweight Add-On package, Binary Files and source code of B1xAppContainerAddOn here.

Latest source code of the B1xAppContainerAddOn (containing the SLContext implementation) can be donwloaded from here.

Option 1: Using lightweight Add-On package of B1xAppContainerAddOn

The lightweight installer of B1xAppContainerAddOn is available as B1xAppContainerAddOn_LW_Installer.zip.  You can use import and deploy B1xAppContainerAddOn, then just configure the menus and your target web app in B1xAppMenu.xml after deployment.


Step 1: Download the lightweight installer B1xAppContainerAddOn_LW_Installer.zip from download area above

Step 2: Import the lightweight Add-On package (B1xAppContainerAddOn_LW_Installer.zip) through lightweight Add-On deployment (SAP Business One menu=>System=>Add-On=>Add-On Administration)

Step 3: Assign the extension to your target company and users.

Step 4: (If applicable) Deploy your HANA App or external web App

Step 5: Customize the menu caption, icon and B1xAppPath or WebAppFullPath etc as described above the B1xAppMenu.xml and B1xAppContainerAddOn.exe.config

Step 6: Start the Add-On from Add-On manager.

Please note that the HANA app or external web app will be deployed separately, and the Add-On name is fixed as “B1xAppContainerAddOn” in Add-On Manager. If you would like to package your own lightweight extension package including HANA app delivery unit and specific configuration for your solution, check option 2 below.

If you would like to learn more about the lightweight extension management, please check this document:  How to Package and Deploy SAP Business One Extensions for Lightweight Deployment in SAP Business One 9.1  (S-number login required)

Option 2: Package&Deploy your own lightweight Add-On Package with the binary files

You also can package your own lightweight extension with solution name and version management instead of fixed extension as B1xAppContainerAddOn in option 1. The executable files of the B1xAppContainerAddOn are also available in download area above as B1xAppContainerAddOn_executable.zip.


Step 1: (If applicable) Export your HANA App with HANA Studio,

File=>Export=>SAP HANA Content=>Delivery Unit.

Or deploy your external web app if necessary.

Step 2: Download and unzip the executable files (B1xAppContainerAddOn_executable.zip) from the download link above.

Step 3: Customize the menu caption, icon and B1xAppPath or WebAppFullPath etc as described above the B1xAppMenu.xml in the executable files in step 2.

Step 4: Package your own lightweight Add-On Package with ExtensionPackage tool, which can be found in the SDK installation folder. For example,

C:\Program Files (x86)\SAP\SAP Business One SDK\Tools\ExtensionPackage

Now you can enter the Extension name and version freely in the basic information page.

LW_Package_BasicInfo.png

In Extension File, so you can use them for both 32 bit and 64 bit client, for this B1xAppContainerAddOn Add-On is compiled with any cpu option.

LW_Package_32bit.png

If there is a HANA App delivery unit exported in step 1, now you can upload the delivery unit of your HANA extreme App in the App for the version for SAP HANA. Be sure that your HANA App Delivery Unit can be imported to your target HANA system; otherwise you may receive an error for uploading the HANA Delivery Unit.

Then finally click the Package button to save your package. As a result, a ready-to-use package will be created including everything in one package.

Step 5: Import your own lightweight Add-On package in step 3 through lightweight Add-On deployment (SAP Business One menu=>System=>Add-On=>Add-On Administration).

And the delivery unit of HANA App will be deployed when the package is deployed if HANA app is included in Step 3, so you don’t have to deploy the HANA App by manual.

Step 6: Start your Container Add-On for your Web Apps from Add-On manager.

Option 3: Source code of B1xAppContainerAddOn is provided above with AS-IS license for modification

Alternatively, if B1xAppContainerAddOn doesn’t accomplish your specific requirement to accommodate the web app,  source code of the tool is also available for your modification, and then follow the steps in option 2 to package and deploy it.

License&Support:

This B1xAppContainerAddOn tool and its source code are provided by SAP under SCN AS-IS license agreement.

No official support from SAP. If you have any question or feedback, you can leave a comment. I will do my best to reply. Thank you.

To report this post you need to login first.

7 Comments

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

  1. Kamil Hemidli

    Hi. I run the code and when I click to the menu the form opens. But it always shows “Loading data…” like in image.xapp.JPG

    How can I solve this? What is the problem?

    (0) 
    1. Maria Trinidad MARTINEZ GEA

      Hi Kamil,

      It is normal as the URL doesn’t show up correctly when passing the parameters (it hasn’t been designed for it).

      If you open the base URL in a WebBrowser you will see if works fine, but if you open it in a browser with the parameters this tool is providing then the page tries to analyze the parameters and keeps on Loading data status.

      Please try with your own pages, the objective of this tool is to allow to open your own web pages from B1 client and do SSO with Service Layer if required.

      Regards,

      Trinidad.

      (0) 
  2. Yeison Norena

     

    Hi Guys,

    I am trying to implement the incorporation of SAP HANA App into SAP Business One when I try to retrieve Xs Engine URL by SAP Business One UI API the value is an empty string.

    string ret_Url; 
    ret_Url = SBO_Application.XSEngineBaseURL;
    

    My question is what previous configuration is required to return the base URL of the XS engine in SAP Business One HANA?

    Thanks for your help.

    Best Regards,

    Yeison

    (0) 
  3. Andres Naranjo

    Hello everybody. 

     

    I have an application running in SAP Business One that calling a Web Page. I would like to use the functionality drill down in the Web Page for call Business One Objects. Do you have any idea that how can I do this action?

     

    Thanks a Lot.!!!

    (0) 
    1. Yatsea Li Post author

      Hi Andres,

      Not very sure about your scenario here.

      If you are after interact the web app with B1 client, such as open a B1 form from web app etc, you can use the B1 mashup API in B1 App framework to achieve this.

      Please add the belowJavaScript library to your page, then call the openForm function below.

      <script src=”/sap/sbo/platform/js/webbridge.js”></script>

      Open Forms in SAP Business One

      • openForm(table: BoTable, key: string): void

      //javascript sample code below to open AR Invoice for DocEntry 1 from the web app.
      var BoTable = sap.sbo.webbridge.BoTable;
      sap.sbo.webbridge.openForm(BoTable.Invoice, “1”);

      or

      sap.sbo.webbridge.openForm(“OINV”, “1”);

      Please refer to the note below for details

      Note 1858188 Extreme App Framework for SAP Business One: Samples and Documentation

      =>Attachment:Working with App Framework for SAP Business One 9.1, version for SAP HANA

      or download the document from PartnerEdge(S-number login required)

      https://partneredge.sap.com/en/library/assets/products/ent_mng/sbo/about/sbo_b1h/versions/htg_sbo_b1h_91/hat_htg_sbo_b1h_appfrmwrk_91.html

      Kind Regards, Yatsea

      (0) 

Leave a Reply