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

SELECT_OPTIONS AND PARAMETER

can i use select-options and parameter in same select statement.

ex:-

PARAMETERS : S_BUKRS LIKE AUFK-BUKRS,

S_GSBER LIKE AUFK-GSBER.

SELECT-OPTIONS : S_AUFNR FOR AUFK-AUFNR.

SELECT AUFNR BUKRS GSBER KTEXT USER4

FROM AUFK INTO TABLE IT_AUFK

WHERE AUFNR IN S_AUFNR

AND BUKRS = S_BUKRS

AND GSBER = S_GSBER.

Add a comment
10|10000 characters needed characters exceeded

Related questions

9 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jul 11, 2007 at 01:19 PM

    Yes.......

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      Sorry for earlier>>

      U will have to use(written in bold):

      PARAMETERS : P_BUKRS LIKE AUFK-BUKRS,

      P_GSBER LIKE AUFK-GSBER.

      SELECT-OPTIONS : S_AUFNR FOR AUFK-AUFNR.

      SELECT AUFNR BUKRS GSBER KTEXT USER4

      FROM AUFK INTO TABLE IT_AUFK

      WHERE AUFNR IN S_AUFNR<b>-low</b>

      AND BUKRS = P_BUKRS

      AND GSBER = P_GSBER.

      Regards,

      Shashank.

  • author's profile photo Former Member
    Former Member
    Posted on Jul 11, 2007 at 01:21 PM

    Hello,

    Yes, U can use as u Wrote.

    Regards,

    Deepu.K

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 11, 2007 at 01:23 PM

    We can write , but it is advisable to change the naming convention to P_... for parameters to be clear

    PARAMETERS : P_BUKRS LIKE AUFK-BUKRS,
    P_GSBER LIKE AUFK-GSBER.
    SELECT-OPTIONS : S_AUFNR FOR AUFK-AUFNR.
    
    SELECT AUFNR BUKRS GSBER KTEXT USER4
    FROM AUFK INTO TABLE IT_AUFK
    WHERE AUFNR IN S_AUFNR
    AND BUKRS = P_BUKRS
    AND GSBER = P_GSBER.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 11, 2007 at 01:32 PM

    HI Pratik,

    You can definitely use both in the same select statement.

    Kiran

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 11, 2007 at 01:34 PM

    Hi

    Yes, you have to give the parameter name in that particular field where class(=) and same as select options (but use IN).

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 11, 2007 at 01:34 PM

    hi

    tables aufk.

    PARAMETERS : S_BUKRS LIKE AUFK-BUKRS,

    S_GSBER LIKE AUFK-GSBER.

    SELECT-OPTIONS : S_AUFNR FOR AUFK-AUFNR.

    data : it_aufk type table of aufk ."occurs 0 with header line.

    SELECT AUFNR BUKRS GSBER KTEXT USER4

    FROM AUFK INTO TABLE IT_AUFK

    WHERE AUFNR IN S_AUFNR

    AND BUKRS = S_BUKRS

    AND GSBER = S_GSBER.

    it will work..

    reward if useful.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 11, 2007 at 01:50 PM

    Also

    SELECT ...

    FROM

    WHERE ... <b>IN</b> Select-options

    .... <b>=</b> Parameter

    This is because a parameter is a single value, select-options are a range of values.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 11, 2007 at 01:52 PM

    Yes you can....

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 11, 2007 at 03:35 PM

    YES THERE IS NO PROBLEM WITH THAT ,

    JUST YOUR DEFINING THAT FEILDS AS DIFFERENT OPTIONS

    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.