cancel
Showing results for 
Search instead for 
Did you mean: 

File adapter sender content Convertion

Naama
Participant
0 Kudos

Hi all,

I need to read a flat file and convert it,

The file structure is a long row with different types of segments:

For example:

AA111222333BB4455

where AA - the first segment and BB the second segemnt,

I want to convert this string to -

<AA>

<first>111<first/>

<second>222<second/>

<third>333<third/>

<AA/>

<BB>

<first>44<first/>

<second>55<second/>

<BB/>

I tried impliment this by using endSeparator and beginSeparator as AA,BB, but I get an error -

Conversion of file content to XML failed at position 0: java.lang.Exception: ERROR consistency check in recordset structure validation (line no. 1: missing structure(s) in last recordse

anyone????????

Thanks,

Naama

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Naama,

Try this ,

Document name = message type

Document Name space = name space

Recordset structure = Data,1000(depends on the length of data)

Data.fieldNames = ROW ( this is the name of the structure created in IR)

Data.fieldSeparator = 'nl'

ignoreRecordsetName = true.

This configuration will fetch the whole data in the ROW part then u can split the data.

Regards

Archanaa

Naama
Participant
0 Kudos

where can I split the data? in the message mapping?

I am trying to avoid this, because the real structure of the row is much more complicated,

I just wanted to simplify the problem

Former Member
0 Kudos

Hi Naama,

Its not possible to split with Message mapping ..with ABAP mapping its possible provided if your receiver is ECC.

Regards

Archanaa

Naama
Participant
0 Kudos

I wanted to avoid this doing it in ABAP,

Probebly it is to complipcated doing it in Content Convertion.

Former Member
0 Kudos

hi,

Declare the message type as:

mt

*record

**AA 1

***key 0..1

***first

***second

***third

**BB 1

***key 0..1

***first

***second

content conversion parameters:

Document Name: mt

Document Namespace:http://xxxxx

Document Offset:

Recordset Name: record

Recordset Namespace:

Recordset Structure:AA,1,BB,1

Recordset Sequence:Ascending

Recordsets per Message:1

KeyField Name:key

KeyField Type:String(Case-Sensitive)

Additional Parameters:

AA.fieldFixedLengths 1,3,3,3

AA.fieldnames key,first,second,third

AA.keyFieldValue 1

AA.keyFieldinStructure ignore

ignorerecordsetname true

BB.fieldFixedLengths 1,2,2

BB.fieldnames key,first,second

BB.keyFieldValue 2

BB.keyFieldinStructure ignore

Thanks,

Durga

Edited by: NagaDurga Nannapaneni on Sep 8, 2008 1:11 PM

Edited by: NagaDurga Nannapaneni on Sep 8, 2008 1:15 PM

Naama
Participant
0 Kudos

Did you tested it?

because its not working i am getting an error

Conversion of file content to XML failed at position 0: java.lang.Exception: ERROR consistency check in recordset structure validation (line no. 1: missing structure(s) in last recordset

Former Member
0 Kudos

Hi,

I think you have several lines( i mean recordsets) as

AA111222333BB4455 one below the other in the input file.

And we are specifying

Recordsets per Message:1

Change the 1 to * and also include the parameter:

BB.endSeparator 'nl'

Thanks,

Durga

Edited by: NagaDurga Nannapaneni on Sep 8, 2008 2:24 PM

Naama
Participant
0 Kudos

I have only one row in the file,

I tried BB.endSeparator 'nl'

and still I have the same error

Former Member
0 Kudos

Hello Naama,

Try using AA.keyFieldValue and BB.keyFieldValue. Also you may also want to add

AA.fieldFixedLengths and BB.fieldFixedLengths as well. You can check SAP documentation for further info on how to use these properties.

Warm regards,

Glenn

Naama
Participant
0 Kudos

I used it,

but still the same error.

Former Member
0 Kudos

Hi,

Please check this scenario in saptechnical.com you have detailed step by step file content conversion scenario.

Regards ,

Sharath

Naama
Participant
0 Kudos

Hi,

Do you have a link to this scenario?

former_member192295
Active Contributor
0 Kudos

HI,

Try this it will work

AA111222333BB4455

row.keyFieldvalue AA

row.fieldFixedLengths 3,3,3

row.fieldNames A,B,C

row.keyFieldvalue BB

row.fieldFixedLengths 2,2

row.fieldNames D,E

ignoreRecordsetName true

Naama
Participant
0 Kudos

Hi,

what is the structure of row?

how can it have 2 different key values?

former_member192295
Active Contributor
0 Kudos

HI,

I forget to change.

row.keyFieldvalue AA

row.fieldFixedLengths 3,3,3

row.fieldNames A,B,C

row1.keyFieldvalue BB

row1.fieldFixedLengths 2,2

row1.fieldNames D,E

ignoreRecordsetName true

here row & row1 is recordset

Former Member
0 Kudos

Hi Naama,

In the "Recordset Structure" parameter, write:

AA,1,BB,1

Regards,

Glenn

Naama
Participant
0 Kudos

what should be the key Field Name? -

if I understand right it is not in the structure of row1 and row2.

Former Member
0 Kudos

Your message type structure fields are "AA" and "BB" so these are what you put in the Recordset Structure parameter: AA,1,BB,1

AA.keyFieldName = AA

BB.keyFieldName = BB

(since "AA" and "BB" also happens to be the key entries in your text file.)

Hope you figure it out!

Glenn

Naama
Participant
0 Kudos

Key Field Name can only be one,

You are talking about key Field Value.

can you explain to me from scratch (including the design objects) how to do this?

Thanks,

naama

former_member192295
Active Contributor
0 Kudos

HI,

find the below configuration, i hope now clear

Document name = message type

Document Name space = name space

Recordset name = data

recordset structure = row,,row1,**

keyfield name = key

row.keyFieldvalue AA

row.fieldFixedLengths 3,3,3

row.fieldNames A,B,C

row1.keyFieldvalue BB

row1.fieldFixedLengths 2,2

row1.fieldNames D,E

ignoreRecordsetName true