Skip to Content
author's profile photo Former Member
Former Member

User defined query parameter in query generator

Hi All,

i am using query generator in SAP to print some records of user defined query. precisely, the details about sales employees are to be printed. now the columns which exist in the database (ie. sales employee code, name, cardcode) etc can be given as a parameter like [%0] and [%1]. but some user defined parameter such as sales commission does not show as such parameter. i want one column as

select T0.doctotal, (T0.doctotal * [%0]) / 100  as brokerage from OINV T0
--where [%0] is some commission percentage that the user will give while running this query

This query gives correct results but it gives the parameter name as 'doctotal' while showing. any idea as to how to handle it properly in SAP?

thanks in advance,


Edited by: Binita Joshi on Sep 8, 2009 3:35 PM

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Sep 08, 2009 at 02:57 PM

    Hi Binita,

    You need at least an UDF in order to define query parameter. There is no option that you could give free form query parameter. All '[%0\]' variables are linked to a field.



    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 09, 2009 at 07:05 AM

    I sometimes defined a UDT only for getting the appropriate parameter entering window. The table has no data; I used it only for its field names in this window.

    (The parameter request can be placed inside a comment and the entered value is used setting an SQL variable like this:

    declare @d datetime
    /*select t.createdate from ordr t where t.createdate=[%0]*/
    set @d=[%0]

    This SQL variable can be used later in the real query.)

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.