04-06-2016 11:31 AM
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
04-06-2016 12:21 PM
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
04-07-2016 12:31 PM
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