cancel
Showing results for 
Search instead for 
Did you mean: 

File Content Conversion with data in double quotes

diwakar_chintha
Explorer
0 Kudos

Hi Experts,

I am trying a File content Conversion in module tab.

My Incoming file consists of values in double quotes.

EX:

"Header","1","2","3"

"Text","1","2","3"

"TextData","1","2","3"

"TextData","1","2","3"

"Text","1",3","5"


My Structure is as follows


Record

     Header     1

     Text          *

     Textdata     *



When i am using Recordsetstructure = Header,1,Text,1,TextData,2,Text,1 the data is being convrted to xml successfully.


But when i am using RecrdsetStructure=Header,1,Text,*,TextData,*   it is throwing an error.


Could you please help regarding this.


Thank you in advance



Diwakar

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi Diwakar,

In Recordset Sequence please enable the Variable option then try this,may be it will help you.


Regards,

Rajendra

diwakar_chintha
Explorer
0 Kudos

Hi Raghuraman,

Thanks for your reply.

In have already configured those parameters.

please find the list of parameters i have configured

Module Key          Parameter                               Value

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

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

P2X                    xml.Header.fieldNames          a,b,c

P2X                    xml.Header.fieldSeparator       ","

P2X                    xml.Header.keyFieldValue        Header 

P2X                    xml.Text.fieldNames               a,b,c

P2X                    xml.Text.fieldSeparator               ","

P2X                    xml.Text.keyFieldValue              Text

P2X                    xml.TextData.fieldNames          a,b,c

P2X                    xml.TextData.fieldSeparator          ","

P2X                    xml.TextData.keyFieldValue          TextData

P2X                    xml.conversionType                    StructPlain2XML

P2X                    xml.documentName                    myMessageType

P2X                    xml.documentNamespace              my Name space

P2X                    xml.keyFieldName                         a

P2X                    xml.processFieldNames               fromConfiguration

P2X                    xml.recordsetName                    record

P2X                    xml.recordsetStructure               header,1,Text,*,TextData,*

P2X                    xml.recordsetStructureOrder          var

Please suggest.

Thanks

Diwakar Sharma

pvishnuvardan_reddy
Active Contributor
0 Kudos

Hi Diwakar,

Use two more parameters in the message transform bean.

beginSeparator with value "

endSeparator with value "'nl'

you need to add these two parameter for all i.e. header,text, textdata ones.

Try this and check the outcome.

former_member186851
Active Contributor
0 Kudos

Hello Diwakar,

P2X                    xml.recordsetStructureOrder          Variable


Try this once.

former_member186851
Active Contributor
0 Kudos

Hello Diwakar,

Quote should be not a problem.

"Header","1","2","3"

"Text","1","2","3"

"TextData","1","2","3"

"TextData","1","2","3"

"Text","1",3","5"


It is because of the order of the fields.


In your case if you configure Header,1,Text,*,TextData,* .It's logically wrong because Text records are coming again after TextData records


Try this.


Header,1,Text,1,TextData,*,Text,1.It will work.


To use this FCC-Header,1,Text,*,TextData,* .File data should be like


"Header","1","2","3"

"Text","1","2","3"

"Text","1",3","5"

"TextData","1","2","3"

"TextData","1","2","3"


diwakar_chintha
Explorer
0 Kudos

Hello Raghuraman,

I have already tried that and it is not working.

The sample data i mentioned in the post is in one condition.

My Actual input Data is as follows

"Header",.....

"Text",.......

"TextData",......

"TextData".......

'Text",......

"Text",.........

"Textdata",........

"Text",.......

Data consists of One header ,Followed by a text field and multiple textdata fields followed by text field  and soon.

Thanks,

Diwakar Sharma.

former_member186851
Active Contributor
0 Kudos

Hello Diwakar,

Try changing the record sequence to Variable instead of ascending.

diwakar_chintha
Explorer
0 Kudos

Hello Raghuraman,

I have already tried that but same Error .

former_member186851
Active Contributor
0 Kudos

Hello Diwakar,

Then try this.

Give sequence as variable.

Try configuring keyFieldvalue and keyFieldName

Header.keyFieldValue  Header

Text.keyFieldValue        Text

TextData.keyFieldValue  TextData

http://help.sap.com/saphelp_nwpi711/helpdata/en/44/6713ec3f914ddee10000000a1553f7/content.htm

diwakar_chintha
Explorer
0 Kudos

Hello Rashmi,

thanks for your reply.

I am using Content conversion in sender file channel and csv is not getting converted to xml if i use * in record setStructure as mentioned in the earlier post.

Thanks,

Diwakar Sharma.

rasjoshi
Active Contributor
0 Kudos

HI Diwakar,

please remove the "" using replace string in graphical mapping and try.

br,

rashmi