cancel
Showing results for 
Search instead for 
Did you mean: 

content conversion error - SP14

Former Member
0 Kudos

I am getting parser error when i convert flat-file to xml

it is uisng field seperator as ',' and they are not fixed type, so if the field is not sent, it uses ,, basially position the field with white space. this is how i am receiving file from source.

error -

Whitespace is not allowed at this location. Error processing resource 'file:///C:/Documents and Settings/Administrator/Loca...

The XML page cannot be displayed

Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.

-


Whitespace is not allowed at this location. Error processing resource 'file:///C:/Documents and Settings/Administrator/Loca...

H,000332278A,war,331461,Ms.,Kay,Mccall,,Hatcher Stubbs Land Hollis & Rothschild,Suite 500-Corporate Center,233,12th,Stre...

Message was edited by: kumar p

Message was edited by: kumar p

Accepted Solutions (0)

Answers (3)

Answers (3)

stefan_grube
Active Contributor
0 Kudos

Hi Kumar,

Which SP do you have? In older SP is a problem when the last field of the configuration is a space.

Check your configuration and delete all trailing spaces.

For example: 'H,000332278A,war,331461 '

Regards

Stefan

Former Member
0 Kudos

Thanks for info, i have already gone thru the logs u mentioned.

here is the error -

Whitespace is not allowed at this location. Error processing resource 'file:///C:/Documents and Settings/Administrator/Loca...

H,000332278A,war,331461,Ms.,Kay,Mccall,,Hatcher Stubbs Land Hollis & Rothschild,Suite 500-Corporate Center,233,12th,Stre...

here is the input

H,000316673B,war,316673,Mr.,John P.,Farrell,,,,5410,W14,Rd,Mesick,MI,49668,,231-885-1232

J,000316673B,war,,?,X

L,000316673B,war,22600,1,20.00

H,000324793A,war,324793,,,,,Watertown Police Department,attn: Pam Kwosniewski,119 S,Maple,St,Watertown,SD,57201,,605-882-6210

J,000324793A,war,4459015970,?,$

L,000324793A,war,64483,2,40.00

H,000327995A,war,327995,,,,,Farmers Savings Bank,attn: David Wingert,17 W,2nd,St,Remsen,IA,51050,,712-786-1143

J,000327995A,war,5396550163612414,10/01/05,M

K,000327995A,war,332296,Mr.,David,Wingert,,,,,PO Box 26,,Remsen,IA,51050-0026,,

L,000327995A,war,22620R,1,20.00

here is the content conversion module

localejbs/AF_Modules/MessageTransformBean Local Enterprise Bean plain2xml

Parameters -

pla2xml Transform.Class com.sap.aii.messaging.adapter.Conversion

plain2xml Transform.ContentType text/xml;charset=utf-8

plain2xml xml.conversionType StructPlain2XML

plain2xml xml.processFiledNames fromConfiguration

plain2xml xml.documentName SALES_ORDER_MT

plain2xml xml.recordsetName Record

plain2xml xml.recordsetStructure Header,1,CreditCard,1,LineItem,*

plain2xml xml.keyFieldName MyKey

plain2xml xml.keyFieldType CaseSensitiveString

plain2xml xml.Header.fieldNames RecordType,OrderID,OrderType,Address

plain2xml xml.Hader.fieldSeperator ,

plain2xml xml.Header.keyFieldValue H

plain2xml xml.Header.fieldContentFormatting trim

plain2xml xml.Header.endSeperator nl

plain2xml xml.CreditCard.fieldNames RecordType,OrderID,OrderType,Customer,CardName,FirstName,LastName,Addr1,Addr2,Addr3,City,State,Zip,State,Zip,Country,Phone,PhoneReformatted,ShipCharge,OrderTotal,ShipDate,EntryDate

plain2xml xml.CreditCard.fieldSeperator ,

plain2xml xml.CreditCard.keyFieldValue J

plain2xml xml.CreditCardf.fieldContentFormatting trim

plain2xml xml.Header.endSeperator nl

plain2xml xml.LineItem.fieldNames Segment,LineOrder,OrderType,Material,Qty,TextQty,TextFreightCharge,FreightCharge

plain2xml xml.LineItem.fieldSeperator ,

plain2xml xml.LineItem,keyFieldValue L

plain2xml xml.LineItem.fieldContentFormatting trim

plain2xml xml.Header.endSeperator nl

I do not know where why i am getting the error

Former Member
0 Kudos

I have cvs delimited record, which has serveral fields in that record, i want only first 3 fields,

H,1234567890,test,king,master st , 222-333-4444

my coding says

header.fieldnames=recordtype,order,type

header.seperator ,

header,fixedlenghts=1,10,4

it is creating xml with including seperator

H

,123456789

9,te

How to ignore this seperator ?

stefan_grube
Active Contributor
0 Kudos

> How to ignore this seperator ?

Hi Kumar,

Check the correct spelling: sep<b>a</b>rator.

Regards

Stefan

Former Member
0 Kudos

Hi Kumar,

Have you tried using the: fieldContentFormatting parameter with the value "trim" ?

It supposed to wipe leading and subsequent blanks of each field in the flat file.

I think that should do the trick.

Elad.

Former Member
0 Kudos

Hi Kumar,

While doing content conversion you have to mention the field names in header of data type: fieldNames. Hence if the key field is not present it will throw an error in adapter monitoring, FIELD NOT FOUND.

To make note mapping cannot be performed with a flat file as XI understands only XML. Hence content conversion required.

Please go thru these links for step by step procedure to do the same:

/people/venkat.donela/blog/2005/06/08/how-to-send-a-flat-file-with-various-field-lengths-and-variable-substructures-to-xi-30

/people/sap.user72/blog/2005/01/06/how-to-process-csv-data-with-xi-file-adapter

/people/michal.krawczyk2/blog/2004/12/15/how-to-send-a-flat-file-with-fixed-lengths-to-xi-30-using-a-central-file-adapter

/people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file

http://help.sap.com/saphelp_erp2005/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm

/people/venkat.donela/blog/2005/06/08/how-to-send-a-flat-file-with-various-field-lengths-and-variable-substructures-to-xi-30

I hope I have answered your query.

Regards,

Abhy