Function Module To Return Head Of Organisation Unit 

Is there any Function Module which will return the Head of Organisation unit?

There are several Function modules which can do the job.

E.g.,

Function module - BBP_OM_DETERMINE_COMPANY

Here is the sample code as well.

        CALL FUNCTION 'BBP_OM_DETERMINE_COMPANY'
          EXPORTING
            i_user_id                   = is_import-uname
          IMPORTING
            e_partners                  = ls_ord_partner
          EXCEPTIONS
            no_company_found            = 1
            attribute_company_not_found = 2
            no_partner_function_found   = 3
            no_business_partner_found   = 4
            OTHERS                      = 5.
        IF sy-subrc EQ 0.
          MOVE-CORRESPONDING ls_ord_partner TO wa_partner.
          wa_partner-addr_type   = c_ad_org.
          wa_partner-addr_origin = c_addr_origin_master.
        ENDIF.
 

Here is the documentation as well.

FUNCTION -  BBP_OM_DETERMINE_COMPANY

Functionality

Determines the company (sold-to party) using

Username (sy-uname)
Organizational unit (for purchasing organization "0 50000050")

Business partner number (10 character number)
Business partner GUID

If several parameters are transferred to the function module, the system checks whether they belong to the same company. If they do not, the function module does not supply a result.

Parameters
I_USER_ID
I_ORGUNIT_ID
I_PARTNER
I_PARTNER_GUID
I_LOGSYS
E_ORGUNIT
E_PARTNERS
ET_COMPC

Exceptions
NO_COMPANY_FOUND
ATTRIBUTE_COMPANY_NOT_FOUND
NO_PARTNER_FUNCTION_FOUND
NO_BUSINESS_PARTNER_FOUND
NO_COCODE_FOUND
OBJECT_ID_NOT_FOUND
INTERNAL_ERROR

Function Group
BBP_OM

Get help for your ABAP problems
Do you have a ABAP Question?

ABAP Books
ABAP Certification, BAPI, Java, Web Programming, Smart Forms, Sapscripts Reference Books

More ABAP Tips

Best regards,
SAP Basis, ABAP Programming and Other IMG Stuff
http://www.erpgreat.com

All the site contents are Copyright © www.erpgreat.com and the content authors. All rights reserved.
All product names are trademarks of their respective companies.  The site www.erpgreat.com is in no way affiliated with SAP AG. 
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk. 
 The content on this site may not be reproduced or redistributed without the express written permission of 
www.erpgreat.com or the content authors.