cancel
Showing results for 
Search instead for 
Did you mean: 

Obtaining Org Unit from Business Partner number

Former Member
0 Kudos

Hi, I am trying to obtain an org unit object id from the bp number that is created when the org unit is created. I am in a BP BADI, so I only have the bp number, and am in the process of creating a new org unit when the BADI is called. I have tried to use RH_STRUC_GET but because we are in the creation process this does not retrieve any results. I understand that this fm reads a buffer to get its results, and the org unit is obviously not in the buffer at this time.

Could anyone help me to find a function module that will find the org unit in this case?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

I am not sure of the BADI, but did u try by searching through SE16 - HRP1001 table?

Try this way on the screen- enter the following values.

Rel.obj.type : 'BP'

ID rel.object : BP obj ID.

and do an open search to pull the Org unit related to the given BP.

If this is helpful, pl do reward.

Thanks

Narasimha

Former Member
0 Kudos

Hi Narasimha,

I have tried this, but the data has not been saved to the database yet, since the BADI is called during the creation process before any save to the database has occured. This is the crux of my problem! The BADI being used is BUPA_GENERAL_UPDATE.

Thanks for your response though.

Does anyone else have any ideas, please?

Former Member
0 Kudos

Hi John,

First obtain the BP GUID and then

You can use the FM CRM_EMPLOYEE_GETORGUNIT by passing the BP GUID.

Please reward if helpful

Former Member
0 Kudos

Hi Ratikant,

Thanks for your suggestion. This may work if I was looking for an employee's org unit, but I was actually looking for the BP record for the org. unit that was being created. It would also depend on whether this function module would work before the save and commit has occurred.

I cannot test you solution since I managed to implement a work around where I saved the org unit using a funtion group in another(earlier) BADI so that I could retrieve it in this BADI. This has been tested and implemented and I don't want to cahnge what is already working!

Many thanks though!