‎2008 May 14 2:20 PM
Hi all,
I am writing the select on MCON data base view . I am adding the profit center field in selection screen , I have to add the profitcenter (MARC-PRCTR) in that select , but the MCON doesn't have the prctr field.
I am writing like the code below.
SELECT * FROM mcon INTO TABLE it_mcon
WHERE werks = p_werks
AND matnr IN s_matnr
AND mtart IN mtart
AND abcin NE space
AND lvorm = space.
in above i have to add the PRCTR field also .
regards.
Ajay
‎2008 May 14 2:23 PM
‎2008 May 14 2:26 PM
Hi,
First find the related fields in the both the tables.
Then write the select statement on them.
‎2008 May 14 2:27 PM
‎2008 May 14 2:39 PM
Hello Ajay-
Below is a simple example similar to your requirement.
tables:mcon,marc.
types:begin of i_test,
matnr type matnr,
mtart type mtart,
prctr type prctr,
end of i_test.
data:t_test type TABLE OF i_test,
w_test type i_test.
select a~matnr
a~mtart
b~prctr into table t_test from mcon as a inner join
marc as b on amatnr eq bmatnr.
loop at t_test into w_test.
write 😕 w_test.
endloop.
Cheers,
~Srini...
‎2008 May 14 2:42 PM