Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

SAP Manager import from standard HR Tables

DivyaBharatha
New Contributor
New Contributor

Hi,

As per Saviynt SAP Integration guide, Manager data cannot be imported using Standard SAP HR Tables method as the manager data is stored in a separate HR table.  Please let us know if this is possible with a complex query. If so, please provide the query and recommend the better approach for importing users from SAP.

 https://docs.saviyntcloud.com/bundle/SAP-v2021x/page/Content/Configuring-the-Integration-for-Importi... 

Thanks,

Divya

 

5 REPLIES 5

sudeshjaiswal
Saviynt Employee
Saviynt Employee

Hello @DivyaBharatha,

You need to ask your SAP team to create the custom function module.
and you can use the FM approach for impoting the users.

For Ref : https://docs.saviyntcloud.com/bundle/SAP-v24x/page/Content/Configuring-the-Integration-for-Importing... 

Thanks.

If you find the above response useful, Kindly Mark it as "Accept As Solution".

DivyaBharatha
New Contributor
New Contributor

Thanks for the reply.

Client wants go with Standard HR Table method, is there a way to fetch the manager data by using this approach?

Thanks,

Divya

 

sudeshjaiswal
Saviynt Employee
Saviynt Employee

Hello @DivyaBharatha,

No, it wont be possible to do it via standard table approach.

Thanks.

If you find the above response useful, Kindly Mark it as "Accept As Solution".

DivyaBharatha
New Contributor
New Contributor

Thanks for the confirmation.

Could you please also provide an example of writing back data to SAP?

Thanks,

Divya

FUNCTION Z_UPDATE_MANAGER_DATA.
*"----------------------------------------------------------------------
*"*"Local interface:
*" IMPORTING
*" VALUE(i_employee_id) TYPE <employee_id_type>
*" VALUE(i_new_manager_id) TYPE <manager_id_type>
*" EXPORTING
*" VALUE(e_result) TYPE c
*"----------------------------------------------------------------------

DATA: ls_employee TYPE employee_structure,
ls_manager TYPE manager_structure,
lv_result TYPE c.

SELECT SINGLE * FROM employee_table INTO ls_employee
WHERE employee_id = i_employee_id.

IF sy-subrc = 0.
SELECT SINGLE * FROM manager_table INTO ls_manager
WHERE manager_id = i_new_manager_id.

IF sy-subrc = 0.
ls_employee-manager_id = ls_manager-manager_id.
UPDATE employee_table FROM ls_employee.
lv_result = 'S'. " Success
ELSE.
lv_result = 'E'. " Error: Manager not found
ENDIF.
ELSE.
lv_result = 'E'. " Error: Employee not found
ENDIF.

e_result = lv_result.

ENDFUNCTION.

In this example:

  • Z_UPDATE_MANAGER_DATA is the name of the custom function module.
  • It takes two input parameters i_employee_id and i_new_manager_id, representing the employee ID and the new manager ID, respectively.
  • It updates the manager ID of the employee specified by i_employee_id with the new manager ID specified by i_new_manager_id.
  • It returns an output parameter e_result, indicating the result of the operation ('S' for success, 'E' for error).

[This post has been edited by a Moderator to change formatting.]


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.