This blog shall guide you how to retrive the BP from the account  hierarchy using some standard FM’s when data is passed from ECC.
Requirement : To check if the BP transferred from the ECC, is in the 8th level (Account hierarchy), if yes then capture the BP’s on the 6th and 7th level of the hierarchy.

Pre-requisites:

Both ECC, CRM having the Account hierarchy present and connection between ECC and CRM should have been set-up.

Format of the Hierarchy Node: BP/salesorg/division/channel
                                                   e.g.  8986932/13002010

So when a customer is created or changed in ECC (based on some factors like industry key, group), along with all the details of the customer, we need to capture the hierarchy and get the BP of the above levels.

Standard FM (CRM): CRM_BUPA_MTCS_TO_MAIN

Create an implicit Z* enhancement:  Z _BUPA_MTCS_TO_MAIN.

/wp-content/uploads/2013/09/1_271876.png

Let take some BP: 555136 at CRM in BPH Tcode, it’s on the level 8th and the above level BP No’s are 625587 and 762605

2.PNG

These need to be mapped with the BUT000 custom fields L6, L7 Account.
These values need to populate automatically when the data from ECC is created or changed.

So code in the standard FM CRM_BUPA_MTCS_TO_MAIN
You will get the BP no from the ECC:
3.PNG
4.PNG

Now get the path of the BP, if it is in the 8th level or not.
Table: BUT_HIER_NODE

Check in the Hierarchy Node as from ECC it will be in above mentioned format and BP without leading zeroes.
6.PNG

And now give the above hierarchy node guid in
FM:  BUHI_GET_PATH_BY_NODE and get the path.
7.PNG
8.PNG

Then take the hierarchy node guid of the level 1 and 2 respectively and use below FM to get the BP’s.
9.PNG
10.PNG

Use update statement to update the BUT000.
12.PNG
Hope this helps!!

To report this post you need to login first.

1 Comment

You must be Logged on to comment or reply to a post.

Leave a Reply