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: 

profit center from profit center Group? Urgent!!!!

Former Member
0 Kudos

Hi Experts,

Could u please tell me the way to get all the profit centers belonging to one profit center group...

its urgent...

poinst will be rewared

4 REPLIES 4

Former Member
0 Kudos

Hi Abhay,

You can use the SAP standard 0PROFIT_CTR_0106_HIER, unless you have any special configuration on R/3 side.

<b>Or try this:-</b>

go through this link which ll give you clear idea about the profit center group.

http://help.sap.com/bestpractices/industry/serviceindustries/v346c_us/BBLibrary/documentation/B30_BP...

go through these tables.

CEPC Profit Center Master Data Table

CEPCT Texts for Profit Center Master Data

<b>Rewards point for useful answer.....</b>

regards...

Abhay Singh.

Former Member
0 Kudos

Hi

use the Tables SETNODE and SETLEAF and use repetetive selects for them

or use the fun module 'G_SET_TREE_IMPORT'

see the sample code for the Fun module

Fetching COst center from CC group is same as fetching Profit center from PC group

use the '0101' for Cost center group and '0106' for profit center group

use c_class1 = 0106 c_class2 = 1000 and fetch Profit center

&----


*& Form get_cc_values

&----


  • Get the Cost Centers from Cost Center Group

----


form get_cc_values.

  • Populate the Cost Centers from Cost Center Group

if s_kostl[] is initial.

if p_cgrup is initial.

p_cgrup = c_ndc.

else.

p_cgrup = p_cgrup.

endif.

  • Concatenating Setnode table setclass,subclass fields and

  • Cost Center Group

concatenate c_class1 c_class2 p_cgrup

into v_setid.

  • Calling function module to get SET_HIERARCHY & SET_VALUES

perform frm_g_set_tree_import tables ccenter_group_tab[]

cost_center_tab[]

using v_setid.

loop at cost_center_tab.

rn_kostl-low = cost_center_tab-from.

rn_kostl-high = cost_center_tab-to.

rn_kostl-sign = c_i.

if rn_kostl-low = rn_kostl-high.

rn_kostl-option = c_opt1.

else.

rn_kostl-option = c_opt2.

endif.

append rn_kostl.

endloop.

clear v_setid.

  • endif.

else.

rn_kostl[] = s_kostl[].

endif.

endform. "get_cc_values

&----


*& FORM FRM_G_SET_TREE_IMPORT

&----


  • Subroutine to call the function G_SET_TREE_IMPORT.

----


form frm_g_set_tree_import

tables ccenter_group_tab structure sethier

cost_center_tab structure setvalues

using p_v_setid.

call function 'G_SET_TREE_IMPORT'

exporting

  • CLIENT = SY-MANDT

  • FIELDNAME = ' '

  • LANGU = SY-LANGU

  • NO_DESCRIPTIONS = ' '

  • NO_RW_INFO = ' '

setid = p_v_setid

  • TABNAME = ' '

  • NO_VARIABLE_REPLACEMENT = ' '

  • ROOT_HEADER_ONLY = ' '

  • NO_TABLE_BUFFERING = ' '

  • MAX_HIER_LEVEL = 99

  • DATE_FROM =

  • DATE_TO =

  • IMPORTING

  • SET_NOT_TRANSPARENT =

tables

set_hierarchy = ccenter_group_tab

set_values = cost_center_tab

  • EXCEPTIONS

  • SET_NOT_FOUND = 1

  • ILLEGAL_FIELD_REPLACEMENT = 2

  • ILLEGAL_TABLE_REPLACEMENT = 3

  • OTHERS = 4

.

if sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

endif.

endform. "frm_g_set_tree_import

<b>Reward points for useful Answers</b>

Regards

Anji

Message was edited by:

Anji Reddy Vangala

Former Member
0 Kudos

Dear Abhay

The profit centers would be customised,so u can go to /nspro ->SAP Reference IMG->Find for "Maintain Profit Center Groups" or "Profit Center Group".

You will get all details customised in this manner

Regards,

Reema

Former Member
0 Kudos

Hi Abhay,

These details are maintaining in table setleaf.

SELECT valfrom FROM setleaf

INTO TABLE lt_setleaf

WHERE setclass = c_setco( here it is 0106 for profit center )

AND setname IN s_pgrp.(profit center group)

hope this will help,

reward if find useful!

Antony thomas