cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Error while using XML to CSV Out of the box SAP Solution in CPI

sbapanapalli65
Explorer
0 Likes
553

Hello Experts, 

I am trying to implement the out of the box solution by SAP to convert the XML structure to CSV.   In current SAP PO environment we have a Proxy to File interface. In SFTP module parameters we maintained the conversion parameters for converting to CSV.  I am following the package provided by SAP " MessageTransformBean - StructureXMLToPlain - TC2".  After updating the following parameters in the iFLow for conversion I am receiving the error given below:

xml.conversionType - StructXML2Plain 
xml.processFieldNames - fromConfiguration
xml.recordsetName - Recordset
xml.recordsetStructure - Oildex_Electronic,Oildex_Electronic_Summary,Oildex_Electronic_Tran
xml.Oildex_Electronic.fieldFixedLengths - 1,2,6,4,7,8,18,4,7,10,12,10,10,11,12,1,6,3
xml.Oildex_Electronic_Summary.fieldFixedLengths - 1,2,10,18,10,12,10,10,11,12,33,3
xml.Oildex_Electronic_Tran.fieldFixedLengths - 1,2,10,10,12,97
xml.Oildex_Electronic.fieldNames - RecordType,CompanyCode,RunTicketDate,AccountingDate,RunTcketNumber,TankNumber,PropertyCode,CorrectedGravity,FieldPrice,NetVolume,AdjustmentValue1,TruckingCharges,StateTaxes,NetValue,AdjustmentIndicator,Blank,TransmissionDate
xml.Oildex_Electronic_Summary.fieldNames - RecordType,CompanyCode,RecordCount,Blank1,Netvolume,GrossValue,AdjustmentValue,TruckingCharges,StateTaxes,NetValue,Blank,TransmissionDate
xml.Oildex_Electronic_Tran.fieldNames - RecordType,Blank,RecordCount,NetVolume,NetValue,Blank1
 
Error received:
Exception Message: java.lang.Exception: java.lang.ArrayIndexOutOfBoundsException: while trying to load from index 3 of an object array with length 3, loaded from local variable 'objects'@ line 907 in script3.groovy
 
Expected output - Record with ID 7 will repeat several times followed by its summary starting with 8 and finally file ends with record id 9Expected output - Record with ID 7 will repeat several times followed by its summary starting with 8 and finally file ends with record id 9

Expected output: File should be created with N number of records with 7 as id - (Details) each set of 7 records will end with a 8 (Summary Record) and finally file will end with record 9.

Today I receive the following error: Exception Message: java.lang.Exception: java.lang.ArrayIndexOutOfBoundsException: while trying to load from index 3 of an object array with length 3, loaded from local variable 'objects'@ line 907 in script3.groovy

What could be the issue please comment. 

Thanks, 
SB

Accepted Solutions (1)

Accepted Solutions (1)

sbapanapalli65
Explorer
0 Likes

Issue is resolved.  For each structure code is expecting keyFieldValue, KeyFieldName, missingLastFields are required here.  After adding these additional parameters conversion happening correctly.

=================================================================

xml.keyFieldName = RecordType
xml.<recordstructurename>.missingLastFields : add
xml.Oildex_Electronic.keyFieldValue = 7
xml.Oildex_Electronic_Summary.keyFieldValue = 8

xml.Oildex_Electronic_Tran.keyFieldValue = 9

Answers (0)