Technical Articles
Troubleshooting the Data Length issues in SAP Landscape Transformation Replication Server
Introduction:
This blog post is to demonstrate how to troubleshoot the issues related the data, often times you might be facing issue with data when you want to replicate it from source to target via SAP Landscape Transformation Replication Server
For example:
The length of the field
The data type and few others.
In this blog post I will be talking about the situation where in the initial load or replication fails due the issues with data length mismatching between source and target.
There might be some specific requirements where in while replicating data from an SAP Source like SAP S/4HANA to Non-SAP Target due to the business requirements the filed types, the filed lengths and also filed names might be different between source and targets.
Please refer to this note for how to align with data types when source and target Databases are different, refer to the pdf attached in the note.
Considerations:
The Replication is setup as follows: SAP S/4HANA –> SAP Landscape Transformation Replication Server –> Database DB2 on Z/OS
Table structure in SAP S/4HANA does not match with the structure in DB2. Some of the fields are ignored in target and some of the fields are having different data type in target when compared with Source.
References:
https://blogs.sap.com/2016/07/01/slt-replicate-view-from-non-abap-source/
https://blogs.sap.com/2018/10/30/slt-configuration-for-data-replication-from-s4hana-fashion-to-sap-car-system/
2394986 – SAP Landscape Transformation Replication Server – Data Type Mapping
Issue:
One of the fields in Source has a field with data length more than 10 characters (unfortunately entered manually and was difficult to find out which record was it) where in target can accept only 8 Characters. The table has 787897 records after inserting 750,614 records out of 787,897 the load has failed with the error shown below
Cannot move value ‘ 72000’ to the target field
Cannot move value ‘ 60000’ to the target field
System error occurs when calling function module in target system
System error (portion 0000000001, conversion object Z<TABLENAME>_00H, at 161248)
connection closed (no data) (conversion object Z<TABLENAME>_00H)
SYSLOG:
C *** ERROR => DB2 Call ‘SQLSetStmtAttr CHAINING_END’ Error: conHdl = 01 SQLCODE = -99999 : [IBM][CLI Driver] CLI0111E Numeric value out of range. SQLSTATE=22003
[dbdb2cli.c 6610]
C {root-id=005056AD70671EEB90F802CF546EFD64}_{conn-id=608F0AA9B756F903E10000000A03541D}_39
C DB2Trc: INSERT INTO “/1LT/10000001137” ( “MATNR” , “MEINH” , “EAN11” , “XXXXXXXXX” , “COMMSUBCLS_CODE” , “GE\
C DB2Trc: NRC_ARTICLE_ID” , “CREA_DATE” , “CREATED_BY” , “LAST_UPD_DATE” , “LAST_UPD_BY” , “DIV_NUM” , “DEPT_N\
C DB2Trc: UM” , “COMM_NUM” , “SRP_AMT” , “VNDR_NUM” , “UMREZ” , “LGSTC_MAT_CATEGORY” , “SALES_MATERIAL” ) VALU\
C DB2Trc: ES( ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? ) ;
B ***LOG BY4=> sql error -99999 performing INS on table /1LT/10000001137 [dbdbslst 5137]
B ***LOG BY0=> [IBM][CLI Driver] CLI0111E Numeric value out of range. SQLSTATE=22003 [dbdbslst 5137]
How to identify the Records causing the issue:
To find out the records that were causing the issue with respect the length, you have to enable the debug mode. Below are the steps to be followed to debug and dig out the incorrect data.
Go to LTRC > Select the MT ID > go to Data Transfer Monitor tab > Select the Table and double click on the table name.
Now Click on Display button
Now Click on Go To -> Function Group button
Now you Double click on the line which says Function Modules
Now click on the function module with /1LT/QL1OLC_100000000001212
And now you need to insert some break points on Call Function /1LT/QL1OLI_100000000001212 (which is the reader function and reads data from source)as shown in the screen below
Another break point on Call Function /1LT/QL1OLO_100000000001212 which writes the data to the target
After these break points are set now got SE38 and run the program DMC_STARTER
After pressing F8 you will be seeing the screen in which you have to validate the entries with the values you see in the Data Transfer Monitor tab ( from LTRC)
Now enter the access plan ID in which the error has occurred and change the transfer behavior to 2 so that the records are inserted one by one, and the debugger will stop exactly at the point at which the record insert fails.
And now click on execute which will give you a warning as below, confirm your decision if its ok for you to load the data
Once confirmed the debugger will start
The first break point at read function reads around 19K records from source SAP S/4HANA which are part of the failed package within the access plan
Now Scroll down to the writer function and run it
Also enable few more break points as shown below to capture more information
Now go to Loop AT _IT_IO_R_<TABLENAME> and click on the table to get to the records in the package
Sort on the Field MATNR to find out he rows which are longer than the field length allowed in the target ( in this case only 8 characters are allowed in target
Highlighted are the 2 rows that was causing the initial load to fail
So now that you have identified the rows that are causing the issues in replication you now have two option to resolve the issue.
- Stop the replication, go to source and delete these 2 records from the table which are created incorrectly w.r.t field length, and restart the replication. If the table is too large then keep in mind this is going to be time consuming as the initial load will be reinitiated.
- Delete the incorrect rows from the structure with in the SAP Landscape Transformation Replication Server itself as shown below and resume the initial load continued by replication.
Confirm the deletion
Now go back to the debugger mode and rerun the function modules
Now the Replication will be completed successfully.
Hope this was useful for you to troubleshoot the data related issues while replicating.
– Brought to you by the S/4HANA RIG