0% found this document useful (0 votes)
22 views15 pages

B1H Variables

Uploaded by

mail2mukeshsagar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views15 pages

B1H Variables

Uploaded by

mail2mukeshsagar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Welcome to the topic on variables and input parameters.

1
At the end of this course, you will be able to describe how to create variables and input
parameters.
For query views, you can variables and input parameters to get data from report users.

Variables are bound to attributes and are used for filtering. As such, they can only contain the
values available in the attribute they relate to.

Input parameters can contain any value the reporting user want to enter. Therefore, a data type
for the input parameter must be specified.
§ You use variables to filter data at runtime. You assign values to these variables by entering
the value manually, or by selecting it from the drop-down list.

§ Using variables means that you do not need to decide on the restriction on the value of
attributes at the design time.

§ You can apply variables in the analytic and calculation views.

§ If a calculation view is created using an analytic view with variables, those variables are also
available in the calculation view but cannot be edited.
The following types of variables are supported:
Single Value: use this to apply a filter to a single value.
Interval: use this where you want the user to specify a set start and end to a selected interval.
Range: Use this when you wan the end user to be able to use operators such as “Greater Than”
or “Lesser Than”
A variable restricts the results in the view for the selected attribute. To create a variable, select
the attribute in the view that you want to filter on, then define the following values:

Selection Type: You can choose whether selections should be based on intervals, ranges or
single values.

Multiple Entries: You control whether multiple values of the selection types should be allowed.

Default Value: You have the option to define a default value for the variable.

You also have the option to set the variable as Mandatory.


Sometimes using a variable is not enough. You might want to do more than restrict the value of
an attribute in a view.

You might want to take input from the user and process it, returning dynamic data based on the
user selection.

Using Input Parameters makes this possible.


The following types of Input variables are supported:
Direct: Use this to specify an input parameter as currency and date during currency conversion,
and target unit during unit of measure conversion.
Column: Use this when the value of a parameter comes from an attribute or table column.
Static List: Use this when the value of a parameter comes from a user-defined list of values.
Derived from Table: Use this when the value of a parameter comes from a table column based
on some filter conditions and you do not need to provide any input at runtime.
Imagine that you have an Aging Query.

You would like to use the same query to run aging for accounts receivable or vendor liabilities.

You can use an input parameter for Business Partner Type to allow the report user to make this
decision when running the report.

When running the report the user could choose Customer or Vendor.
When creating an input parameter definition, first add a name and give it a descriptive label.

Choose a suitable parameter type, for example a StaticList type. We used this type for the
input parameter for our Aging Query because the value of this parameter will come from a user-
defined list of values.

You have the option to define whether a parameter is mandatory. You also can set a default
value. In this case, we have chosen to set a constant value of C.

Input parameters must have a data type defined because they are not directly associated with
an attribute unlike variables.

In this example we chose to have a static list with values that the user can choose, therefore we
entered the values”Customer” or ”Vendor” in a list of values.
Create a Variable to filter the NetSales by year

q Create a Variable in our Query View:


q Link the Variable to the YEAR attribute

q Run the Data Preview, you will be prompted to enter a YEAR before the view is executed.

11
We are going to calculate the commission charges based on an input parameter: %
commission.
Add an Input Parameter to your Query view where the user will enter a % commission on sales:
q Create the Input Parameter:
q Type – Decimal (21,6)

q Create a calculated column


q Call the calculated column “Commission Total”
q Multiply the NetSales with the % Discount Input Parameter and divide by 100.

12
§ Variables are bound to attributes and are used for filtering.

§ As such, they can only contain the values available in the attribute they relate to. You do
not need to decide on the restriction on the value of attributes at the design time.

§ Input parameters are more flexible. They can contain any value the reporting user want to
enter.

§ Therefore, a data type for the input parameter must be specified.


This concludes the topic on variables and input parameters in the SAP Business One, version
for SAP HANA. Thank you for your time.

14
15

You might also like