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

select options in screens

Hello friends,

I am doing a screen program where the user will enter a range of sales orders,and i have to select from vbap the corresponding materials against that sales order number,but i am finding it difficult to use the select statement.

suppose my screen fields are vbeln-low and vbeln-high,so here i cant use the select statement select * from vbap into corresponding fields of iatb where

vbeln >= vbeln-low and vbeln <=vbeln-high, bcoz if the user doesnt enter vbeln-high then select statement goes wrong,other option i making a structure with fields like sign option low high,but if i have more select options that again beocmes a problem,is there anyway that i can solve this with a single select statement

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

9 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jul 10, 2007 at 09:38 AM

    You need to use 'IN' operator

    Regards,

    Reema

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 10, 2007 at 09:41 AM

    hi,

    When u are using select-options u should use IN operator in the select statement.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 10, 2007 at 09:40 AM

    Hi,

    Use <b>select * from vbap into corresponding fields of iatb where

    vbeln in vbeln.</b>

    Regards,

    PAdmam.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 10, 2007 at 09:41 AM

    Hi

    U can create a SELECTION-SCREEN in a module pool defining it in the TOP-INCLUDE:

    SELECTION-SCREEN BEGIN OF SCREEN 0100.
    SELECT-OPTIONS: SO_VBELN FOR VBAK-VBELN.
    SELECTION-SCREEN END    OF SCREEN 0100.
    
    In your MAIN SCREEN
    
    PROCESS PBO.
      MODULE CALL_SEL_SCREEN.
    
    MODULE CALL_SEL_SCREEN.
       CALL SELECTION-SCREEN 100.
       IF SY-SUBRC = 0.
    ---> User has pressed F8
         SELECT * FROM VBAP INTO TABLE T_VBAP WHERE VBELN IN SO_VBELN.
       ELSE.
    ----> User wants to exit from selection-screen.
       ENDIF.
    ENDMODULE.

    Max

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 10, 2007 at 09:43 AM

    <b>select * from vbap into corresponding fields of iatb where vbeln in s_vbeln.

    Don't use the comparision operators...</b>

    Regards,

    Pavan P.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 10, 2007 at 09:48 AM

    Hi, use IN s_option instead.

    Regards

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 10, 2007 at 09:50 AM

    In ur screen(let say 100), draw a SUBSCREEN area and name it SUB1.

    now in your program write a code like this:-

    tables vbak.

    selection-screen begin of screen 101 as subscreen.

    select-options s_vbeln for vbak-vbeln.

    selection-screen end of screen 101.

    now in PBO of ur screen write:-

    call subscreen sub1 including sy-repid '101'.

    and in PAI write select statement:

    select * from vbap into corresponding fields of iatb where

    vbeln in s_vbeln.

    Rewards points if helpful.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 10, 2007 at 09:56 AM

    select options form an internal table with sign, option, low , high so a range

    of values will be selected when u use select options, so in select query

    use 'IN' , then it works perfect

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 10, 2007 at 11:25 AM

    hi

    use the following syntax.

    select * from vbap into corresponding fields of itab where vbeln in s_vbeln.

    reward if useful

    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.