Application Development and Automation 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: 
Read only

query

Former Member
0 Likes
1,053

how to write a query sentence to make one field fit for multi-condition synchronously?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,035

u can use IN operator like

select <field> from <table>

into <itab-field>

where <table-field> IN ( var )

Ankesh

7 REPLIES 7
Read only

Former Member
0 Likes
1,036

u can use IN operator like

select <field> from <table>

into <itab-field>

where <table-field> IN ( var )

Ankesh

Read only

0 Likes
1,035

"in" couldn't achieve the logic relation "and"

i mean that there are more than one condition with one field ,and must fit for all of this condition.

Read only

Former Member
0 Likes
1,035

hii

SELECT matnr                       " Material Number
           werks                       " Plants
           prctr                       " Profit Center
      FROM marc
      INTO TABLE i_marc
       FOR ALL ENTRIES IN i_mara
     WHERE matnr = i_mara-matnr
       AND werks IN s_werks.

for multiple condition we can use this type.

<REMOVED BY MODERATOR>

thx

twinkal

Edited by: Alvaro Tejada Galindo on Jun 12, 2008 12:53 PM

Read only

0 Likes
1,035

tks twinkal patel , but ,could you explain this query briefly , tks for your kind !

Read only

Former Member
0 Likes
1,035

where the condition setting ?

Read only

0 Likes
1,035

Hi Sophie,

Just look into this Query...

SELECT  vbeln
        vbtyp
        trvog
        auart
   INTO TABLE lt_vbak
   FROM vbak
  WHERE vkorg = '1000'
    AND vtweg = '10'.

we are selecting the fields ( vbeln, vbtyp, trvog, auart) into table IT_VBAK from database table VBAK depending on the condition where VKORG field is 1000 and VTWEG is 10.

It select only the records which meets the condition in the WHERE clause.

if the database table VBAK contains the record with VKORG value as 1000 and VTWEG value as 10, then they are selected into the table IT_VBAK.

SELECT  vbeln
        vbtyp
        trvog
        auart
   INTO TABLE lt_vbak
   FROM vbak
  WHERE vkorg IN s_vkorg
    AND vtweg IN s_vtweg.

Best regards,

raam

Read only

0 Likes
1,035

Hi Sophie,

Just look into this Query...

SELECT  vbeln
        vbtyp
        trvog
        auart
   INTO TABLE lt_vbak
   FROM vbak
  WHERE vkorg = '1000'
    AND vtweg = '10'.

we are selecting the fields ( vbeln, vbtyp, trvog, auart) into table IT_VBAK from database table VBAK depending on the condition where VKORG field is 1000 and VTWEG is 10.

It select only the records which meets the condition in the WHERE clause.

if the database table VBAK contains the record with VKORG value as 1000 and VTWEG value as 10, then they are selected into the table IT_VBAK.

SELECT  vbeln
        vbtyp
        trvog
        auart
   INTO TABLE lt_vbak
   FROM vbak
  WHERE vkorg IN s_vkorg
    AND vtweg  = '10'.

Here S_VKORG is select option. Select options contain a range of values like 1000 to 3000. In selection screen we mention the range of values we want to fetch from the databas

Best regards,

raam