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: 

Generic datasource creation using COST and CSKS tables

former_member255627
Participant
0 Kudos

Hi Experts,


I Have a scenario to bring the Data from COST, CSKS. I have created the FM based generic datasource in that I have to write a inner join on both tables to get desired fields.But there is no common field in both tables, but I have to take objnr+2(4) from COST and give this as kokrs in csks table to get data from csks table.

Could you please guide me in fetching data using inner join from both tables?

Thanks & Regards,
Pushpa

2 REPLIES 2

raymond_giuseppi
Active Contributor
0 Kudos

Don't you check the field OBJNR in both tables.('KS' + Controlling Area + Cost Center)

Why don't you use standard Datasources from Business Content like 0COSTCENTER_ATTR and 0CO_OM_CCA_8?

Regards,
Raymond

0 Kudos

If you didn't success (and don't want to use standard DS) try some


* Cost center - 0CO_OM_CCA_8

SELECT * INTO TABLE itab

  FROM cost

  JOIN csks

    ON cost~objnr EQ csks~objnr

  WHERE csks~kokrs EQ p_kokrs

    AND csks~kostl IN s_kostl . " etc.

* Cost Center/Activity Type

SELECT * APPENDING TABLE itab

  FROM cost

  JOIN cssl

    ON cost~objnr EQ cssl~objnr

  WHERE cssls~kokrs EQ p_kokrs

    AND cssls~kostl IN s_kostl . " etc.

Regards,

Raymond