SAP Knowledge Base Article - Public

2821163 - How to Export the Employees Primary Assignment and Secondary Assignment Data in the Organizational Structure in SAP Cloud for Customer

Symptom

In your organization, some of the Employees have Primary Assignment and Secondary Assignment in the Organizational structure. Your requirement is to view the Primary Assignment and the Secondary Assignment of the Employees in the Organizational structure using Data Source or via an Export of the Employee Assigments in the Organizational Structure.

Environment

SAP Cloud for Customer

Reproducing the Issue

  1. Go to Organizational Management workcenter
  2. Go to Org Structures view
  3. Select the filter icon
  4. In the Valid On field for today's date DD.MM.YYYY and Employee ID: XXXXX, select Go
  5. Employee XXXXX belongs to Z different Org Units
  6. You want to export all the Employee Assignments from the system 

where XXXXX represents the Employee ID
Z represents the number of Organizational Units

Resolution

To export the Employee Assignment from the Organizational Structure, you may follow any of the below approaches:

1) Using the Data Source:

  1. Go to Business Analytics work center
  2. Go to Design Data Sources view
  3. Show All and find the data source Employee Master Data with Data Source ID: CODHCMEMPB
  4. Select Preview
  5. In the Selection tab, provide the Employee ID XXXXX
  6. In the Available Fields tab, tickmark the fieds Department ID, Employee ID, Job
  7. Go back to the Selection tab and select Go

The data source Employee Master Data displays has a cardinality to one and can only show one row per Employee instance. Thus you can see only the Primary Assignment to an Organizational Unit. This will not change.

2) Using the Data Source:

  1. Go to Business Analytics work center
  2. Go to Design Data Sources view
  3. Show All and find the data source Employee Details with Data Source ID: BP_EMPLOYEE_DETAILS
  4. Select Preview
  5. In the Selection tab, provide the Employee ID XXXXX
  6. In the Available Fields tab, tickmark the required fieds Assigned Org Unit, Employee Assignment Role, Department, Employee, Employee ID
  7. Go back to the Selection tab and select Go

The data source Employee Employee Details displays Primary Assignment and the Secondary Assignment of the Employees in the Organizational structure.


3) Using the Export from Data Workbench:

  1. Go to Data Workbench workcenter
  2. Go to Export tab
  3. In the Search field, select the object Employee Organizational Unit Assignment
  4. Select Data
  5. Select field
  6. Select Next
  7. Export Data
  8. Go to the Monitor tab
  9. Download the exported file to view the Primary Assignment and the Secondary Assignment of the Employees in the Organizational structure.

Note:
219 - Role code for the Primary Assignment of the Employee to the Organizational Unit
222 - Role code for the Secondary Assignment of the Employee to the Organizational Unit


4) Using the webservice QueryEmployeeIn

This webservice provides the employees basic data that includes the Primary Assignment and the Secondary Assignment of the Employees in the Organizational structure.

Example of the Request payload that you can execute in the third-party tool:

<n0:EmployeeBasicDataByIdentificationQuery_sync xmlns:n0="http://sap.com/xi/SAPGlobal20/Global">
<EmployeeBasicDataSelectionByIdentification>
<SelectionByEmployeeID>
<InclusionExclusionCode>I</InclusionExclusionCode>
<IntervalBoundaryTypeCode>1</IntervalBoundaryTypeCode>
<LowerBoundaryEmployeeID>XXXXX</LowerBoundaryEmployeeID>
</SelectionByEmployeeID>
</EmployeeBasicDataSelectionByIdentification>
</n0:EmployeeBasicDataByIdentificationQuery_sync>

See Also

Primary Assignment, Secondary Assignment, Employee, QueryEmployeeIn, Data Workbench, Export, Employee Master Data, Employee Details, Assigned Org Unit, Employee Assignment Role, Employee Organizational Unit Assignment, Organizational structure

Keywords

KBA , LOD-CRM-EMP , Employee , Problem

Product

SAP Cloud for Customer add-ins all versions