‎2008 Jun 12 11:53 AM
how to write a query sentence to make one field fit for multi-condition synchronously?
‎2008 Jun 12 11:55 AM
u can use IN operator like
select <field> from <table>
into <itab-field>
where <table-field> IN ( var )
Ankesh
‎2008 Jun 12 11:55 AM
u can use IN operator like
select <field> from <table>
into <itab-field>
where <table-field> IN ( var )
Ankesh
‎2008 Jun 12 11:59 AM
"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.
‎2008 Jun 12 12:01 PM
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
‎2008 Jun 12 12:15 PM
tks twinkal patel , but ,could you explain this query briefly , tks for your kind !
‎2008 Jun 12 12:55 PM
‎2008 Jun 12 5:53 PM
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
‎2008 Jun 13 2:12 AM
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