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: 

migration of customer Hierarchies

0 Kudos

Hello

I am trying to create customer hierarchies within version 46c but cannot get the BAPI

'BAPI_CUSTOMER_HIERARCHIE_INS' to insert the customer to the hierarchie nodes.

It will work fine manually using VDH1N - I tried to use the record function in LSMW using VDH1N and VDH1 (this one created the link if there was only 1 relationship).

I have approximately 2000 customers to link to the hierarchy nodes.

anyone got any ideas. or is there another way to do it?

cheers

Nick

1 ACCEPTED SOLUTION

Former Member
0 Kudos

One of the requirements for the BAPI to work is that the customer must exist before you add to the hierarchy. Does your data meet this criteria? I think BAPI should work, can you tell us what is not working for you with the BAPI?

7 REPLIES 7

Former Member
0 Kudos

One of the requirements for the BAPI to work is that the customer must exist before you add to the hierarchy. Does your data meet this criteria? I think BAPI should work, can you tell us what is not working for you with the BAPI?

0 Kudos

Hello

yes the customer exists and the customer node that i am trying to add it to. when i enter the details into the BAPI I enter:

customer - sales org - dist chan - division - from date - parent customer (node) - sales org - dist chan - division and end date.

On this system a specific hierarchy type is used - not the standard .. could this be the reason?

If i put in this specific hierarchy type i get no errors in the return ??

0 Kudos

Along with the parent customer id, enter the PARENT_SALES_ORG, PARENT_DISTR_CHAN and PARENT_DIVISION field values also. Make sure your customer numbers are in internal format.

It may also help, if you run the BAPI in test mode from SE37.

Hierarchy type should not be the issue. Can I assume that you get no errors in the return structure and you don't see the hierarchy being created?

Srinivas

0 Kudos

I am running the BAPI through the se37 in test mode and with the additional fileds you mention ... why i think that it is the type is that i get no errors in the return structure and the hierachy is not updated / inserted. I have debugged the BAPI and in 2 places but have not found any clues.

Although I have 5 years data migration and abap experience .. this is the first time i have tried to create hierarchies! I will get the config guys to check the type again.

thanks for you help so far.

0 Kudos

I checked the documentation and it says you it saves the data immediately, but just to make sure, can you call BAPI_TRANSACTION_COMMIT after this call, if the return structure has no error messages? Just a shot in the dark!!!

0 Kudos

Thanks

that is exactly what was needed .. i was trying to run it through the SE37 test mode and it was not doing the commit. i put exactly the same code into abap and also ran the commit and it works fine.

thanks for you help

0 Kudos

Glad to hear that, but I don't know why the documentation said the data will be saved immediately. Anyway, your problem is solved, so we will wait for the documentation to be updated in later versions!!!