Querying Organizational Objects from SAP SuccessFactors Employee Central

Objective

After completing this lesson, you will be able to query organizational objects from Employee Central

Organizational Object Query from Employee Central

The process for replication of organizational objects from Employee Central has steps in three systems interacting with each other:

  1. The on-premise SAP S/4HANA system.
  2. The cloud-based middleware, SAP Cloud Integration.
  3. SAP SuccessFactors Employee Central.
Diagram showing the process flow of organizational object replicatio from SAP S/4HANA to Middleware, and then to Employee Central. The process is explained in the following text.

Steps of the process flow:

  1. The query program in the SAP S/4HANA system, Create and Execute Organizational Object Replication Query (RH_SFIOM_ORG_OBJ_REPL_QUERY), calls the outbound Web service getOrganisationalObjectReplicationQuery. While calling the outbound Web service, the query program reads the query settings such as the filtering information, which you’ve defined in Customizing. It also updates the Administration of Organizational Object Query (SFIOM_QRY_ADM) table.
  2. The outbound Web service getOrganisationalObjectReplicationQuery sends the query to the middleware. The filter settings tell the middleware which data records are to be replicated. For example, only active records if you've defined a suitable filter.
  3. The middleware requests the corresponding data from Employee Central using the OData API.
  4. The middleware calls the inbound Web service OrganisationalObjectReplicationNotification in the SAP S/4HANA system to send a notification about the replication status.
  5. The inbound Web service OrganisationalObjectReplicationNotification updates the status in the query administration table.
  6. The middleware calls the inbound Web service OrganisationalObjectReplicationResponse in the SAP S/4HANA system to pass over the data it has received from Employee Central.
  7. The inbound Web service OrganisationalObjectReplicationResponse stores the data in the form of replication requests in the staging area for organizational objects. While storing the replication requests in the staging area, the SAP S/4HANA system reads the key mapping to map Employee Central keys with SAP S/4HANA keys.
  8. The inbound Web service OrganisationalObjectReplicationResponse updates the query administration tables and triggers the SAP_SFIOM_ORG_STRUC_RPRQ_CREATED event.
  9. The processing program Process Organizational Object Replication Requests (RH_SFIOM_PROC_ORG_STRUC_RPRQ) runs, which is scheduled with the SAP_SFIOM_ORG_STRUC_RPRQ_CREATED event as a start condition. The SAP S/4HANA system creates or updates corresponding infotype records in Organizational Management and updates the application log. While storing the data in the infotypes, it uses the key mapping and the field mapping settings that you've made in the Business Integration Builder.

Types of Queries Triggered by the Organizational Object Query Program

TypeMeaning
Last Modified Query

This query requests all data that corresponds to your selection criteria and was changed after the last modified date. The last modified date is the time stamp of the last query that was created by the Create and Execute Organizational Object Replication Query (RH_SFIOM_ORG_OBJ_REPL_QUERY) program with the same selection variant. The program triggers this type of query when no specific objects are entered on the selection screen.

When a change date is entered or the Initiate Full Load checkbox is selected, the program also triggers this type of query and resets the last modified date to the change date.

The query shows the error message Query for EC instance <Employee Central instance>, EC entity <Employee Central entity> already sent for templ. grp <transformation template group> if the same Employee Central entity is used in more than one transformation template group. Make sure that you use the transformation template the Employee Central entity has been added to in only one transformation template group.

Object-Specific QueryThis query requests data for specific organizational objects, whose IDs you entered on the selection screen of the Create and Execute Organizational Object Replication Query program. That is, the program triggers a full load of the objects in question.

Query Administration Table

The Administration of Organizational Object Query (SFIOM_QRY_ADM) table stores an entry for each query being triggered by the Create and Execute Organizational Object Replication Query (RH_SFIOM_ORG_OBJ_REPL_QUERY) program.

Information Stored by Query

Type of InformationMore Info
Unique ID of the query.Each new query triggered by the program gets a new ID.
ID of the transformation template group.You enter the template group on the program selection screen.
Employee Central instance and Employee Central entity.The Employee Central instance and Employee Central entity are derived from this template group.
Full transmission start date (FTSD).You enter the FTSD on the program's selection screen.
Last modified dateThis is the time stamp of the last query that was created by this program with the same selection variant.
Next last modified date.This is the time stamp of the current query. With the next query, this time stamp is transferred to the last modified date and the time stamp of the new query is stored as next last modified date.
Query type 
Query status 
UserThe name of the user who ran the query program manually or scheduled it to be run in the background.
Time stamp of the last program run.The time when the program was executed manually or has last run in the background.

Query Selection Parameters Table

The Selection Parameters for Organizational Object Query (SFIOM_QRY_ADMDT) table stores the parameters that you entered on the selection screen of the Create and Execute Organizational Object Replication Query program. For example, the object IDs or the change date you specified (if applicable), or whether the Enable Payload Logging checkbox was selected.

Organizational Object Query Management

Resetting Organizational Object Queries

In some cases, it is necessary to reset the status of organizational object queries, so that the next scheduled query can run. You can also delete queries selectively.

Context

Set the query status manually to Failed if a query sent by the Create and Execute Organizational Object Replication Query (RH_SFIOM_ORG_OBJ_REPL_QUERY) program remains in the Sent or In Process status for a longer period of time.

Resetting the status is necessary since the next query cannot be created before the current query has one of the statuses Successful or Failed. A query remains in the Sent status if it doesn’t reach the middleware, for example, due to configuration issues. It remains in the In Process status if data can't be transferred from Employee Central. If the query remains in the Sent status, it can be resent after a five-minute timeout has passed.

You can also delete single queries completely.

To mass-delete queries with the type Object-Specific Query and one of the statuses Successful or Failed, use the Delete Queries from Admin Tables for Organizational Objects (RH_SFIOM_DEL_QRY_ADM) program.

Procedure

  1. Go to the Reset Query Administration Table (SFIOM_RESET_QRY_ADM) transaction in your SAP S∕4HANA system.
  2. To reset the status, select an entry with the Sent or In Process status and choose Set Status to Failed.

    You can't reset the status of queries that already have the status Successful or Failed.

    Since the queries are triggered and administered by the SAP S∕4HANA system, you can't use the middleware to reset the query status.

  3. To delete queries, select one ore more entries and choose Delete Query.

    In productive system environments, only delete queries of the Object-Specific Query type and only if they have one of the statuses Successful or Failed. If you delete other types of queries, the last modified date is removed. This means that the next query will trigger a full load (if you don't enter a change date in the Select Employees with Data Changes After section).

Deleting Organizational Object Queries

Delete queries with the type Object-Specific Query and the statuses Successful or Failed regularly, to clean up the query administration tables and minimize the number of records in these tables.

Context

Using the Delete Queries from Admin Tables for Organizational Objects (RH_SFIOM_DEL_QRY_ADM) program, you can mass-delete queries that were sent by the Create and Execute Organizational Object Replication Query (RH_SFIOM_ORG_OBJ_REPL_QUERY) program. The RH_SFIOM_DEL_QRY_ADM program deletes entries from the following tables:

  • Administration of Organizational Object Query (SFIOM_QRY_ADM)

  • Selection Parameters for Organizational Object Query (SFIOM_QRY_ADMDT)

You cannot delete queries with the type Last Modified Query or with one of the statuses Sent or In Process using the RH_SFIOM_DEL_QRY_ADM program. If you must delete such queries, go to the Reset Query Administration Table (SFIOM_RESET_QRY_ADM) transaction.

Procedure

  1. Schedule the Delete Queries from Admin Tables for Organizational Objects (RH_SFIOM_DEL_QRY_ADM) program to be run regularly in the background.
  2. On the selection screen of the program, make the following settings:
    • Transformation Template Group: To delete queries sent for a specific transformation template group, select the template group. To delete all queries that have the status you select and were sent before the date you specify, leave this field empty.

    • Query Status: The default is to delete all queries with the statuses Successful and Failed. You can also choose to delete either only Successful or only Failed queries.

    • Delete Before Date: Specify a date up to which queries are to be deleted. The default is today’s date. The specified date is not included.

      For example, if you enter June 1, entries created on May 31 or earlier are included. Entries created on June 1 are not included.

    • Test Mode: To run the program in a test mode, select this checkbox.

Results

If you run it in the test mode, the program displays statistical information and lists the entries to be deleted.

If you deselect the Test Mode checkbox, the program displays statistical information and deletes the entries from the tables SFIOM_QRY_ADM and SFIOM_QRY_ADMDT that suit your selection criteria.

Query Organizational Objects Manually from Employee Central

Log in to track your progress & complete quizzes