In the previous tips, we have shown how to add custom parameters in Query Manager in SQL.
This time we will show you how to add custom parameter criteria to the Query Manager on HANA. Here is an example of a simple query that will be changed into an element of its selection criteria.
With [Date From] – [Date To] in the OINV Table
Declare FromDate timestamp;
Declare ToDate timestamp;
FromDate := ‘20200101’;
ToDate := ‘20200131’;
SELECT * FROM “OINV”
WHERE “DocDate” BETWEEN FromDate AND ToDate
Then, you can change the query into a query with selection criteria as enhancements as below:
/*SELECT * FROM “OINV” T0*/
Declare FromDate timestamp;
Declare ToDate timestamp;
FromDate := /* T0.”DocDate” */ ‘[%0]’;
ToDate := /* T0.”DocDate” */ ‘[%1]’;
SELECT * FROM “OINV”
WHERE “DocDate” BETWEEN FromDate AND ToDate;
You can use the basic composition to declare variables and increase the use of selection criteria for custom queries in the Query Manager feature earlier on the HANA database.
Also read:
- How to Use Custom Parameter on Query Manager
- Create and Update Parameters SAP Crystal Reports
- Custom Report – Query List of Delivery Order (DO) Header and Detail
- Custom Report – Query List of Goods Received from Purchase Order (GRPO) Header and Detail
- Custom Report – Query List of Sales Order (SO) Header and Detail