2025 Mar 26 8:45 PM - edited 2025 Apr 02 2:11 PM
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 |
| 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: 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
Request clarification before answering.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 8 | |
| 7 | |
| 6 | |
| 5 | |
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.