‎2008 Aug 19 12:17 PM
Hi friends can one one correct the below code and send me back.
its showing some error.
SELECT a~matnr
a~werks
b~maktx
c~prctr
c~bklas
C~stprs
c~peinh
INTO TABLE it_detail
FOR ALL ENTRIES IN itab
FROM marc AS a INNER JOIN makt AS b
ON amatnr = bmatnr
inner join mbew AS c
WHERE a~matnr = itab-matnr
and werks = itab-werks.
‎2008 Aug 19 12:23 PM
Hello
try this
SELECT a~matnr
a~werks
b~maktx
c~prctr
c~bklas
C~stprs
c~peinh
INTO TABLE it_detail
FOR ALL ENTRIES IN itab
FROM marc AS a INNER JOIN makt AS b
ON a~matnr = b~matnr
inner join mbew AS c
ON b~matnr = c~matnr
WHERE a~matnr = itab-matnr
and werks = itab-werks.
‎2008 Aug 19 12:23 PM
Hello
try this
SELECT a~matnr
a~werks
b~maktx
c~prctr
c~bklas
C~stprs
c~peinh
INTO TABLE it_detail
FOR ALL ENTRIES IN itab
FROM marc AS a INNER JOIN makt AS b
ON a~matnr = b~matnr
inner join mbew AS c
ON b~matnr = c~matnr
WHERE a~matnr = itab-matnr
and werks = itab-werks.
‎2008 Aug 19 12:26 PM
‎2008 Aug 19 12:36 PM
add this for compare b and c
ON b~matnr = c~matnrhope this will help you
otherwise let me know the error.
and check your where clause
Thanks
Anirudh
‎2008 Aug 19 12:34 PM
Hi,
Try this.
SELECT a~matnr
a~werks
b~maktx
c~prctr
c~bklas
C~stprs " c is in CAPS change it
c~peinh
INTO TABLE it_detail
FOR ALL ENTRIES IN itab
FROM marc AS a INNER JOIN makt AS b
ON amatnr = bmatnr
inner join mbew AS c
<give the field to compare in table b and c using ON condition>
WHERE a~matnr = itab-matnr
and werks = itab-werks.
Sharin.
‎2008 Aug 19 12:36 PM
Hi,
Pls find the below piece of code.
begin of it_detail occurs 0,
matnr like mara-matnr,
werks like marc-werks,
prctr like marc-prctr,
maktx like makt-maktx,
bklas like mbew-bklas,
stprs like mbew-stprs,
peinh like mbew-peinh,
end of it_detail.
SELECT a~matnr
a~werks
a~prctr
b~maktx
c~bklas
C~stprs
c~peinh
INTO TABLE it_detail
FROM marc AS a INNER JOIN makt AS b
ON amatnr = bmatnr
inner join mbew AS c
on amatnr = cmatnr
FOR ALL ENTRIES IN itab
WHERE a~matnr = itab-matnr
and a~werks = itab-werks.
if it is not working, pls send me the error message that you are getting.
Thanks,
Sreeram.
Edited by: Sreeram Prasad on Aug 19, 2008 5:07 PM
Edited by: Sreeram Prasad on Aug 19, 2008 5:12 PM
‎2008 Aug 19 12:38 PM
hi
you can try this
SELECT a~matnr
a~werks
b~maktx
c~prctr
c~bklas
C~stprs
c~peinh
INTO TABLE it_detail
FOR ALL ENTRIES IN itab
FROM marc
INNER JOIN makt AS b
ON amatnr = bmatnr
inner join mbew AS c
ON amatnr = cmatnr
WHERE a~matnr = itab-matnr
and werks = itab-werks.
u can take help of this
SELECT ekko~ebeln
ekko~ekorg
ekko~aedat
ekko~lifnr
lfa1~name1
ekpo~ebelp
ekpo~matnr
ekpo~werks
ekpo~txz01
ekpo~menge
INTO TABLE i_ekko
FROM ekko
INNER JOIN ekpo ON ekkoebeln = ekpoebeln
INNER JOIN lfa1 ON ekkolifnr = lfa1lifnr
WHERE ekko~ekorg IN s_ekorg AND
ekko~ebeln IN s_ebeln AND
ekko~aedat IN s_aedat.
Regards
Atul
‎2008 Aug 19 12:42 PM
Hi ,
Try this .
first please check whether the table ITAB has entries in it. If there are no entries , this select will fail.
if not itab[] is initial.
SELECT a~matnr
a~werks
b~maktx
c~prctr
c~bklas
C~stprs
c~peinh
INTO TABLE it_detail
FOR ALL ENTRIES IN itab
FROM marc AS a INNER JOIN makt AS b
ON amatnr = bmatnr
inner join mbew AS c
on bmatnr = cmatnr
WHERE a~matnr = itab-matnr
and a~werks = itab-werks.
endif.
Regards,
Chitra
‎2008 Aug 19 12:50 PM
Hi ,
You can try the following code.
select a~matnr
a~werks
b~maktx
c~prctr
c~bklas
c~stprs
c~pein
INTO TABLE IT_DETAIL
FOR ALL ENTRIES IN IT_TAB
FROM MARC AS a INNER JOIN MAKT AS b
ON aMATNR = bMATNR
INNER JOIN MBEW AS c
ON aMATNR = cMATNR
WHERE amatnr = it_tabmatnr
and
werks = it_tab-werks .
This query is going to fetch the correct data.Because we are filtering the data based on the MATNR(material number) to the maximum extent .
Regards
Navy
‎2008 Aug 19 12:51 PM
hi
Try to do like this...
SELECT a~matnr
a~werks
b~maktx
c~prctr
c~bklas
C~stprs
c~peinh
INTO TABLE it_detail
FOR ALL ENTRIES IN itab
FROM ( (marc AS a INNER JOIN makt AS b
ON amatnr = bmatnr )
inner join mbew AS c )
WHERE a~matnr = itab-matnr
and werks = itab-werks.
With Regards.
Always Learner
‎2008 Aug 19 12:56 PM
Hi Priyanka,
1]You dont have field by name prctr in MBEW Table please correct this first
2]When you are declaring WERKS field in Internal Table declare this of type WERKS_D
3] Add BMATNR = CMATNR in your join statement as shown below.
SELECT a~matnr
a~werks
b~maktx
c~bklas
c~stprs
c~peinh
INTO TABLE it_detail
FROM marc AS a
INNER JOIN makt AS b
ON amatnr eq bmatnr
inner join mbew AS c
on bmatnr eq cmatnr
FOR ALL ENTRIES IN itab
WHERE a~matnr eq itab-matnr
and a~werks eq itab-werks.
Thanks
Sudharshan
‎2008 Aug 19 1:22 PM
Hi,
Pls find the below piece of code.
begin of it_detail occurs 0,
matnr like mara-matnr,
werks like marc-werks,
prctr like marc-prctr,
maktx like makt-maktx,
bklas like mbew-bklas,
stprs like mbew-stprs,
peinh like mbew-peinh,
end of it_detail.
SELECT a~matnr
a~werks
a~prctr
b~maktx
c~bklas
C~stprs
c~peinh
INTO TABLE it_detail
FROM marc AS a INNER JOIN makt AS b
ON amatnr = bmatnr
inner join mbew AS c
on amatnr = cmatnr
FOR ALL ENTRIES IN itab
WHERE a~matnr = itab-matnr
and a~werks = itab-werks.