Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

select options in screens

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

You need to use 'IN' operator

Regards,

Reema

9 REPLIES 9

Former Member
0 Kudos

You need to use 'IN' operator

Regards,

Reema

Former Member
0 Kudos

Hi,

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

vbeln in vbeln.</b>

Regards,

PAdmam.

Former Member
0 Kudos

hi,

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

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

Regards,

Pavan P.

younes_bouaouad
Explorer
0 Kudos

Hi, use IN s_option instead.

Regards

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

hi

use the following syntax.

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

reward if useful