Application Development 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: 

Company code and plant

Former Member
0 Kudos


Hello

I am looking to connect in a SQVI the origin group from ZTKGT_ICO_ACTUAL - HRKFT which is the company code with the plant that is in MARC - WERKS.

In order to do this I need an intermediate table/tables to connect:

ZTKGT_ICO_ACTUAL - HRKFT --- company code --- plant --- MARC - WERKS.

Thanks for the help.

2 REPLIES 2

Former Member
0 Kudos

Hi Daniel,

You can relate your plant to it's Valuation area in T001W and the valuation area to company code in T001K, so your relations would be:

ZTKGT_ICO_ACTUAL-HRKFT = T001K-BUKRS and

     T001K-BWKEY = T001W-BWKEY and

           T001W-WERKS = MARC-WERKS


regards,

Edgar

anubhab
Active Participant
0 Kudos

Hi Daniel,

     You can pass company code value to T001K-BUKRS to get the value of BWKEY. Now pass the T001K-BWKEY to T001W-BWKEY and you'll find the respective plant in T001W-WERKS

data: plant type t001w-werks.

parameters: p_bukrs type t001k-bukrs.

select single a~werks

    into plant

    from t001w as a

    inner join t001k as b

    on a~bwkey = b~bwkey

    where b~bukrs = p_bukrs.

Now you can compare Plant & MARC-WERKS value as per your requirement.

Hope this helps.

Regards,

Anubhab