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

select validation

Former Member
0 Likes
642

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

5 REPLIES 5
Read only

former_member226999
Contributor
0 Likes
620

Join MARC on matnr and fetch the values

Read only

Former Member
0 Likes
620

Hi,

First find the related fields in the both the tables.

Then write the select statement on them.

Read only

Former Member
0 Likes
620

Hi Ajay,

for profit center use cepc-prctr.

Read only

Former Member
0 Likes
620

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...

Read only

0 Likes
620

Hi all,

I solved my self.

thansk for your support.

regards,

Ajay