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

Is there a FM to find all Nodes above given profit center

kasithunuguntla
Participant
0 Kudos
554

All,

I am trying to find all nodes for a given profit center. when I use KSH3 transaction, I am able to enter the hierarchy and get to the profit centers. Similarly, I should be able to enter the profit center and derive the nodes above this profit center. I dont want to use G_SET_TREE_IMPORT as this is top-down and takes lot of time.

Could anybody please help me in this regard.

Regards

Kasi

1 ACCEPTED SOLUTION

Former Member
0 Kudos
290

Hi,

Look at the below function moduels

BX_AGR_READ_ALL_NODES

BX_FAVOS_READ_ALL_NODES

Regards

Sudheer

7 REPLIES 7

Former Member
0 Kudos
291

Hi,

Look at the below function moduels

BX_AGR_READ_ALL_NODES

BX_FAVOS_READ_ALL_NODES

Regards

Sudheer

ferry_lianto
Active Contributor
0 Kudos
290

Hi,

1. Use BAPI BAPI_PROFITCENTERGRP_GETDETAIL

2. The table HIERARCHYNODES of the above bapi will return accordingly and you can loop at that and write.

Regards,

Ferry Lianto

kasithunuguntla
Participant
0 Kudos
290

All I know is just the profit center. the FM's you have suggested would work if I know the top node of the profit center. I wanted it bottom up rather than top bottom.

Any response would be much appreciated.

Regards

Kasi

kasithunuguntla
Participant
0 Kudos
290

I have created my own code using SETNODE table.

0 Kudos
290

hello kasi Murthy,

If you do not mind could you please share that code please.

I need it urgently or if u can email it to me at pank0906@yahoo.com

Many thanks

Pankaj

0 Kudos
290

Tabele CEPC will have immediate hierarchy one level above profit center. this is CEPC-KHINR. use this KHINR and goto SETNODE-SUBSETNAME = CEPC-KHINR and get the SETNODE-SETNAME which will be 2 levels above the profit center. Use this SETNAME again with SETNODE-SUBSETNAME = SETNODE-SETNAME and get another level up. keep doing this until you get to the top node.

Hope this helps.

  • Get SET Hierarchy details from CEPC and SETNODE tables

READ TABLE I_CEPC WITH KEY PRCTR = I_GLPCA-RPRCTR.

IF SY-SUBRC = 0.

MOVE I_CEPC-KHINR TO I_PROFIT-KHINR.

READ TABLE I_SETNODE WITH KEY SUBSETNAME = I_CEPC-KHINR.

IF SY-SUBRC = 0.

MOVE I_SETNODE-SETNAME TO I_PROFIT-SETNAME.

ENDIF.

ENDIF.

0 Kudos
290

hi thanx kasi for your help.

I hope this will take me to the my destination.

regards

Pankaj