Managing Menus and Reports in SXP Partner Edition


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

 

 

You can configure menus and reports with SXP Manager Add-On for SAP Business One. Multi-level menus are configurable using a flexible menu setup that makes it easy for users to access and navigate content in SXP Partner.

 

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.) that must be configured before the menu entry (web link) is set up. Menu options (e.g., reports) can be reused in multiple menu entries (web links), but each menu entry is generally tied to a single menu option and vice versa.

 

The walk-through 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:

      • Category: Indicates that this menu entry will be used as a header for other menu entry content. Does not require a link.

      • Grid: Grids are a report type that display as a list of data.

        Requires a link to point to the report details for this menu entry.
        See 'Creating Menu Options' below.

      • Pivot: Pivots are a report type that display configurable and interactive table options (e.g., sales over time analysis).

        Requires a link to point to the report details for this menu entry.
        See 'Creating Menu Options' below.

      • Chart: Charts are a specialized version of pivots that display results graphically.

        Requires a link to point to the report details for this menu entry.
        See 'Creating Menu Options' below.

      • Static: Static links point to pages within the Portal or to outside content (e.g., a marketing webpage or email login page).

        Requires a link to point to the static link information for this menu entry.
        See 'Creating Menu Options' below.

      • Collection: Collections are configured B2B Marketplace product lists displayed to customers with a B2B role. Configuration is required before collections can be displayed.
        See the B2B Marketplace Administration Guide for a walkthrough of advanced B2B Marketplace admin options.

        This applies to B2B Marketplace implementations only. Otherwise, don't use this option.

Requires a link to point to a specific collection for this menu entry.

See 'Creating Menu Options' below.

  • Link: This points to the menu option details for this menu entry. This is not applicable to category menu entries. (E.g., 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 critical and/or common. For example, in an admin sub-menu, the “Time Sheet” static link might have an icon because everyone uses this daily, whereas remaining admin reports wouldn't have an icon.

 

 

Sample top-level menu entries with leading icons.

 

 

 

  • Opt CSS class: If desired, a CSS class may 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.

    Note the best practice recommendation for Menu Icons also 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, such as reports, static links, or collections. Menu options are the details displayed by menu entries and may be configured as part of the menu entry setup. They can also be managed separately using the 'Manage Reports' section of SXP Manager Add-On in SAP Business One.

 

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

Go to SXP Manager AddOn > Manage Menu, then select the application and menu. From there, edit existing menu options 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) and menu (3); and Menu Option (4). Then edit (4) or add (5) menu option details.

 

 

Go to SXP Manager AddOn > Manage Menu, then select the application and menu. Add or edit a menu entry, 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 provides the ability to manage menu options (i.e., 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 provide a way to manage options (i.e., 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.

 

 

Open the 'Menu Option Details' screen to edit as follows:

  1. Assign a name. This is an admin-friendly name that won't be displayed to a web user.
  2. Select the type.
  3. Assign the roles permitted to access this report. This will determine if 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, which may be either within SXP or a page on an external website. They may open in a new tab (e.g., for external pages) or within the current window (e.g., for sub-pages within the Portal website).

 

 

For static menu options (1), assign roles (2) and configure link info (3). Then set the 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. You can use this 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 (grid, pivot, or chart). General report setup is the same for all three types. However, pivot and chart queries have restrictions on how they're set up in SAP Business One.

 

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

 

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

 

Grids - query setup

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

 

In some cases, there can be multiple similar reports whose only differences are which fields are displayed. 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 have to manage.

 

 

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

 

Grid reports can be configured 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 can be used to concisely display values over time (such as sales reports or cost analysis reports). By configuring different report views, the same query can be used to display different views into the same data.

 

For example, a general sales report can be configured 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 a different purpose.

 

Once a chart has been fully configured and is accessible by users, you can configure report views for different chart layouts. An admin may do this to provide a good starting point for reporting where a good visual reference is needed (see 'Report Views' below).

 

On the web, a chart layout can be configured using the 'Advanced' menu by dragging/dropping fields into the pivot at the bottom of the page. If no pivot is visible, open the advanced menu and enable the “Show Grid” option.

 

Chart options

You can configure advanced chart options to display different charts with the same query. Options are described below.

 

Option Description
Chart type Determines how the data is displayed.
Palette Color scheme for the selected chart.
Chart width Pixel width of the chart area, including labels.
Chart height 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.

Some chart types can’t show legends for multiple data sets, including pie, doughnut, and funnel charts.
Show column totals Not used.
Show row totals Not used.
Show point labels Enable this for pie, doughnut, and funnel charts to see data points on the chart.

 

 

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
Spline Charts Y Y NS NS NS
Scatter Line Charts Y Y NS NS NS
Swift Plot 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
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
Range Area Charts Y Y NS NS NS
Radar Point Charts Y Y NS NS NS
Radar 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

 

 

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
Full Stacked Bar 3D Charts Y Y NS NS NS
Manhattan Bar Charts Y Y NS NS NS
Side by Side Stacked
Bar 3D Charts
Y Y NS NS NS

Side by Side Full
Stacked Bar 3D Charts

Y Y NS NS NS
Pie 3D Charts Y Y NS NS NS
Doughnut 3D Charts Y Y NS NS NS
Funnel 3D Charts Y Y NS NS NS
Line 3D Charts Y Y NS NS NS
Stacked Line 3D Charts Y Y NS NS NS
Full Stacked Line 3D Charts Y Y NS NS NS
Step Area 3D Charts Y Y NS NS NS
Stacked Bar 3D Charts Y Y NS NS NS

 

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 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, while example 2 shows the quantity of items sold.
  • The top row may optionally contain categories for the data (e.g., item groups). Neither example shows this option.

 

 

 

Line chart example 1: Sales trends over time. Left fields: date_year/date_month; top field blank; data field (upper-left): amount

 

 

Line chart example 2: Sales quantities for two years. Left fields: date_year (filtered on two years)/date_month; top field blank; data field (upper-left): 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 used to assess the data, typically date fields. Both examples show years filtered to 2015/2016.
  • The upper-left section is for amounts (e.g., sales totals, quantities). Both examples show sales total amounts.
  • The top row may optionally contain categories for the data (e.g., item groups). This will show a distinct chart for every category of data. Example 1 doesn’t break down the analysis, and example 2 shows data broken down by item group.

 

Pie chart example 1: Sales comparison between 2015 and 2016. Left field: date_year (filtered on two years); top field blank; data field (upper-left): amount.

 

 

 

 

Pie chart example 2: Sales comparison between for each item group. Left field: date_year (filtered on two years); top field: item group; data field (upper-left): 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 used to assess the data (typically date fields). The example below shows breakdowns by year/month.
  • The upper-left section is for amounts (e.g., sales totals, quantities). 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 time frame by item group.

 

 

Stacked bar chart example 1: Customer purchases by item group. Left: Date_year/date_month; right: item group; data (upper-left): line total

 

 

Parameters for reports

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

 

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

 

For example, 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., SLPCODE may be pulled from the current user’s assigned salesperson), or you can configure them to allow users to specify their values (e.g., with a drop-down or free-text field).

 

Configuring Parameters

Parameters that are automatically populated can be defined 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 web users to define the info used by the report query. You can configure USPs as described below. Select the Parameter Type 'User Supplied', and configure the desired type below.

 

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 optionally set a default date.

 

Decimal, Integer, Text

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

You can optionally 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 that should be displayed to users in the dropdown, press the plus button to add a new list option. Fill in choice text (the text shown to the user) and populate value (the value assigned to the query parameter when the user chooses the option). The up/down arrows on the right can be used to sort the list of options.

You can optionally 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 list of 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, if we want to provide 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, InterConnect 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, you can access these functions from within a stored procedure only, so custom queries that require multi-currency support must be created as stored procedures in HANA Studio. You can then reference these queries 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, you can convert it to a multi-currency query in the following way:

  1. Identify 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 the query is displaying. (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 identifies the correct value (local currency or foreign currency) based on the given card code.
      • dbo.ZEDS_CPCurrency(<Card Code>) (Customer Portal) / dbo.ZEDS_EPCurrency(<Card Code>) (Employee Portal) - This  identifies which currency ISO code is used by the given card code.
    • HANA:
      • NOTE: Hana functions can't be installed automatically due to a known SAP Hana issue. As a workaround, you can install these functions 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) (Employee Portal) - This will set the flag IsFC ('Is Foreign Currency') to 0 or 1 for the indicated business partner (BP). 1 indicates that 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)) (Employee Portal) - 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. In this case, a customer who performs all transactions in EUR will see USD values.

 

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 that have 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 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 end 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. In this case, a customer who performs all transactions in EUR will see USD values.

 

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

 

Unlike SQL functions, which you can execute from within B1 queries directly, Hana functions that contain parameters must be executed from 'Stored Procedures'. 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.

 

Once this is done, we’ll replace our query in B1 with a call to the new stored procedure. This allows us 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 a SQL.

 

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

Identify any currency fields that have a “Foreign Currency” counterpart.

 

This query has a single currency field: DocTotal with 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 end 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;
 

Creating collection menu options

You can add B2B Marketplace Collections to a menu once they've been configured. See 'B2B Marketplace Administration Guide: Configuring Collections'.

 

Positioning Menu Entries

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

 

To move the position of a menu item, select the menu item and click the up or down arrow(s).

 

Creating a sub-menu entry

If an existing top-level menu entry needs to be moved 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, place the top-level menu immediately 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.

 

Note that every additional level adds another “- -“ to the beginning of the menu entry name.

Making sub-menu entries into top-level entries

Similar to creating sub-menu entries above, if a sub-menu entry needs to be made back into a top-level menu entry, press the “move left” button (<-) until it’s at the correct level.

 

Configuring Golden Arrow Drill-down Links

You can use golden arrow drilldowns to 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).

 

You can configure golden arrow drilldowns 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

  3. Ensure every link and display column pair is unique. (I.e., if you wish to create two drilldowns, you need four fields.)

  4. Ensure the link and display columns are 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.

 

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 most 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. It may be optionally set to _blank to open in a new window.

 

 

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 ~/docviewers/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 Partner (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 query fields. Then, configure the following details:

BP data golden arrow example (SXP Employee)

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 for different views of the same report, allowing 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 the admin can control.

 

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

 

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

 

You can delete a default layout by clicking 'Delete' from the saved layout dropdown.

 

Setting default layouts for all users (by admin users only)

  • Log in to SXP Partner as a user with the 'Report View Editor' role (see 'Updating Customer Portal Configuration Settings - General 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 Partner 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 layout.
  • Any changes will be saved into a table in SAP Business One. These changes will now display automatically every time the report is accessed.
  • When you save the layout, 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 choose to 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.

 

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

 

Note that 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 be edited only by admin users, but all users can view them. Personal named report layouts can be edited by a user but viewed only by the user who created them.

 

To delete a named layout, use the 'Delete' link next to the layout. Only personal report views can be deleted by non-admin users.

 

Saving a named layout

To save a named layout for personal use:

  1. Login to the SXP Partner website normally.

  2. Open a report and make the desired changes to the filtering, column hiding, column widths, etc.
  3. Press the 'Advanced Options' icon.
  4. Press the 'Save Layout As…' button 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 be available to that user only.

 

Saving a named layout for all users (by 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 Customer Portal Configuration Settings - General Settings tab').

  1. Login to the SXP Partner website normally.

  2. Open a report and make the desired changes to the filtering, column hiding, column widths, etc.
  3. Press the 'Advanced Options' icon.
  4. Press the 'Save Layout As…' button 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 (or "minus") 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 bury menus too deeply. Menus can have as many levels as desired; however, if items are buried too many levels down, it's hard for users to find what they’re looking for. Aim for 2-4 menu levels for moderately sized navigation.

 

Keep icons tidy. Icons are available and 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 there are too many items in a menu, it will be hard for users to find what they’re looking for. Consider splitting a menu into sub-menus if the number of items exceeds six or seven.

 

 

SXP Partner Reports

Out-of-the-box reports for SXP Partner are listed below, along with their supporting queries and the user roles that enable these reports. You can modify these reports 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 Partner role that permits access to all menu entries and reports. Otherwise, specific user roles below must be assigned to a user before they can view some menu entries or reports.

 

B1WebAPI Categories are used to securely host content meant to be accessed via the web. Categories used by SXP Partner include:

  • B1WebAPI - System queries in this category aren't meant to be customized.
  • B1WebAPI_CP - This category contains Customer Portal feature queries, some of which shouldn't be edited. Refer to the query details below.
  • B1WebAPI_QueryPortal - This category contains report queries for all SXP versions, including SXP Partner.

 

Report B1 Query Description and Associated User Roles
Billing > Credit Memos B1WebAPI_CP / OpenCreditMemos Lists credit memos applied to the currently logged in customer’s business partner. Document details may be viewed by drilling down into the document.

Requires the role Billing
Orders > Your Orders B1WebAPI_CP / OpenOrders Lists orders placed by the currently logged in customer’s business partner. Document details may be viewed by drilling down into the document.

Requires either of the roles Order or Quote
Orders > Your Quotes B1WebAPI_CP / YourQuotes Lists quotes placed by the currently logged in customer’s business partner. Document details may be viewed by drilling down into the document.

Requires either of the roles Order or Quote
Reports > All Deliveries B1WebAPI_CP / DASH_FULL_DELIVERY Lists all deliveries shipped to the currently logged in customer’s business partner. Document details may be viewed by drilling down into the document.

Requires either of the roles Billing or Order
Reports > All Invoices B1WebAPI_CP / InvoiceReport Lists all invoices assigned to the currently logged in customer’s business partner. Document details may be viewed by drilling down into the document.

Requires either of the roles Billing or Order
Reports > All Orders B1WebAPI_CP / DASH_FULL_ORDERS Lists all orders placed by the currently logged in customer’s business partner. Document details may be viewed by drilling down into the document.

Requires either of the roles Billing or Order
Reports > All Payments B1WebAPI_CP / DASH_FULL_PAYMENTS Lists all payments applied to the currently logged in customer’s business partner. Document details may be viewed by drilling down into the document.

Requires either of the roles Billing or Order
Service Calls > Closed Service Calls B1WebAPI_CP / ClosedServiceCalls Lists all service calls assigned to the currently logged in customer’s business partner, including open and cancelled. Service call details can be viewed by drilling down into the document.

Requires the role Service CP
Service Calls > Open Service Calls CP B1WebAPI_CP / OpenServiceCalls Lists active service calls assigned to the currently logged in customer’s business partner. Service call details may be viewed by drilling down into the document.

Requires the role Service CP

 

 

The SXP Partner features listed below are customizable. While they aren't reports, they're query-driven like reports. Because they supply data to features, some queries have special data requirements, as noted below.

 

 

Feature B1 Query Description and Associated User Roles
Order Pad Item Search - B2B only B1WebAPI_CP / B2BOrderPadItemSearch This query’s field names shouldn't be modified unless code customizations are also in place.

This feature is available within Order Pad for B2B Marketplace and requires an Order Pad application license.

Requires both the Order and B2B roles to access this feature.
Order Pad Item Search for standard Order Pad B1WebAPI_CP / OrderPadItemSearch This query’s field names shouldn't be modified unless code customizations are also in place.

This feature is available within Order Pad (Orders or Quotes) and requires an Order Pad application license.

Requires one or both roles of Order or Quote 
Quick Add - B2B only B1WebAPI_CP / B2BQuickAdd When the Order Pad option 'Enable Quick Add query' is enabled, this query determines what customers see when they view the quick add (or 'Add multiple items') page.

This feature is available within Order Pad for B2B Marketplace and requires a B2B application license.

Requires both the roles of Order and B2B 
Quick Add for standard Order Pad B1WebAPI_CP / QuickAdd When the Order Pad option 'Enable Quick Add query' is enabled, this query determines what customers see when they view the quick add (or 'Add multiple items') page.

This feature is available within Order Pad (Orders or Quotes) and requires an Order Pad application license.

Requires one or both of the roles Order or Quote 
Recent Activity - Customer Portal landing page B1WebAPI_CP / DASH_Orders This query’s field names shouldn't be modified. Instead, field names are customizable with resource strings (see 'Manage Translations'), or a customization may be applied to the 'RecentActivity' control to manually hide undesired fields.

This compound query displays a summary of recent activities (quotes, orders, deliveries, invoices, etc.). By default, the top 10 most recent records of each type are displayed to customers upon login.

No role is required to access this feature. However, users with the B2B role will see a different landing page and won't have access to this RecentActivity page.
Related Documents for Credit Memo details B1WebAPI_CP / CreditMemoRelatedDocs This query’s field names shouldn't be modified. Instead, field names are customizable with resource strings (see 'Manage Translations'), or a customization can be applied to the 'RelatedDocuments' control to manually hide undesired fields.

This query displays within the 'Credit Memo Details' page and shows a list of documents associated with that credit memo (e.g., the originating order or the invoice being credited).

No specific roles are required to see this account information.
Related Documents for Delivery details B1WebAPI_CP / DeliveryRelatedDocs This query’s field names shouldn't be modified. Instead, field names are customizable with resource strings (see 'Manage Translations'), or a customization can be applied to the 'RelatedDocuments' control to manually hide undesired fields.

This query displays within the 'Delivery Details' page and shows a list of documents associated with that delivery (e.g., the originating order, related invoices).

No specific roles are required to see this account information.
Related Documents for Order details B1WebAPI_CP / SalesOrderRelatedDocs This query’s field names shouldn't be modified. Instead, field names are customizable with resource strings (see 'Manage Translations'), or a customization can be applied to the 'RelatedDocuments' control to manually hide undesired fields.

This query displays within the 'Order Details' page and displays a list of documents associated with that order (e.g., quotes, deliveries, invoices).

No specific roles are required to see this account information.
Related Documents for Quote details B1WebAPI_CP / QuoteRelatedDocs This query’s field names shouldn't be modified. Instead, field names are customizable with resource strings (see 'Manage Translations'), or a customization can be applied to the 'RelatedDocuments' control to manually hide undesired fields.

This query displays within the 'Quote Details' page and displays a list of documents associated with that quote (e.g., subsequent orders, deliveries, invoices).

No specific roles are required to see this account information.

 

 

 

Previous

Next


  

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

 

-