Managing Menus and Reports in SXP Employee


First published on: 08/10/2023/6:54 pm

 

 

You can configure menus and reports using SXP Manager Add-On for SAP Business One. Multi-level menus are configurable via a flexible menu setup that provides easy navigation for users to access content within SXP Employee.

 

Configuring Menu Entries and Options

Menu entries define the clickable links web users see. Each menu entry is tied to a menu option (report, static link, collection, etc.), which must be configured before the menu entry (web link) is set up. Menu options (e.g., reports) may be reused in multiple menu entries (web links), but generally, each menu entry is tied to a single menu option and vice versa.

 

The walkthrough below shows how to configure menu entries and their corresponding menu options for display on the web.

 

1. In SAP Business One, start SXP Manager Add-On.

2. Open SXP Manager AddOn > Manage Menu to bring up the 'Menus' dialogue.

 

 

SXP Manager AddOn - Manage Menus entry.

 

3. Open the 'Edit Menu Entries' screen by pressing the + button (for new menu entries) or using the golden arrow (for existing menu entries).

 

 

'Manage Menu' dialogue: Select the Application (1) and menu (2) from the dropdown. Add a new category (3) or remove a selected category (4). Move the selected menu entry left (5) or right (6) to nest or un-nest it. Edit menu entry details (7). Move the selected menu entry up or down in the menu using the arrows (8) and (9).

 

4. Complete the menu entry details:

 

 

Web name (1); type of menu entry and link to type details, if applicable (2); linked menu option details (3); menu icon, if desired (4); custom CSS class for alternate icons (5); optional CSS class (6); position of the menu entry relative to the selected entry (7); active flag (8).

 

  • Name: The web-friendly name for this menu entry, as it should appear to the end user.

  • Type: Sets the type of this menu entry. Valid options are:

  • Link: This points to the menu option details for this menu entry. This is not applicable to category menu entries.

    For example, if the type is set to “Static”, the link points to the specific static link details; if the type is 'Grid', the link points to the specific query details.

  • Menu icon: If desired, an icon can be assigned to the menu entry. This loads a font-awesome icon in front of the menu entry.

     

The best practice recommendation is to set an icon for all top-level menu entries. Sub-entries should only contain icons on rare instances for entries that are important or common. For example: In an admin sub-menu, the “Time Sheet” static link might have an icon because everyone uses it daily, whereas remaining admin reports wouldn't have icons.

 

 

Sample top-level menu entries with leading icons.

 

  • Opt CSS class: If desired, a CSS class can be applied to the menu entry, allowing for a font-awesome icon to be displayed before the entry. Don't use this option if a menu icon has already been applied.

    The best practice recommendation for menu icons applies here.

  • Position: This section is mostly informational, although it can be used to make minor position adjustments to the menu entry. Use the main 'Menu Management' screen to move entries.

  • Active: When checked, the menu entry will be available for users with the necessary roles. When unchecked, the menu won't be displayed for anyone.

 

Creating Menu Options (Reports, Static Links, etc.)

Menu options define the details of what’s linked on the web (e.g., reports, static links, or collections). Menu options are the details displayed by menu entries and can be configured as part of the menu entry setup. They can also be managed separately using the 'Manage Reports' section of InterConnect Manager Add-On in SAP Business One.

 

You can access menu option details in one of the following ways:

  • Go to InterConnect Manager AddOn > Manage Menu, then select the application and menu. Edit an existing menu option using the golden arrow drill-down link under the 'Item Name' column.

 

To edit an existing menu option's details, go to 'Manage Menu' (1); select an application (2), menu (3), and menu option (4), then edit (4) or add (5) menu option details.
 

  • Go to InterConnect Manager AddOn > Manage Menu, then select the application and menu. Add or edit a menu entry, then select the menu entry type and open the menu option details using the golden arrow drilldown

 

 

To edit menu option details for a new or existing menu entry, go to 'Manage Menu' (1); select an application (2) and menu (3), then add (4) or edit (5) a menu entry; select type (6) and edit the menu option (7); open the menu option details (8), or create a new menu option (9).

 
  • Go to SXP Manager AddOn > Manage Reports, select an application, then add or edit a menu option. This tool lets you manage menu options (e.g., reports and static links) in the same way as the 'Manage Menu' screen but doesn't require a menu entry before the menu option can be configured. Its primary purpose is to let you manage options (e.g., reports) that have been orphaned (i.e., they no longer have a menu entry).

 

 

Open 'Manage Reports' (1); select the application (2); add (3) or edit (4) a menu option.

 

 

Once the 'Menu Option Details' screen is open, you can edit it as follows:

  1. Assign a name. This is an admin-friendly name that will not be displayed to a web user.

  2. Select the type.

  3. Assign roles that are permitted to access this report. This will determine whether the related menu entry appears on the web.

  4. Configure option-specific details (see the relevant section below).

 

Creating static menu options

Static menu options define links, either within the SXP Portal or on an external website page. They can open in a new tab (for external pages) or within the current window (for sub-pages within the SXP Portal website).

 

 

For static menu options (1), assign roles (2) and configure link info (3). Set URL (4) and where the link opens (5).

 

To configure a static link menu option, open the menu option as described above, then complete the following setup:

  1. Set the URL to the desired link. You can use this for internal links (e.g., customizations) or external links (e.g., corporate resources).

  2. Set the open link “target”.
    • Choose _blank to open the link in a new window.
    • Choose _self to open the link in the current window.
    • Choose iframe to open the link within an iframe. This can be used in customizations to open certain links within a customized iframe pane.
  3. Press OK to apply changes.

 

 

Creating report menu options (grids, pivots, charts)

Report menu options link directly to a configured report (either a grid, pivot, or chart). General report setup is the same for all three types. However, pivot and chart queries have restrictions on their setups in SAP Business One.

 

All queries must belong to a category starting with B1WebAPI_. For example, B1WebAPI_CP indicates queries used by Customer Portal, while B1WebAPI_SU indicates queries used by Sales User for Employee Portal.

 

 The best practice is to create a category B1WebAPI_Custom to accommodate custom queries.

 

Grids - query setup

Grid reports are a straightforward way to display B1 query data on the web. Any query may be displayed as a grid.

 

In some cases, there can be multiple similar reports whose only differences are the displayed fields. In this case, consider using a single report with different report view layouts. This will allow web users to see the layout that best suits their needs and minimizes the number of reports you must manage.

 

 

In the 'Query Info' section (3), select a query category (4) and query (5). Set the cache duration (6).

 

You can configure grid reports to use any query belonging to a B1WebAPI_ category.

 

Pivot and chart query setup

The query requirements for pivots and charts are the same (referred to below as pivot reports).

 

A pivot report concisely displays values over time (e.g., sales reports or cost analysis reports). By configuring multiple report views, the same query can display different views of the same data.

 

For example, you can configure a general sales report with different views for year-to-date versus month-to-date sales figures. Both views rely on the same basic query, but the data is targeted for different purposes.

 

Once you've fully configured a chart and users can access it, you can configure report views for different chart layouts. An admin may do this to provide a good starting point for reporting that needs a good visual reference (see 'Report Views' below).

 

On the web, you can configure a chart layout using the 'Advanced' menu by dragging and dropping fields into the pivot at the bottom of the page. If no pivot is visible, open the advanced menu and ensure the option 'Show Grid' is enabled.

 

Chart options

Advanced chart options can be configured to display different charts with the same query. Options are described below.

 

Option

Description

Chart type Determines how the data is displayed.
Palette The color scheme for the selected chart.
Chart width The pixel width of the chart area, including labels.
Chart height The pixel height of the chart area, including labels.
Show grid If enabled, shows the pivot grid, which determines the data to display in the chart.
Show legend If enabled, shows a legend of different data types. What the legend displays depends on the chart type. For example, line charts display a legend of lines, while stacked bar charts display a legend of stack segments.

Pie, doughnut, and funnel chart types can’t show legends for multiple data sets.
Show column totals Not used.
Show row totals Not used.
Show point labels

If enabled, shows labels for data points on the chart.

 

Doesn't work for all charts but is especially useful for pie, doughnut, and funnel charts.

 

 

Chart type advanced options

 

Y = Supported    |    NS = Not Supported    |     cs = Conditionally Supported

Chart Type Show Grid Show Legend Show Column Totals Show Row Totals Show Point Labels
Bar Charts Y Y NS NS NS
Stacked Bar Charts Y Y NS NS NS
Full Stacked Bar Charts Y Y NS NS NS
Side by Side Full Stacked Bar Charts Y Y NS NS NS
Pie Charts Y cs NS NS Y
Doughnut Charts Y cs NS NS Y
Funnel Charts Y cs NS NS Y
Point Charts Y Y NS NS NS
Line Charts Y Y NS NS NS
Stacked Line Charts Y Y NS NS NS
Full Stacked Line Charts Y Y NS NS NS
Step Line Charts Y Y NS NS NS

 

 

Chart type advanced options (continued)

 

Y = Supported    |    NS = Not Supported    |     cs = Conditionally Supported

Chart Type Show Grid Show Legend Show Column Totals Show Row Totals Show Point Labels
Spline Charts Y Y NS NS NS
Scatter Line Charts Y Y NS NS NS
Swift Plot Charts Y Y NS NS NS
 Area Charts Y Y NS NS NS
Step Area Charts Y Y NS NS NS
Spline Area Charts Y Y NS NS NS
Stacked Area Charts Y Y NS NS NS
Stacked Spline Area Charts Y Y NS NS NS
Full Stacked Area Charts Y Y NS NS NS
Full Stacked Spline Area Charts Y Y NS NS NS
Range Area Charts Y Y NS NS NS
Radar Point Charts Y Y NS NS NS

 

 

Chart type advanced options (continued)

 

Y = Supported    |    NS = Not Supported    |     cs = Conditionally Supported

Chart Type Show Grid Show Legend Show Column Totals Show Row Totals Show Point Labels
Radra Line Charts Y Y NS NS NS
Radar Area Charts Y Y NS NS NS
Bar 3D Charts Y Y NS NS NS

Stacked Bar 3D Charts

Y Y NS NS

NS

Full Stacked Bar 3D Charts Y Y NS NS NS
Manhattan Bar Charts Y Y NS NS NS
Side By Side Stacked Bar Charts Y Y NS NS NS
Side By Side Full Stacked Bar 3D Charts Y Y NS NS NS
Pie 3D Charts Y cs NS NS Y
Doughnut 3D Charts Y cs NS NS Y
Funnel 3D Charts Y cs NS NS Y
Line 3D Charts Y Y NS NS NS

 

 

Chart type advanced options (continued)

 

Y = Supported    |    NS = Not Supported    |     cs = Conditionally Supported

Stacked Line 3D Charts Y Y NS NS NS
Full Stacked Line 3D Charts Y Y NS NS NS
Step Line 3D Charts Y Y NS NS NS
Area 3D Charts Y Y NS NS

NS

Stacked Area 3D Charts Y Y NS NS

NS

Full Stacked Area 3D Charts Y Y NS NS

NS

Step Area 3D Charts Y Y NS NS

NS

Spline 3D Charts Y Y NS NS

Y

Spline Area 3D Charts Y Y NS NS

NS

Stacked Spline Area 3D Charts Y Y NS NS

NS

Full Stacked Spline Area 3D Charts Y Y NS NS

NS

Range Area 3D Charts Y Y NS NS

Y

 

Example: Configuring a line chart

To display details in a line chart, drag and drop the fields as follows:

  • The left-hand column should contain dates. Example 1 shows the year and month for all time. Example 2 shows year and month with a filter for 2015/2016.
  • The upper-left section is for amounts (sales totals, quantities, etc.). Example 1 shows the dollar amount of the sales; example 2 shows the quantity of items sold.
  • The top row may optionally contain categories for the data (e.g., item groups). Neither example uses that option.

 

 

 

Line chart example 1: Sales trends over time.

Left fields: Date_year/date_month. Top field: Blank. Upper-left data field: Amount

 

 

 

 

Line chart example 2: Sales quantities for two years.

Left fields: Date_year (filtered for two years)/date_month. Top field: Blank. Upper-left data field: Quantity

 

Example: Configuring a pie chart

To display details in a pie chart, drag and drop the fields as follows:

  • The left-hand column contains the field to assess the data (typically, date fields). Both examples show years filtered to 2015/2016.
  • The upper-left section is for amounts (sales totals, quantities, etc.). Both examples show sales total amounts.
  • The top row may optionally contain categories for the data (e.g., item groups). This shows a distinct chart for every data category. Example 1 doesn’t break down the analysis, but example 2 shows data broken down by item group.

Pie chart example 1: Sales comparison between 2015 and 2016.

Left field: Date_year (filtered for two years). Top field: Blank. Upper-left data field: Amount.

 

 

Pie chart example 2: Sales comparison between each item group.

Left field: Date_year (filtered for two years). Top field: Item group. Upper-left data field: Amount.

 

 

Example: Configuring a stacked bar chart

To display details in a stacked bar chart, drag and drop the fields as follows:

  • The left-hand column contains the field to assess the data (typically, date fields). The example below shows breakdowns by year/month.
  • The upper-left section is for amounts (sales totals, quantities, etc.). This example shows amounts spent by the logged-in customer.
  • The top row contains categories for the data, the “stack” of the stacked bar (e.g., item groups). This example breaks down sales within a timeframe by item group.

 

Stacked bar chart example 1: Customer purchases by item group. Left: Date_year/date_month. Right: Item group. Upper-left data: Line total

 

Parameters for reports

Any type of query-based report (grid, pivot, or chart) can include parameters. Parameters can optionally be applied to a query to be configured within a menu option.

 

You can include parameters in a query with the following syntax: [%myParam]

 

The following query includes parameters for SLPCodeStartDate, and EndDate:

SELECT
   Top 100
   O1.DocEntry AS 'ID',
   O1.DocNum as 'RefNum',
   O1.CardCode as 'bp Code',
   O1.CardName as 'bp name',
   O1.DocDate as 'Date'
   O1.NumAtCard as 'CustRefNum',
   CASE
       WHEN O1.CANCELED =
'Y' THEN 'Cancelled'
       WHEN O1.DocStatus = 'C' THEN 'Closed'
       ELSE 'Open'
   END As Status,
   O1.DocTotal as
'Total $'
FROM ORDR O1

WHERE (O1.SLPCODE = [%SLPCODE])  
   AND (O1.DocDate >= [%StartDate])
   AND (O1.DocDate <= [%EndDate])
ORDER BY O1.DocDate DESC

 

You can configure parameters with specific values (e.g., you can pull SLPCODE from the current user’s assigned salesperson) or allow users to specify their value (e.g., with a dropdown or free-text field).

 

Configuring parameters

You can define parameters populated automatically in the report menu option window on the 'Parameters' tab.

 

Set the Parameter Type to 'Profile (Xpath)' and select the appropriate value to populate that parameter.

 

For example, if the report is specific to a salesperson, select 'EM: SlpCode' to assign the logged-in employee ('EM') user’s salesperson code (“SlpCode”).

 

Configuring user-specified parameters

User-supplied parameters (USPs) allow the web user to define the info used by the report query. You can configure the USPs as described below. Select the Parameter Type “User Supplied” and configure the desired type.

 

Supported parameter types are:

  • DateTime
  • Decimal
  • Integer
  • List
  • Query
  • Text
DateTime

DateTime parameters allow web users to select a date using a browser-friendly date picker. 

You can set a default date.

 

Decimal, Integer, Text

These parameter types allow web users to enter a value into a field.

You can set a default value.

 

List

List parameters allow web users to select an option from a drop-down list of pre-supplied values.

 

For every option users should see in the dropdown, press the plus button to add a new list option. Fill in the choice text (the text seen by the user) and populate the value (the value assigned to the query parameter when the user chooses the option). Use the up/down arrows on the right to sort the options.

You can set a default value.

 

Query

Query parameters allow web users to select an option from a drop-down list, as supplied by a query.

 

First, create a query to define the drop-down options. The first query column will define what's passed to the report when a user selects the option, while the second query column will define what's shown to users. For example, for a list of all salespeople, we could define the query:

 

  SELECT SlpCode, SlpName
  FROM OSLP
  WHERE SlpCode >
0

 

No default value can be defined for query-based user-supplied parameters.

 

Multi-currency query building

Reporting in multi-currency environments requires additional query configuration that’s not required in a single-currency environment. To simplify the creation of robust multi-currency reports, SXP provides pre-configured SQL functions in addition to queries already configured to use those functions.

 

These functions automatically return either the local currency or the foreign currency, whichever is appropriate for the given business partner.

 

On SQL, these functions can be accessed within a B1 query (e.g., within the query B1WebAPI_CP/OpenOrders).

 

On HANA, these functions are accessibe from within a stored procedure only, so custom queries that require multi-currency support must be created as stored procedures in HANA Studio. These queries can then be referenced from within SAP Business One, as shown in the HANA example below. An out-of-the-box example of this on Hana can be found in the query B1WebAPI_CP/OpenOrders.

 

If you have a single-currency query already, you can convert this to a multi-currency query like this:

 

  1. Identify any currency fields in your single-currency query with a “Foreign Currency” counterpart (for example, DocTotal and DocTotalFC or VatSum and VatSumFC).
  2. Include a column for the currency ISO code within your query. This will clearly show the user which currency is being displayed in the query. (E.g., $100 USD versus $100 CAD.)
  3. Use the following functions to display multi-currency details:
    • SQL Server:
      • dbo.ZEDS_CPSelectAmount(<Card Code>, <Local Currency Field>, <Foreign Currency Field>) (Customer Portal)dbo.ZEDS_EPSelectAmount(<Card Code>, <Local Currency Field>, <Foreign Currency Field>) (Employee Portal) - This will identify the correct value (local currency or foreign currency) based on the given card code.
      • dbo.ZEDS_CPCurrency(<Card Code>) (SXP Customer) / dbo.ZEDS_EPCurrency(<Card Code>) (SXP Employee) - This will identify which currency ISO code is used by the given card code.
    • HANA:
      • NOTE: Hana functions cannot be installed automatically due to a known SAP Hana issue. As a workaround, these functions can be installed manually within Hana Studio. Refer to 'Applying Product Licenses - Hana Function Installation'.
      • "ZEDS_CPSelectAmount" (IN CardCode varchar(50), OUT IsFC tinyint) (Customer Portal) / "ZEDS_EPSelectAmount" (IN CardCode varchar(50), OUT IsFC tinyint) (SXP Employee) - This will set the flag IsFC (Is Foreign Currency) to 0 or 1 for the indicated business partner (BP). 1 indicates the BP is using a foreign currency. 0 indicates that the BP is using either the local currency or is set to use “All currencies”.
      • "ZEDS_CPCurrency" (IN CardCode varchar(15), OUT curCode varchar(3)) (Customer Portal) / "ZEDS_EPCurrency" (IN CardCode varchar(15), OUT curCode varchar(3)) (SXP Employee) - This will set the currency code curCode to the indicated BP’s currency.

 

Multi-currency query building - SQL example: Display all invoices for the current user

In this scenario, we’re starting with a SQL query that displays all invoices for the specified CardCode, but only in the local currency. This means a customer who performs all transactions in EUR will see USD values (assuming a USD company).

 

Note that this is specific to SQL. For a Hana version of this example, see the following section.

SELECT
    O1.DocEntry,

    NumAtCard as 'Ref #.',
    CASE DocStatus
        WHEN 'O' THEN 'Open'
        WHEN 'C' THEN 'Closed'
        ELSE 'Not for sale'
    END as 'Status',
    O1.BPLName as 'Branch',
    O1.DocDate as 'Invoice Date',
    O1.DocDueDate as 'Due Date',
    O1.VatSum as '$Tax',
    O1.DocTotal as '$Grand Total'
FROM OINV O1
WHERE O1.CARDCODE = [%cardcode]
    AND ISNULL(O1.U_zed_ShowCP, 'Y') <> 'N'
ORDER BY O1.DocEntry DESC

To make this compatible with mutli-currency environments, we need to update the query as follows:

 

Identify any currency fields with a “Foreign Currency” counterpart.

 

This query has VatSum and DocTotal fields with foreign currency alternate values (VatSumFC and DocTotalFC, respectively), as highlighted below.

 

SELECT
    O1.DocEntry,
    NumAtCard as
'Ref #.',
    CASE DocStatus
        WHEN 'O' THEN 'Open'
        WHEN 'C' THEN 'Closed'
        ELSE 'Not for sale'
    END as 'Status',
    O1.BPLName as 'Branch',
    O1.DocDate as 'Invoice Date',
    O1.DocDueDate as 'Due Date',
    O1.VatSum as '$Tax', -- LOCAL Tax amount
    O1.DocTotal as '$Grand Total' -- LOCAL Doc Total amount
FROM OINV O1
WHERE O1.CARDCODE = [%cardcode]

    AND ISNULL(O1.U_zed_ShowCP, 'Y') <> 'N'
ORDER BY O1.DocEntry DESC

 

Add a column for the currency

 

Now that we’ve identified the fields with foreign alternatives, we need to add a field to identify which currency is being displayed, as highlighted below:

 

SELECT
    O1.DocEntry,
    NumAtCard as
'Ref #.',
    CASE DocStatus
        WHEN 'O' THEN 'Open'
        WHEN 'C' THEN 'Closed'
        ELSE 'Not for sale'
    END as 'Status',
    O1.BPLName as 'Branch',
    O1.DocDate as 'Invoice Date',
    O1.DocDueDate as 'Due Date',
    O1.VatSum as '$Tax',
    O1.DocTotal as '$Grand Total'
    , dbo.ZEDS_CPCurrency(O1.CardCode) as 'Currency' -- NEW Currency ISO Code field
FROM OINV O1
WHERE O1.CARDCODE = [%cardcode]
    AND ISNULL(O1.U_zed_ShowCP,
'Y') <> 'N'
ORDER BY O1.DocEntry DESC

 

Use the FC functions

 

Now, we need to update the query so it pulls the correct currency values to match the BP’s currency with the ZEDS_CPSelectAmount function, as shown below:

SELECT
    O1.DocEntry,
    NumAtCard as 'Ref #.',
    CASE DocStatus
        WHEN 'O' THEN 'Open'
        WHEN 'C' THEN 'Closed'
        ELSE 'Not for sale'
    END as 'Status',
    O1.BPLName as 'Branch',
    O1.DocDate as 'Invoice Date',
    O1.DocDueDate as 'Due Date',
    dbo.ZEDS_CPSelectAmount(O1.CardCode,O1.VatSum, O1.VatSumFC) as '$Tax', -- NEW Dynamically selected Tax amount (Local or Foreign)
    dbo.ZEDS_CPSelectAmount(O1.CardCode, O1.DocTotal, O1.DocTotalFC) as '$Grand Total' -- NEW Dynamically selected Doc Total amount (Local or Foreign)
    , dbo.ZEDS_CPCurrency(O1.CardCode) as 'Currency'
FROM OINV O1
WHERE O1.CARDCODE = [%cardcode]
    AND ISNULL(O1.U_zed_ShowCP,
'Y') <> 'N'
ORDER BY O1.DocEntry DESC

 

The result is a query that displays the current user’s currency details (whether foreign or local):

SELECT
    O1.DocEntry,
    NumAtCard as 'Ref #.',
    CASE DocStatus
        WHEN 'O' THEN 'Open'
        WHEN 'C' THEN 'Closed'
        ELSE 'Not for sale'
    END as 'Status',
    O1.BPLName as 'Branch',
    O1.DocDate as 'Invoice Date',
    O1.DocDueDate as 'Due Date',
    dbo.ZEDS_CPSelectAmount(O1.CardCode,O1.VatSum, O1.VatSumFC) as '$Tax',
    dbo.ZEDS_CPSelectAmount(O1.CardCode, O1.DocTotal, O1.DocTotalFC) as '$Grand Total'
    , dbo.ZEDS_CPCurrency(O1.CardCode) as 'Currency'
FROM OINV O1
WHERE O1.CARDCODE = [%cardcode]
    AND ISNULL(O1.U_zed_ShowCP,
'Y') <> 'N'
ORDER BY O1.DocEntry DESC

 

Multi-currency query building - HANA example: Display all invoices for the current user

In this scenario, we’re starting with a Hana query that displays all invoices for the specified CardCode, but only in the local currency. This means a customer who performs all transactions in EUR will see USD values (assuming a USD company).

 

This is specific to Hana. For a SQL version of this example, see the previous section.

 

Unlike SQL functions, which can be executed from within B1 queries directly, Hana functions that contain parameters must be executed from 'Stored Procedures'. As such, this walkthrough provides the stored procedure with query logic and the B1 call to that stored procedure.

 

Originally, our Hana query is a B1 query:

SELECT O1."DocEntry", O1."DocNum", O1."DocDate" AS "Date", O1."NumAtCard" AS "Your Ref #",
    CASE
        WHEN O1."CANCELED" = 'Y' THEN 'Cancelled'
        WHEN O1."DocStatus" = 'C' THEN 'Closed'
        ELSE 'Open'
    END AS "Status",
   
"DocTotal" AS "Total $"
FROM OINV O1
WHERE O1.
"CardCode" = [%CardCode]
  AND IFNULL(O1.
"U_zed_ShowCP", 'Y') <> 'N'
ORDER BY O1."DocEntry" DESC;

 

Starting with our B1 query, we must convert this standard Hana query into a stored procedure, taking care to convert the parameters from B1 syntax into Hana.

 

We’ll then replace our query in B1 with a call to the new stored procedure. This sets us up to use the necessary parameters within the new stored procedure.

 

New Hana stored procedure (which contains the query logic):

CREATE PROCEDURE "ZEDS_CustomQuery" (CardCode nvarchar(20) )
AS
BEGIN
SELECT
O1.
"DocEntry", O1."DocNum", O1."DocDate" AS "Date", O1."NumAtCard" AS "Your Ref #",
    CASE
        WHEN O1.
"CANCELED" = 'Y' THEN 'Cancelled'
        WHEN O1."DocStatus" = 'C' THEN 'Closed'
        ELSE 'Open'
    END AS "Status",
   
"DocTotal" AS "Total $"
FROM OINV O1
WHERE O1.
"CardCode" = :CardCode -- CONVERT the B1 parameter into a Hana parameter
  AND IFNULL(O1."U_zed_ShowCP", 'Y') <> 'N'
ORDER BY O1."DocEntry" DESC;
END;

 

Updated B1 query that calls the stored procedure:

CALL "ZEDS_CustomQuery"([%CardCode] )

 

Now that the query has been converted into a Hana stored procedure, we can proceed the same as in SQL.

 

To make this compatible with mutli-currency environments, we need to update the query as follows:

 

Identify any currency fields with a “Foreign Currency” counterpart.

 

This query has a single currency field: DocTotal, which has a foreign currency alternate value DocTotalFC, as highlighted below.

 

CREATE PROCEDURE "ZEDS_CustomQuery" (CardCode nvarchar(20) )
AS
BEGIN

SELECT O1."DocEntry", O1."DocNum", O1."DocDate" AS "Date", O1."NumAtCard" AS "Your Ref #",
    CASE
        WHEN O1.
"CANCELED" = 'Y' THEN 'Cancelled'
        WHEN O1."DocStatus" = 'C' THEN 'Closed'
        ELSE 'Open'
    END AS "Status",
   
"DocTotal" AS "Total $" -- LOCAL Doc Total amount
FROM OINV O1
WHERE O1.
"CardCode" = :CardCode
  AND IFNULL(O1.
"U_zed_ShowCP", 'Y') <> 'N'
ORDER BY O1."DocEntry" DESC;
END;

 

Add a column for the currency

 

Now that we’ve identified the fields with foreign alternatives, we need to add a field to identify which currency is being displayed, as highlighted below:

 

CREATE PROCEDURE "ZEDS_CustomQuery" (CardCode nvarchar(20) )
AS
currStr varchar(3); -- NEW Parameter to capture the Currency Code string
BEGIN
CALL
"ZEDS_CPCurrency" (:CardCode, currStr);
SELECT O1.
"DocEntry", O1."DocNum", O1."DocDate" AS "Date", O1."NumAtCard" AS "Your Ref #",
    CASE
        WHEN O1.
"CANCELED" = 'Y' THEN 'Cancelled'
        WHEN O1."DocStatus" = 'C' THEN 'Closed'
        ELSE 'Open'
    END AS "Status",
   
"DocTotal" AS "Total $"
    , :currStr AS "Currency" -- NEW Currency ISO Code field, the value will be populated later...
FROM OINV O1
WHERE O1.
"CardCode" = :CardCode
  AND IFNULL(O1.
"U_zed_ShowCP", 'Y') <> 'N'
ORDER BY O1."DocEntry" DESC;
END;

 

Use the FC functions

 

Now we need to update the query so it uses the “isLC” flag to identify the correct currency value to match the business partner’s currency, as shown below:

 

CREATE PROCEDURE "ZEDS_CustomQuery" (CardCode nvarchar(20) )
AS
isLC tinyint := 1; -- NEW Parameter to capture whether this is a Local Currency or not
currStr varchar(3);
BEGIN
CALL
"ZEDS_CPSelectAmount" (:CardCode, isLC);
CALL "
ZEDS_CPCurrency" (:CardCode, currStr);
SELECT O1.
"DocEntry", O1."DocNum", O1."DocDate" AS "Date", O1."NumAtCard" AS "Your Ref #",
    CASE
        WHEN O1.
"CANCELED" = 'Y' THEN 'Cancelled'
        WHEN O1."DocStatus" = 'C' THEN 'Closed'
        ELSE 'Open'
    END AS "Status",
    CASE :isLC -- NEW Case statement to determine which value to use
        WHEN 0 THEN "DocTotal"
        ELSE "DocTotalFC"
    END AS "Total $",
    :currStr AS
"Currency"
FROM OINV O1
WHERE O1.
"CardCode" = :CardCode
  AND IFNULL(O1.
"U_zed_ShowCP", 'Y') <> 'N'
ORDER BY O1."DocEntry" DESC;
END;

 

The result is a stored procedure that displays the current user’s currency details (whether foreign or local):

 

CREATE PROCEDURE "ZEDS_CustomQuery" (CardCode nvarchar(20) )
AS
isLC
tinyint := 1;
currStr
varchar(3);
BEGIN
CALL
"ZEDS_CPSelectAmount" (:CardCode, isLC);
CALL
"ZEDS_CPCurrency" (:CardCode, currStr);
SELECT O1.
"DocEntry", O1."DocNum", O1."DocDate" AS "Date", O1."NumAtCard" AS "Your Ref #",
    CASE
        WHEN O1.
"CANCELED" = 'Y' THEN 'Cancelled'
        WHEN O1."DocStatus" = 'C' THEN 'Closed'
        ELSE 'Open'
    END AS "Status",
    CASE :isLC
        WHEN
0 THEN "DocTotal"
        ELSE "DocTotalFC"
    END AS "Total $",
    :currStr AS
"Currency"
FROM OINV O1
WHERE O1.
"CardCode" = :CardCode
  AND IFNULL(O1.
"U_zed_ShowCP", 'Y') <> 'N'
ORDER BY O1."DocEntry" DESC;
END;

 

Positioning the Menu Entry

Active menu items are displayed on the SXP Portal in the order they're displayed on the manage menu screen.

 

To move a menu item, select the menu item and click the up/down arrows to move the menu item one level up or down.

 

Creating a sub-menu entry

If an existing top-level menu entry needs to become a sub-menu, select the top-level menu entry. Move it up or down so it's immediately below the desired parent menu entry. If that top-level menu entry already has child entries, “immediately below” means below those child entries.

 

Press the “move right” button (->) to make the selected menu entry a sub-menu entry of the one above it. First level sub-menu entries are identified by a “- -“ before the menu item name.

 

Eery additional level adds another “- -“ to the beginning of the menu entry name.

 

Making sub-menu entries into top-level entries

If a sub-menu entry needs to be a top-level menu entry, press the “move left” button (<-) until it’s at the correct level.

 

Golden arrow drilldowns

Golden arrow drilldowns can link reports to their details (e.g., an order summary report can be linked to the order details for each DocEntry, or a customer summary report can be linked to customer details for each customer).

 

Golden arrow drilldowns can be configured for query reports as described below. This configuration requires manual edits to the ZEDS_QUERYLINK user-defined window.

 

  1. In SAP Business One, open the user-defined window ZEDS_QUERYLINK (Portal Query Doc Link). To do this, go to Tools > User Defined Windows > ZEDS_QUERYLINK.

  2. Create a new row for every report link that requires a golden arrow drilldown:

    Field Definition
    Code This must be unique, such as CUSTOM001.
    Name Use something unique to describe the drilldown to an admin (e.g., Sales link BP).
    Linked query Select the query. If this is a custom query, it will likely be a number, which can be determined by looking at the ZEDS_QUERYMASTER UDT (user-defined table) in B1.
    Link column The column with link data such as 'BP Card Code' or 'Document Entry' number.
    Display column The column with the data that will be displayed, such as the BP name.
    URL template A URL with {0} to denote where the link column data will be loaded. See below for examples.
    Grid column title The label for the column on the website.
    URL open method If empty, this will open normally. You can also set it to _blank to open in a new window.
  3. Ensure that every link column and display column pair is unique. (I.e., if you wish to create two drilldowns, four fields are needed.)
  4. Ensure every link column and display column is spelled correctly. In Hana, case sensitivity must match both the source query and the ZEDS_QUERYLINK entry. Misspelled query columns will result in an error when attempting to load the report via the web.

 

Template reference

Below is a list of common link templates and their expected link data for each application. Some links are only available when certain roles or licenses are assigned to the user accessing the link.

 

Description URL Template Link Column Description Application
Activity details ~/SalesUser/Activities/view/{0} Version 92.7 and higher only.

ClgCode of the Activity.
SXP Employee 
Business partner details ~/SalesUser/#{0}/details Business Partner CardCode SXP Employee 
Credit memo document details ~/docviewers/CreditMemoDetails.aspx?b1datauri=/object/display/oCreditNotes/{0}.aspx DocEntry for the Credit Memo document

SXP

Partner

Delivery document details ~/docviewers/DeliveryDetails.aspx?b1datauri=/object/display/oDeliveryNotes/{0}.aspx DocEntry for the Delivery document SXP Partner 
SXP Employee 
Edit order ~/order/edit?type=o&docEntry={0} DocEntry for the order document SXP Partner SXP Employee
Edit quote ~/order/edit?type=q&docEntry={0} DocEntry for the quote document

SXP

Partner 

SXP
Employee

Invoice document details ~/docviewers/InvoiceDetails.aspx?b1datauri=/object/display/oInvoices/{0}.aspx DocEntry for the invoice document SXP Partner 
SXP Employee
Invoice document details - print layout ~/dcviewers/InvoiceDetailsPrint.aspx?b1datauri=/object/display/oInvoices/{0}.aspx DocEntry for the invoice document

SXP

Partner

Order document details ~/docviewers/salesorderdetails.aspx?b1datauri=/object/display/oOrders/{0}.aspx DocEntry for the order document

SXP Partner

SXP Employee 

Order document details - print layout ~/docviewers/SalesOrderDetailsPrint.aspx?b1datauri=/object/display/oOrders/{0}.aspx DocEntry for the order document SXP Partner
Payment document details ~/docviewers/PaymentDetails.aspx?b1datauri=/object/display/oIncomingPayments/{0}.aspx DocEntry for the payment document SXP Partner
Purchase invoice document details ~/docviewers/salesorderdetails.aspx?b1datauri=/object/display/oPurchaseInvoices/{0}.aspx DocEntry for the purchase invoice document SXP Partner
Purchase order document details ~/docviewers/salesorderdetails.aspx?b1datauri=/object/display/oPurchaseOrders/{0}.aspx DocEntry for the purchase order document SXP Partner
Quote document details ~/docviewers/QuoteDetails.aspx?b1datauri=/object/display/oQuotations/{0}.aspx DocEntry for the quote document SXP Partner
Quote document details ~/docviewers/SalesQuoteDetails.aspx?b1datauri=/object/display/oQuotations/{0}.aspx DocEntry for the quote document

SXP

Employee

Quote document details - print layout ~/docviewers/QuoteDetailsPrint.aspx?b1datauri=/object/display/oQuotations/{0}.aspx DocEntry for the quote document SXP Partner

 

Examples:

 

Sales order document details link for SXP Customer (1)

Sales order document details link for SXP Employee (2).

 

Business partner data golden arrow drilldown example

To configure a query for opening BP details as a drilldown, ensure the chosen query has both the BP card code and BP name as fields in the query. Then, configure the following details:

BP data golden arrow example (Employee Portal)

Field Value
Code (some unique code) BPEX01
Name (some unique name) BP Example 1
Linked query (select the query)
Link column CardCode (assuming the query returns the column CardCode)
Display column Name (assuming the query returns the column Name)
URL template For Employee Portal, use the URL template: ~/salesuser/businesspartner/viewlist.aspx?objectcode={0}&CACHEOUT=true
Grid column title Business Partner
URL open method (leave blank)

 

Report Views

Report views allow users to see different views of the same report, including custom views of specific columns and filters.

 

For example, one view might filter based on a date range, while another view might group data based on customer name. Examples of charts that use report views are outlined above.

 

Default layouts

A default layout for a chart, grid, or pivot report will load automatically when a user visits that report. A default layout allows users to revert to a known layout, which can be controlled by the admin.

 

The default view can be refreshed by selecting the view from the view dropdown or reloading the query using the left-hand menu.

 

If a layout is changed, an asterisk (*) will be displayed next to the name in the saved layouts dropdown to indicate unsaved changes.

 

A default layout can be deleted by clicking “Delete” from the saved layout dropdown.

Setting default layouts for all users (admin users only)

  • Log in to the Employee Portal website as a user with the 'Report View Editor' role (see 'Updating Employee Portal Configuration Settings - Report View Settings' tab for more information).

  • View a report and make changes that should be visible each time the report is loaded by any user.
  • Click on the gear icon to display advanced options.
  • Click the 'Save Layout As' button.
  • Click the button “Set default for all users”. If you don't enter a name for the layout, it will be named “Default (G)”.

Steps to update a layout

  • Log in to the SXP Employee Portal website normally.

  • View a report and make changes that should be visible each time the report is loaded.
  • Click on the advanced options icon.
  • Press the 'Save Layout' button. This will overwrite the previous saved view with the current view.
  • Any changes will be saved into a table within SAP Business One. These changes will display automatically every time the report is accessed.
  • When the layout has been saved, a new entry will be available in the 'Saved Layouts' dropdown.
 Note: Super users can save a default layout for only themselves by clicking 'Save Layout'.

If another user loads a global default and makes changes, they must save those changes under a different name. There is no 'Save As' button when a non-super user is viewing a global default layout.

 

Named layouts

With the Portals, customized chart, grid, or pivot report layouts can be created and saved for later reuse. These custom report views can be loaded from the 'Named Layouts' dropdown of the report’s page.

 

When a layout changes, an asterisk (*) will be displayed next to the name in the saved layouts dropdown to indicate there are unsaved changes. Once the changes have been saved, this asterisk will disappear.

 

Using the 'Save Layout' button to save changes will overwrite the existing version of that report view. To create a new view, use the 'Save Layout As…' button and give the report view a different name. Global named report layouts can't be edited by non-admin users; however, they are viewable by all users. Personal named report layouts can be edited by a user; however, they can only be viewed by the user who created it.

 

To delete a named layout, use the delete link next to the layout. Note that only personal report views can be deleted by non-admin users.

Saving a named layout

To save a named layout for personal use:

  1. Log in to the SXP Employee Portal website normally.

  2. Open a report and make the desired change(s).
  3. Press the 'Advanced Options' icon.
  4. Press 'Save Layout As…' to save a new report view.
  5. Enter a name for the new layout and press OK.
  6. Once the named layout has been saved to a user’s account, it will only be available to that user.

 

Saving a named layout for all users (admin users only)

To save a named layout for global use, the user saving the layout must be assigned the 'Report View Editor' role (see 'Updating Employee Portal Configuration Settings - Report View Settings tab').

  1. Log in to the SXP Employee Portal website normally.

  2. Open a report and make the desired change(s).
  3. Press the 'Advanced Options' icon.
  4. Press 'Save Layout As…' to save a new report view.
  5. Enter a name for the new layout, place a checkmark in the 'Available to All Users' checkbox, and press OK.
  6. Once the named layout has been saved, it will appear in the named layout dropdown for all users.

 

Other Menu Entry Management Tasks

Deleting a menu entry

Delete a menu entry by selecting the entry in the left-most column and using the delete button “-“ marked in the screenshot below.

 

Select a menu entry, then delete it using the - button (3).

 

Best practices for menu entry setup

Don’t make menus too deep. Menus may be set up in as many levels as desired. However, if items are buried too many levels down, users may not easily find what they want. Aim for 2-4 menu levels for moderately sized navigation.

 

Keep icons tidy. Icons should be applied at the top-level menu items. They help with navigating a multi-level menu by providing an at-a-glance context for where a user is within the site. Sub-menu options typically don’t need icons, as they have enough context based on their parent menu’s icons. (In short: when it comes to icons, less is more.)

 

Don’t over-crowd menus. If too many items are in a menu, it will be hard for users to find what they want. Keep the number of items around six or fewer. Consider splitting a menu into sub-menus if it grows to more than a dozen items.

 

SXP Employee Standard Reports

Out-of-the-box reports, their supporting queries, and the user roles that enable these reports are listed below. These reports can be modified within a system, so the details below are for initial installation and can be configured differently within a B1 company to meet business needs.

 

Super is a special SXP Employee role that permits access to all menu entries and reports. Otherwise, the specific user roles below must be assigned to a user before they can view the menu entry or report.

 

B1WebAPI categories securely host content meant to be accessed via the web. Categories used by Employee Portal include:

  • B1WebAPI - This category contains system queries not meant to be customized.
  • B1WebAPI_Dashboard - This category contains report queries related to the dashboards feature.
  • B1WebAPI_Expense - This category contains report queries related to Expense User features.
  • B1WebAPI_QueryPortal - This category contains report queries for all portals.
  • B1WebAPI_SU - This category contains report queries related to Sales User features.

 

Report Feature B1 Query Description and Associated User Roles
Expense Reports > Approval History Expense User B1WebAPI_Expense / RP_MyApprovalHistory Lists all approvals and rejected approvals completed by the currently logged-in Expense User.

Requires either of the roles Expense Admin or Expense Reports
Expense Reports > Claim Details Expense User B1WebAPI_Expense / RP_ExpClaimDetails Shows a detailed list of all expense claims for the currently logged-in Expense User.

Requires either of the roles Expense Admin or Expense Reports
Expense Reports > Claims Expense User B1WebAPI_Expense / RP_ExpClaims Lists all expense claims for the currently logged-in Expense User.

Requires either of the roles Expense Admin or Expense Reports
Expense Reports > Expense Analysis Expense User B1WebAPI_Expense / RP_ExpenseAnalysis This pivot report allows for the analysis of expense data.

Requires either of the roles Expense Admin or Expense Reports
Expense Reports > My Claims Expense User B1WebAPI_Expense / RP_MyClaims Lists all expense claims for the currently logged-in Expense User.

Requires the role Expense User
Expense Reports > My Requests Expense User B1WebAPI_Expense / RP_MyRequests Lists all expense requests for the currently logged-in Expense User.

Requires the role Expense User
Expense Reports > Request Details Expense User B1WebAPI_Expense / RP_ExpRequestDetails Shows a detailed list of all expense requests for the currently logged-in Expense User.

Requires either of the roles Expense Admin or Expense Reports
Expense Reports > Requests Expense User B1WebAPI_Expense / RP_ExpRequests Lists all expense requests for the currently logged-in Expense User.

Requires either of the roles Expense Admin or Expense Reports
Expense Reports > Requests Not Claimed Expense User B1WebAPI_Expense / RP_ApprRequestLinesNotClaimed Lists all requests for all expense users who haven't been copied into a claim.

Requires either of the roles Expense Admin or Expense Reports
Sales Reports > Customer Status Sales User
(requires per-user license)
B1WebAPI_SU / _OMAN_MYCUSTS Lists all customers that belong to the currently logged in Sales User. Requires that a salesperson is assigned to the logged in employee user. Customer details may be viewed using the drill-down links in this report.

Requires either of the roles Sales User or ZB1EPS
Sales Reports > Inventory Status Sales User
(requires per-user license)
B1WebAPI_SU / _OMAN_INVREPORT Lists all items and their stock quantities.

Requires the role ZB1EPS
Sales Reports > Order Analysis Sales User
(requires per-user license)
B1WebAPI_SU / Last Orders This pivot report allows for the analysis of sales order data.

Requires the role ZB1EPS
Sales Reports > Order Status Sales User
(requires per-user license)
B1WebAPI_QueryPortal / My Sales Orders Lists all orders placed by customers who are assigned to the logged in Sales User. Requires that a salesperson is assigned to the logged-in employee user.

Requires the role ZB1EPS
Sales Reports > Sales Analysis Chart Sales User
(requires per-user license)
B1WebAPI_SU / _OMAN_SALESANALYSIS This chart report allows for the analysis of sales order data.

Requires the role Sales User
Sales User > All Opportunities Analysis Sales User
(requires per-user license)
B1WebAPI_SU / Opportunity Analysis - All This pivot report allows executive managers to review opportunity data for all sales employees.

Requires the role Sales Exec
Sales User > My Closed Activities Sales User
(requires per-user license)
B1WebAPI_SU / _OMAN_GET_MY_CLOSED_ACTIVITIES Lists notes and closed tasks assigned to the currently logged in Sales User. Requires that a salesperson is assigned to the logged-in employee user. Activity details may be viewed using the drill-down links in this report.

Requires the role Sales User
Sales User > My Customers Sales User
(requires per-user license)
B1WebAPI_SU / _OMAN_MYCUSTS Lists all customers that belong to the currently logged-in Sales User. Requires that a salesperson is assigned to the logged in employee user. Customer details may be viewed using the drill-down links in this report.

Requires either of the roles Sales User or ZB1EPS
Sales User > My Open Activities Sales User
(requires per-user license)
B1WebAPI_SU / _OMAN_GET_MY_OPEN_ACTIVITIES Lists open tasks assigned to the currently logged-in Sales User. Requires that a salesperson is assigned to the logged in employee user. Activity details may be opened and edited using the drill-down links in this report.

Requires the role Sales User
Sales User > My Recent Orders Sales User
(requires per-user license)
B1WebAPI_QueryPortal / My Sales Orders Requires that a salesperson is assigned to the logged-in employee user.

Requires the role ZB1EPS
Sales User > My Recent Quotes Sales User
(requires per-user license)
B1WebAPI_QueryPortal / My Sales Quotes Requires that a salesperson is assigned to the logged-in employee user.

Requires the role ZB1EPS
Sales User > Opportunity Analysis Sales User
(requires per-user license)
B1WebAPI_SU / Opportunity Analysis Allows managers to review opportunity data for the logged-in user’s subordinate sales employees.

Requires the role Sales Manager
Sales User > Sales Team Customers Sales User
(requires per-user license)
B1WebAPI_SU / _OMAN_SALES_USER_ACCESSIBLE_CUSTS Allows employees to view accessible customers who are not assigned directly to their configured salesperson. Sales manager users will see any customers belonging to their employees (employees who have this person assigned as their manager in B1). Sales exec users will see all customers.

Requires any one of the roles: Sales ManagerSales Exec

 

SXP Employee Optional Report Samples

SXP Employee includes optional report samples for general use, including reporting around inventory, support, and accounting. Sample reports and their associated roles are listed below:

 

Report B1 Query Description and Associated User Roles
Accounting: Overdue Invoices B1WebAPI_QueryPortal /Overdue Invoices Provides basic information about overdue invoices.

Requires either of the roles Accounting or Sales
Accounting: Profit and Loss B1WebAPI_QueryPortal /Profit and Loss This is a pivot-based report allowing for the exploration of profit and loss data.

Requires any one of the roles AccountingSales or Management
Customers: All special prices B1WebAPI_QueryPortal /All special prices for all BPs Provides basic information about specially configured prices.

Requires the role Management
Customers: Inactive Business Partners B1WebAPI_QueryPortal /Inactive or Frozen BP Provides basic information about inactive business partners.

Requires either of the roles SalesManagement
Customers: Top 50 Customers B1WebAPI_QueryPortal /Customer Report Provides a summary of the top 50 customers, based on order value.

Requires any one of the roles: SalesManagementProduction, or Purchasing
Purchasing: Item Stock Status B1WebAPI_QueryPortal /Item Status Provides a list of all items and basic info about stock levels.

Requires any one of the roles SalesCustomersManagementProductionPurchasingVendorsWarehouse, or QP_Service
Service: All Service Calls B1WebAPI_QueryPortal /All service calls Provides a list of service calls and basic information about them.

Requires any one of the roles SupportQP_Service, or Management
System: Enabled Users B1WebAPI_QueryPortal /Enabled Users A list of all users who can log in to a Portal.

Requires the role Management
System: Login History B1WebAPI_QueryPortal /Login History Provides a list of login attempts and details about those attempts (which Portal was used, which username, etc).

No roles are assigned out of the box. To allow specific users to see this, add a custom role using InterConnect Manager Add-On.
System: Menu Item Details B1WebAPI_QueryPortal /Menu Details Provides details about all menu options for installed Portals.

Requires the role Management
Warehouse: Deliveries in the last 30 days B1WebAPI_QueryPortal /Deliveries closed in the last 30 days Provides a summary of deliveries made in the last 30 days.

Requires any one of the roles SalesManagementProductionWarehouse

 

 

 

Previous

Next


  

Last modified: 01/27/2025/9:56 pm

 

-