Uploaded by Eleodora Lima

3006964 E 20220408

advertisement
2022-04-08
3006964
3006964 - How to debug the employee master data
replication from SAP SuccessFactors Employee Central
to SAP ERP
Version
2
Type
SAP Knowledge Base
Article
Language
English
Master
Language
English
Release
Status
Released to Customer
Category
How To
Component
LOD-EC-INT-EE (Employee Integration EC to ERP
Released On
On Premise)
21.01.2021
Please find the original document at https://launchpad.support.sap.com/#/notes/3006964
Symptom
The employee master data replication
• fails, but the error messages are not sufficient to solve the underlying problem;
• is successful, but the data in the ERP system is incorrect;
• is incomplete, and expected data is missing in the ERP system.
You want to analyze the system behavior with the debugger.
Environment
• SAP SuccessFactors Employee Central Integration to SAP Business Suite
• Replicating Employee Master data from Employee Central to SAP ERP HCM
• Employee Central Payroll using Point-to-Point Integration
Reproducing the Issue
Replicate an employee from SuccessFactors Employee Central to an SAP ERP or ECP system.
Resolution
"Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to
real data is purely coincidental."
The following three sections Debugging preparations, How to set breakpoints, and Analyzing data from
SuccessFactors contain best practices to analyze erroneous replications.
First, section Debugging preparations contains step-by-step instructions how to start debugging for the three
different replication scenarios
• Business Integration Builder (BIB),
• Legacy replication,
• Employee Central Payroll's Point-to-Point replication.
Subsequently, section How to set breakpoints describes how to
© 2022 SAP SE or an SAP affiliate company. All rights reserved
1 of 20
2022-04-08
•
•
•
•
•
3006964
Debug from the very beginning,
Find out where a specific error message is raised,
Debug the decoupled infotype framework,
Debug central coding parts specific for the different replications,
Debug the evaluation of the payroll area status.
Finally, section Analyzing data from SuccessFactors explains how the data passed from SuccessFactors can
be retrieved and analyzed.
Debugging preparations
• Business Integration Builder
1. Start report ECPAO_EE_ORG_REPL_QUERY (in test mode) for the respective transformation
template group and external employee ID you want to analyze.
2. Go to transaction SRTUTIL, click on "Message Monitor"
and execute the search in an appropriate time interval.
© 2022 SAP SE or an SAP affiliate company. All rights reserved
2 of 20
2022-04-08
3006964
3. You should see the following pattern of messages:
(If you do not see any messages at all in SRTUTIL, check in transaction SXMB_MONI.) For
debugging, we need the middle request with receiver interface
EmployeeMasterDataAndOrgAssignmentBundleReplicationRequest_In. It contains the data from
SuccessFactors to be stored in the ERP system.
Double-click on this message and download the XML by clicking on the XML button.
As an aside, the message created first (the one without an receiver interface) contains the query
sent to SuccessFactors' Compound Employee API to get the employee's data. You can view this
query by double-clicking on the message line and choosing "Original XML"
© 2022 SAP SE or an SAP affiliate company. All rights reserved
3 of 20
2022-04-08
3006964
The result will be something like
where you can already retrieve some helpful information.
4. Go to transaction SE80, open package PA_SE_IN, navigate to the interface
EmployeeMasterDataAndOrgAssignmentBundleReplicationRequest_In, double-click on it, and
click on "Test".
In the upcoming popup choose "Execute" without making any changes.
© 2022 SAP SE or an SAP affiliate company. All rights reserved
4 of 20
2022-04-08
3006964
5. On the next screen, upload the XML you stored in step 3.
You should now see something like this:
(Note that the content of the ReferenceID tag is the the technical query key you see in the output
of report ECPAO_EE_ORG_REPL_QUERY from step 1.)
6. Make sure that the file you just uploaded corresponds to the right query. For that, copy the
content of the ReferenceID tag,
© 2022 SAP SE or an SAP affiliate company. All rights reserved
5 of 20
2022-04-08
3006964
go to transaction SE16N for table ECPAO_QRY_ADMDT, enter the copied ReferenceID in the
QRY_UUID field, and execute.
In the result table, you see the selection parameters used for report
ECPAO_EE_ORG_REPL_QUERY in step 1. You can therefore double check that you uploaded
the correct query.
7. If you test the service now, you will replicate the employee again with the payload contained in
the uploaded XML.
8. Now you can set breakpoints in order to debug the employee replication. After you set a
breakpoint and test the service again, the debugger will open.
In general you need to set external breakpoints for efficient debugging. By the above approach,
the replication will be done by your user, and not the standard replication user. This allows you to
set the external breakpoints for your user and not for the replication user. This ensures that you
© 2022 SAP SE or an SAP affiliate company. All rights reserved
6 of 20
2022-04-08
3006964
do not interfer with the regular replication.
• Legacy replication
1. Manually replicate the employee to be analyzed from the SuccessFactors Data Replication
Monitor.
2. Go to transaction SRTUTIL, click on "Message Monitor"
and execute the search in an appropriate time interval.
3. You should see a message with interface name
EmployeeMasterDataBundleReplicationRequest_In or
EmployeeMasterDataReplicationRequest_In which corresponds to the replication you initially
triggered.
The payload of this message contains the data from EC to be replicated to the ERP system.
Double-click on this message, click on the "Original XML" button to view the payload, and confirm
that it contains the data of the correct employee. Afterwards, click on the XML button to donwload
the payload.
© 2022 SAP SE or an SAP affiliate company. All rights reserved
7 of 20
2022-04-08
3006964
4. Go to transaction SE80, open package PA_SE_IN, navigate to the interface
EmployeeMasterDataBundleReplicationRequest_In or
EmployeeMasterDataReplicationRequest_In (depending on the interface you encountered in step
3), double-click on it, and click on "Test".
In the upcoming popup choose "Execute" without making any changes.
© 2022 SAP SE or an SAP affiliate company. All rights reserved
8 of 20
2022-04-08
3006964
5. On the next screen, upload the XML you stored in step 3.
Then, click on the "XML Editor"
and afterwads press "Pretty Printer". You should now see something like
6. Below the CreationDateTime tag, add the line "<TestDataIndicator>true</TestDataIndicator>".
© 2022 SAP SE or an SAP affiliate company. All rights reserved
9 of 20
2022-04-08
3006964
7. If you test the service now, you will simulate a replication of the employee with the payload
contained in the uploaded XML.
8. Now you can set breakpoints in order to debug the employee replication. Once they are set, the
debugger will open as soon as you test the service again.
• Point-to-Point replication
1. Execute report RP_HRSFEC_REPLICATION_STATUS for the employee you want to analyze.
2. In the output table, click on the message ID of the current replication package.
© 2022 SAP SE or an SAP affiliate company. All rights reserved
10 of 20
2022-04-08
3006964
3. Now you arrive at the payload to be replicated.
This XML contains the information coming from SuccessFactors which is to be mapped and stored
in the ERP system. If you click on "Simulate", you can simulate the replication and debug it.
How to set breakpoints
• Debug from the very beginning
• Business Integration Builder
Set a breakpoint in method
II_ECPAOX_EE_MD_ORGAS_BNDL_REQ~EE_MD_ORGAS_BNDLE_REPL_REQ of class
CL_ECPAO_EE_MD_ORGAS_BNDL_REQ.
© 2022 SAP SE or an SAP affiliate company. All rights reserved
11 of 20
2022-04-08
3006964
• Legacy replication
Set a breakpoint in method
II_PAOCF_EC_EE_MDR_BUNDLE~EMPLOYEE_MASTER_DATA_BUNDLE_RE of class
CL_PAOCF_EC_EE_MDR_BUNDLE if you encountered interface
EmployeeMasterDataBundleReplicationRequest_In in step 3
or similarly in method
II_PAOCF_EC_EMPLOYEE_MASTER_DA~EMPLOYEE_MASTER_DATA_REPLICATI of class
CL_PAOCF_EC_EMPLOYEE_MASTER_DA if you encountered interface
EmployeeMasterDataReplicationRequest_In in step 3.
• Point-to-Point replication
Set a breapoint in method SIMULATE_REPLICATION of class
CL_HRSFEC_RS_UI_SIMULATE.
© 2022 SAP SE or an SAP affiliate company. All rights reserved
12 of 20
2022-04-08
3006964
• Find out where a specific error message is raised
Suppose you encounter a certain error in transaction SLG1 after a replication.
If you want to get quickly to the coding part where this error message is raised, you can proceed as
follows.
• By checking the long text of the SLG1 error message, you can derive its ID and number
(compare the last screenshot). The last three digits of "Message no." are the number, the digits
before that constitute the ID. In the above example, the ID is "00" and the number is "058".
• Set a breakpoint as described before. (For the BIB replication, this has to be after the remote
function call of function PROCESS_EE_MD_ORGAS_INB_RFC. So simply set an external
breakpoint in this function module itself.)
• Once the debugger opens, set a breapoint for this specific message ID and number.
© 2022 SAP SE or an SAP affiliate company. All rights reserved
13 of 20
2022-04-08
3006964
• After setting this kind of breakpoint and continuing in the debugger (F8), the debugger will stop
when this particular message is raised.
• Debug the decoupled infotype framework
All replications have in common that the decoupled infotype framework is called after infotype content
was created. In this framework, each infotype xxxx is represented by a class
CL_HRPA_INFOTYPE_xxxx (or CL_HRPA_INFTY_xxxx). These classes are used to initialize data,
perform checks, and store data on the database. In particular, error messages shown in the application
log (transaction SLG1) for the replication often come from the afore mentioned checks. So coding parts
worth checking are methods SPECIFIC_INITIAL_COMPUTATIONS,
SPECIFIC_INSERT_COMPUTATIONS, SPECIFIC_MODIFY_COMPUTATIONS, and
SPECIFIC_DELETE_COMPUTATIONS of classes CL_HRPA_INFOTYPE_xxxx. For example, if you
suspect a problem in the insert logic for infotype 0008, you would set a breakpoint in method
SPECIFIC_INSERT_COMPUTATIONS for class CL_HRPA_INFOTYPE_0008.
Note that - depending on the infotype - there might also be country specific versions of these infotype
classes. For infotype xxxx and country grouping yy the corresponding class would be
CL_HRPA_INFOTYPE_xxxx_yy. So if you see a country specific error message in the replication log,
you might want to check such classes. For example, if an Singapore specific error is raised for infotype
0002, you can set a breakpoint in a suitable method of class CL_HRPA_INFOTYPE_0002_SG.
• Central coding parts
• Business Integration Builder
• Debug the mapping
If you want to debug the mapping or value conversion from the customizing in view cluster
VC_ECPAO_MAP (transaction SM34), set an external breakpoint in method
TRANSLATE_EC_OBJ_TO_INFTY of class CL_ECPAO_IN_PERNR_TRANSFORM.
© 2022 SAP SE or an SAP affiliate company. All rights reserved
14 of 20
2022-04-08
3006964
(Double check that external breakpoints will be set for your user. To do so, go to "Utilities"
in transaction SE80, click on "Settings...", and make sure that the user in the "Debugging"
tab is your user.) Variable TEMPL_FLDS_TAB contains the transformation templates
which need to be processed. The actual mapping is done during the method call
CL_ECPAO_IN_VALUE_TRANSFORMER=>EC_VALUE_TRANSFORMATION.
In method TRANSLATE_EC_OBJ_TO_INFTY, the data from SuccessFactors which is
going to be mapped is contained in variable EC_PAYLOAD_TAB. If this data is not as
expected, you might want to set external breakpoints in methods COOK_I_EC_OBJECT,
COOK_II_EC_OBJECT, and COOK_III_EC_OBJECT of class
CL_ECPAO_IN_EC_OBJECT. These methods are called prior to the call of
TRANSLATE_EC_OBJ_TO_INFTY and might adjust the data from SuccessFactors.
• Debug the infotype generation
If you want to debug the infotype handling after the mapping, set an external breakpoint in
method FINALIZE_INFOTYPES of class CL_ECPAO_IN_INFOTYPE_FACTORY.
This coding is executed after the mapping is completed and the infotype data is generated.
You can analyze the infotypes by checking table A_INFOTYPE_REF_TAB. It contains the
© 2022 SAP SE or an SAP affiliate company. All rights reserved
15 of 20
2022-04-08
3006964
list of infotypes to be saved in the database. For details, you can check the
INFOTYPE_REF entries in this table A_INFOTYPE_REF_TAB. They contain class
instances where the actual infotype data is contained in column INFTY_PRIM_REF of
attribute A_INFOTYPE_TAB.
Note that this is the state of the infotypes before BAdI
ECPAO_IN_EXT_PROCESS_INFOTYPE is called. (The BAdI call happens during the
method call WRITE_INFOTYPE_TO_BUFFER shown in the last screen shot.) It might be
worth to compare the infotype data at this point and after the BAdI is called. Because then
you can make sure whether your BAdI implementation is responsible for certain changes.
• Find out the fields which change
Suppose you want to find out which infotype fields change compared to what is currently
stored on the database. This might be useful if you encounter an error such as RP 456
("Change before earliest retro. date xx acc. to control rec. to py area yy") and you do not
understand which change actually triggers the retrocalculation. Set a breakpoint in method
COMPARE_STRUCTS of class CL_ECPAO_IN_SERVICE_ITF_FACADE.
Now set a watchpoint for variable is_equal. When the debugger stops as the watchpoint is
reached, field symbol <infty> contains the infotype and variable ls_comp-name contains
the field which changed.
• Check on begin or end dates of infotype records
If the begin date differs from BEGDA's mapped value for a non effective dated entity, you
might want to debug method SET_FINAL_DATES of class
CL_ECPAO_IN_SERVICE_ITF_FACADE and check the logic at this point.
© 2022 SAP SE or an SAP affiliate company. All rights reserved
16 of 20
2022-04-08
3006964
• Legacy replication
Method PROCESS_EMPLOYEE of class CL_PAOCF_EC_EE_MDR_IMPL is the central place
where infotypes are generated and therefore a good candidate for setting breakpoints. For
example, if you are interested in the address infotype 0006, set the following breakpoint:
© 2022 SAP SE or an SAP affiliate company. All rights reserved
17 of 20
2022-04-08
3006964
Potential error messages raised during the replication can be viewed in method PROCESS of
class CL_PAOCF_EC_EE_MDR_IMPL. They are contained in the local variable
LT_MESSAGES.
• Point-to-Point replication
Method PROCESS_EMPLOYEE of class CL_HRSFEC_EE_MDR_MAIN is the central place
where infotypes are generated. For example, if you are interested in the personal information
infotype 0002, set the following breakpoint:
• Debug the evaluation of the payroll area status
© 2022 SAP SE or an SAP affiliate company. All rights reserved
18 of 20
2022-04-08
3006964
If an employee who belongs to a payroll area in status "Released for correction" (transaction PA03)
shall be replicated, then - depending on the customizing - the replication will fail or succeed (compare
KBA 2504569). If the behavior is not as expected, you can debug method
CHECK_CORRECTION_PHASE of class CL_ECPAO_IN_PERNR_OF_EMPLOYEE, method
CHECK_CORRECTION_PHASE of class CL_PAOCF_EC_EE_MDR_IMPL, or method
ADD_ERROR_PAYROLL_CORRECTION of class CL_HRSFEC_B2B_MESSAGE_LIST for the
Business Integration Builder, legacy replication, and point-to-point replication, respectively.
Analyzing data from SuccessFactors
After the preparation step 5 (Business Integration Builder), 5 (legacy replication), or 2 (PTP replication), you
have an XML file at hand which contains the data coming from SuccessFactors. (For the Business Integration
Builder, the data is contained in the SourceSystemOutputBase64 tag, but still in Base64 encoded form. It can be
decoded using standard third-party software.)
Here you see the different tags corresponding to the respective SuccessFactors portlets. So if you encounter
problems with, say, the national ID, then a good starting point is to check the content of the national_id_card tag
to see what is actually coming from SuccessFactors.
See Also
Decoupling infotypes
Keywords
debugging, ECP, Point-to-Point, BIB, business integration builder, PTP, Debugger, non-BIB, new infotype
framework, Infotype, 0000, 0001, 0002, 0003, 0006, 0007, 0008, 0009, 0105, HRSFEC_SERVICES, 127,
© 2022 SAP SE or an SAP affiliate company. All rights reserved
19 of 20
2022-04-08
3006964
ECPAO_PROCESSING, 150, PAOCF_EC_SERVICES
Other Components
Component
LOD-EC-GCP-PY
Description
Payroll Integration EC to Employee Central Payroll
Terms of use | Copyright | Trademark | Legal Disclosure | Privacy
© 2022 SAP SE or an SAP affiliate company. All rights reserved
20 of 20
Download