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

SAP user query

Dear All,

Can we make our user query like this

If [%2] != 'C'

Begin

...

End

I tried on my side. It doesn't work. Is there anything wrong with my code? Thanks a lot.

Regards,

yuka

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jul 14, 2009 at 09:00 PM

    User input like [%2\] will not work based on your query. What do you need to achieve?

    Thanks,

    Gordon

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      I would do this:

      Declare @campo nvarchar (3)

      Set @campo = 'xxx'

      IF @campo is null or Rtrim (@campo) =' '

      BEGIN

      Select * From Tabla T0

      END

      ELSE

      IF @campo is not null or rtrim (@campo)< >' '

      BEGIN

      Select * From Tabla T0 Where T0.campo =@campo

      END

      -


      With pop up variables is the same, just replace Declare query format with /* select from ...*/ variable syntax.

      (If you need more information about the Declare in SAPB1 user queries, just let me know).

  • author's profile photo Former Member
    Former Member
    Posted on Jul 14, 2009 at 09:45 PM

    That is right. You may not have options to create menu like interface for query to run.

    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.