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


Serkan AKKAVAK
Computer Engineer
ABAP Developer & SAP MM SD Consultant
Contact : serkurumsal@yandex.com