02-28-2007 7:06 PM
Hi all,
I need help in rewriting this code
DATA : FLD LIKE ZTABLE-ZFLD,
FLD1 LIKE ZTABLE2-ZFLD2.
select single ZFLD from zTABLE1 into FLD
where MATNR = '123' and
werks = 'ABC'.
select single ZFLD1 from zTABLE2 into FLD1
where zFLD = FLD.
iS there way that we can write this with inner joins
Thanks
02-28-2007 7:09 PM
ONLY if there is any common field in both the dtabase tables. like as below
SELECT aZFLB bZFLD1 from ZTABLE1 As a
INNER JOIN ZTABLE2 AS b ON aFIELDNAME EQ bFIELDNME.
otherwise he query u have written is correct.
hope this will help
Thanks
Ashwani
02-28-2007 7:11 PM
Hello,
Do like this
SELECT SINGLE A~ZFLD B~ZFLD1 INTO ( FLD,FLD1) from ZTABLE1 AS A
INNER JOIN ZTABLE2 AS B on A~FLD EQ B~FLD
WHERE MATNR EQ 123
and WERKS EQ ABC
If useful reward
02-28-2007 8:49 PM
Hi,
help me out
TABLE 1 HAS
MATNR , WERKS , FLD1.
TABLE 2 HAS
FLD1, FLD2.
I KNOW MATNR AND WERKS BASED ON THAT I HAVE TO GET FLD2
I WANT IT BE WRITTEN WITH INNEWR JOINS
WITH FOLLOWING COD E I GET AN ERROR MESSAGE SAYING
comma without preccing colon (after select?)
data : FLD1 like zTABLE1-ZFLD1.
data : FLD2 like ZTABLE2-ZFLD2.
SELECT FZFLD1 BZFLD2
INTO ( FLD1, FLD2)
FROM ZTABLE1 AS F INNER JOIN ZTABLE2 AS B
ON FZFLD1 = BFLD2
WHERE F~MATNR = '123'
AND F~WERKS = 'ABC' .
Thanks
02-28-2007 8:57 PM
use
SELECT FZFLD1 BZFLD2
INTO (FLD1, FLD2)
FROM ZTABLE1 AS F INNER JOIN ZTABLE2 AS B
ON FZFLD1 = BFLD2
WHERE F~MATNR = '123'
AND F~WERKS = 'ABC' .
~Suresh
02-28-2007 8:58 PM
Hi Deepthi,
You need to give a comma after field by giving a space.
Try with this code.
SELECT FZFLD1 BZFLD2
INTO<b> ( FLD1 , FLD2 )</b>
FROM ZTABLE1 AS F INNER JOIN ZTABLE2 AS B
ON FZFLD1 = BFLD2
WHERE F~MATNR = '123'
AND F~WERKS = 'ABC' .
Thanks,
Vinay
02-28-2007 8:55 PM
Hi,
Please try this.
SELECT FZFLD1 BZFLD2
<b>INTO (FLD1, FLD2)</b>
FROM ZTABLE1 AS F INNER JOIN ZTABLE2 AS B
ON FZFLD1 = BFLD2
WHERE F~MATNR = '123'
AND F~WERKS = 'ABC' .
Regards,
Ferry Lianto