SAP SRM Organization Model
Organization Model displays the functional and reporting structure of an enterprise. Organizational units (departments), positions, and employees (or SAP users), are structured hierarchically in the organizational model.Organization model is widely used in SAP ERP, CRM and SRM. This post only deals with the organization model in SAP SRM.
Transaction in SRM organization model
PPOSA_BBP – Display organization model
PPOMA_BBP – Process organization model
Function Group Related to SRM organization model
BBP_OM_STRUCTURE
BBP_ATTR_PDORG
Function Module
BBP_OM_STRUC_GET_POS_FROM_USER – Get the postion according passed in system user id
BBP_READ_ATTRIBUTES – Read attribute of object in organization model
Object Type in SRM organization model
US = User
S = Position
BP = Business Partner
O = Organization Unit
Below sample code will show how to read plant attribute at postion level from an user id.
First, read the postion id from the current login user id.
DATA: lv_position type HROBJID. * Step 1. get the position id from the current login user id CALL FUNCTION 'BBP_OM_STRUC_GET_POS_FROM_USER' EXPORTING USER = sy-uname IMPORTING POSITION = lv_position EXCEPTIONS PATH_NOT_FOUND = 1 ERROR_READING_STRUCTURE = 2 NO_ROOTS = 3 INVALID_ROOTS = 4 INTERNAL_ERROR = 5 POSITION_IS_AMBIGUOUS = 6 POSITION_IS_UNOCCUPIED = 7 OTHERS = 8.
Second,read the plant attribute at position level.
data: ls_object type SWHACTOR, ls_attr_in type BBP_ATTR_LIST, lt_attr_out type table of BBPS_ATTR. * read the plant attribute for selected position ls_object-otype = 'S'. ls_object-objid = lv_position. ls_attr_in-attr_id = 'WRK'. "plant attribute id CALL FUNCTION 'BBP_READ_ATTRIBUTES' EXPORTING IV_OBJECT = ls_object IV_ATTR_SINGLE = ls_attr_in IMPORTING ET_ATTR = lt_attr_out EXCEPTIONS OBJECT_ID_NOT_FOUND = 1 NO_ATTRIBUTES_REQUESTED = 2 ATTRIBUTES_READ_ERROR = 3 OTHERS = 4.