cancel
Showing results for 
Search instead for 
Did you mean: 

determine company code and location (plant) w.r.t., cost center

Former Member
0 Kudos

Hi,

How could i determine company code and location based on given cost center. Could anybody please let me know if any table or function module is available to get this.

Thank you

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello Sudhanshu,

for the cost center please check table CSKS.

Thanks

Gaurav

Former Member
0 Kudos

hello Gaurav,

CSKS does not exist in SRM system. moreover i already have cost center and want co code & plant for this cost center.

Thanks

Former Member
0 Kudos

Hello Sudhanshu,

Can you check the FM "META_READ_TABLE" and check whether it helps your purpose. Because as such the data related to cost center is not available in any SRM tables and usually during the creation of SC the system makes a call to the backend system to get the relevant information related to the same.

Regards

Pramod

Former Member
0 Kudos

Hello Pramod,

That's exactly i was doing. below links say it all:

http://scn.sap.com/thread/1548282

http://wiki.scn.sap.com/wiki/display/SRM/META_READ_TABLE?original_fqdn=wiki.sdn.sap.com


Thanks for your comments.


Rgds

Former Member
0 Kudos

Hello Sudhanshu,

Yes from SRM this is the only function module (i am aware of) which helps in getting the data related to cost center. Or else we need to check them manually in the backend ECC system.

Even during the SC creation when we have to select the cost center the system makes a RFC call to the backend system and queries the CSKS table and displays back the result for further selection.

Regards

Pramod

Former Member
0 Kudos

Hi,

As mentioned above im using META_READ_TABLE FM to get company codes from CSKS table of ECC. Below is the code im using:

   DATA:i_opt type STANDARD TABLE OF RFC_DB_OPT, i_fld type STANDARD TABLE OF RFC_DB_FLD,
       i_res type STANDARD TABLE OF TAB512.

Constants:   c_expr(72) TYPE c VALUE 'KOSTL EQ COST_CTR', c_fld(5) TYPE c VALUE 'BUKRS'.

  w_opt-text = c_expr.
w_fld-FIELDNAME = c_fld.
append: w_opt to i_opt,
        w_fld to i_fld.
data i_control type STANDARD TABLE OF BBP_CONTROL_RECORD.
**&&--Get Co code from ECC (CSKS table)
CALL FUNCTION 'META_READ_TABLE'
  EXPORTING
    QUERY_TABLE          = c_table
*   DELIMITER            = ' '
*   NO_DATA              = ' '
*   ROWSKIPS             = '0'
*   ROWCOUNT             = '0'
    LOGICAL_SYSTEM       = v1_logsys
  TABLES
    OPTIONS              = i_opt
    FIELDS               = i_fld
    DATA                 = i_res
    CONTROL_RECORD       = i_control.

however it is giving me 'Communication Error' while executing this piece of code. I guess the problem here is with table i_opt which is holding logical expression. while calling this fm system is not recognizing logical expression 'KOSTL EQ COST_CTR'. Could anybody has any suggestion for this. please advise.

Rgds