on 09-16-2014 10:31 AM
Dear Experts,
Can any one tell me what is meaning of Variable (%0,%1,%2.....%19) in Query Generator.
if give one example or related link will more appropriated.
Thanks & regards,
Santosh.
Hi,
@Nagararajan sir and
@Johan: other variable's menace the remaining variables. I.e %4,%5,%6...%19.
In what conditions I can use this remaining variable's.
Please give one example.
Regards,
Santosh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Santosh,
SAP simply provides a number of variables in the Query Generator. You can use as many or as few of them as you like.
It is like Augusto said, they are just names. However, there is a restriction: the order in which you put them in your query. When you use more than one parameter, always use the smallest number first.
So using Augusto's example:
SELECT T0.DocNum, T0.CardName, T0.DocTotal FROM OINV T0 WHERE T0.DocDate Between [%15] and [%25]
First [%15] is used, and then the larger number [%25].
If necessary you can even use the same parameter multiple times.
Regards,
Johan
Dear Experts,
Thanks a lot for reply.
Regards,
Santosh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Variable is used to select values from given table. If there is no variable, then the query will retrieve data from database.
Thanks & Regards,
Nagarajan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Variables in query generator is use to provide value for parameter at run time for given condition.
i.e. you can provide selection criteria to query report using this variables
Eg:-
SELECT T0.DocNum, T0.CardName, T0.DocTotal FROM OPOR T0 WHERE T0.Status = [%0] and T0.DocDate Between [%1] and [%2]
regards,
Raviraj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Santosh,
A variable can be used to make a query "dynamic".
For example:
SELECT T0.CardName FROM OCRD T0 WHERE T0.CardCode = 'C00001'
This query is static. That means it will always return the same answer: the name of the customer with code C00001
You can use the variable to make this query "dynamic":
SELECT T0.CardName FROM OCRD T0 WHERE T0.CardCode = [%0]
Now when you run this query, B1 will ask you to fill in a customer code, and the query result will be the name of the customer that you just gave.
You can use more than one variable, and in that case you need to use your variables in the correct order. So the first one will be [%0], the second one will be [%1], the third one will be [%2], etcetera.
For example:
SELECT T0.DocNum, T0.CardName, T0.DocTotal FROM OINV T0 WHERE T0.DocDate >= [%0] AND T0.DocDate <= [%1]
This query would show you all invoices between the given dates.
Regards,
Johan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.