cancel
Showing results for 
Search instead for 
Did you mean: 

Flat File to XML :: Multiple sub-structure issue

Former Member
0 Kudos

Hi

My scenario is to convert the Flat file into XML file. Flat file is having variable number of substructures for Recordset Structure.

Now when I am giving <i>Recordset Structure as Student,1,Sub1,3</i>. I am getting the XML payload.

But when I am using <i>Recordset Structure as Student,1,Sub1,*</i>. File is picked up by the adapter but nothing in RWB & MONI, which suggest that file is not even coming to XI.

The other parameters I am using are :

<i>Sub1.keyFieldValue "subject"

Student.keyFieldValue "stud"</i>

In short when I am giving an exact number of sub-structures the XML file is coming but not in case when I am using <b>*</b>. Pls. suggest what can be the issue.

I already checked the following weblog /people/venkat.donela/blog/2005/06/08/how-to-send-a-flat-file-with-various-field-lengths-and-variable-substructures-to-xi-30 . All the settings are same.

Best Regards

- lalit chaudhary -

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Lalit,

Have a look at this weblog also..

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

cheers,

Prashanth

Former Member
0 Kudos

<u>Jitesh</u>

My Sender File adapter is working that's why file is getting polled.

My flat file structure is

<b>stud:Lalit:Noida:24

subject:Maths12:100:12

subject:Comp:90:67</b>

<u>Prashanth</u>

Most of the things in this weblog is same as mine. I even add recordsets per message as * but still the same thing, nothing on the XI side.

Also the occurance of element Student is 1 & Sub1 is 1...unbounded in Data Type.

I even tried different combinations in parameter Recordset Structure like ::

<i>Student,,Sub1,

Student,1,Sub1,*</i>

But still it is not working. It works when i give something like this

<i>Student,1,Sub1,3</i>

Pls. Suggest.

- Lalit -

Former Member
0 Kudos

Hi,

<i>Sub1.keyFieldValue "subject"

Student.keyFieldValue "stud"</i>

Try giving Student.keyFieldValue "stud" before Sub1.keyFieldValue.

Not sure, if this will work, but it is surely worth a try.

Regards,

Smitha.

prasad_ulagappan2
Contributor
0 Kudos

Hi Lalit,

Yup. If you are using, "*" then it is a must to give the key field value.

While looking at the help in the following URL,

http://help.sap.com/saphelp_nw2004s/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/frameset.htm

Follow the order of parameters in the link in your Content conversion too.

Also, if nothing shows in the SXMB_MONI, then go to RWB and check the adapter too. It will throw the exact error, so that we can easily trace it out.

Regards,

Prasad U

Message was edited by: Prasad Ulagappan

Former Member
0 Kudos

Prasad

I am using the Key Field Value, but still getting this issue & no exception in Adapter monitoring also.

I am getting an error if I use the flat file like this :

"stud":Nishu:Noida:24

"subject":English:100:12

"subject":Comp:90:67

What am I not getting is that in case of giving exact numbers in Recordset Structure I am getting the XML file which suggest all of my design & configuration is correct. But when I use "*" ( multiple option ) with Key Field Value, file is getting picked up but nothing on XI side even not able to trace it on RWB, Adapter & MONI.

Anything else I can try.

- Lalit -

Former Member
0 Kudos

Hi,

i tried ur scenario,initially i had the same experience as u had.when i made these specific changes it worked.

try giving the stud.keyFieldvalue and subjetc.keyFieldValue without quotes

ie.,

stud.keyFieldValue stud(instead of "stud")

subject.keyFieldValue subject(instead of "subject")

this is how i defined the parametrs

student.fieldNames give ur field names

student.fieldSeparator :

student.keyFieldValue stud

subject.fieldNames specify ur field names

subject.fieldSeparator :

subject.keyFieldValue subject

try giving the keyfieldvalues without quotes("").

regards

jithesh

Former Member
0 Kudos

Jithesh

I am using following parameters ( same sequence ) now in Sender File Adpater -->

<i>Student.fieldNames Name,Address,RollNo

Student.fieldSeparator :

Student.endSeparator 'nl'

Student.processFieldNames fromConfiguration

Sub1.fieldNames SubName,SubMarks,SubNo

Sub1.fieldSeparator :

Sub1.endSeparator 'nl'

Sub1.processFieldNames fromConfiguration

Student.keyFieldInStructure ignore

Sub1.keyFieldInStructure ignore

ignoreRecordsetName true

Student.keyFieldValue stud

Sub1.keyFieldValue subject</i>

Using Key values without quotes is giving following error in Adapter monitoring -->

<i>Error: Conversion of complete file content to XML format failed around position 0 with java.lang.Exception: ERROR converting document line no. 1 according to structure 'Student':java.lang.Exception: ERROR in configuration: more elements in file csv structure than field names specified!</i>

My Flat file is this -->

<i>stud:Nishu12:Noida:24

subject:English:100:12

subject:Comp:90:67</i>

If I use the quotes in Key Fileds file is getting polled without exception but nothing happens.

- Lalit -

Former Member
0 Kudos

Hi lalit,

U have four fields in ur flat file and u have mentioned only 3 field names in ur content conversion tats y its throwing an error "more elements in file csv structure than field names specified!".

U need to specify the field which is gonno be ur keyfield.how will it identify ur keyfield when u dont have a field in ur XML structure to identify it.

In ur XML structure u need a node to hold the value of ur KeyField.then only it can identify ur key field and form the multiple subject's structure.

create a XML structure with four fields where u have a field to hold ur keyfieldvalue.

for eg

<student>

<keyfield>

<name>

<address>

<rollno>

</student>

<sub1>

<keyfield>

<subname>

<submarks>

<subno>

</sub1>

then in ur communication channel specify ur

keyField Type keyfield

and

subject.fieldNames keyfield,name,address,rollno

sub1.filedNames keyfield,subname,submarks,subno

regards

jithesh

former_member206604
Active Contributor
0 Kudos

Hi Lalit,

What you have done is right but do this simple addition to the content conversion parameter

Change the collowing alone


Student.fieldNames stud,Name,Address,RollNo
Sub1.fieldNames subject,SubName,SubMarks,SubNo

I have added <b>stud</b> and <b>subject</b> in the fieldNames. Check this and let me know.. this should work.

Thanks,

Prakash

Former Member
0 Kudos

Hi

I tried following options but still no success ::

*) Jithesh, as suggested by you, I added the <b>KF</b> ( My Key Field Name ) in my XML structure & add that in <i>FieldNames</i> parameter too. But still file polled by adapter but nothing happens.

*) Also as I was using <i>Student.keyFieldInStructure ignore</i> & <i>Sub1.keyFieldInStructure ignore </i> , I put the value as add for them but nothing happens.

*) Than I added the values of KeyField in FieldNames as suggested by Prakash but nothing happens this time too.

After this I if I am giving <i>Recordset Structure</i> as <b>Student,1,Sub1,3</b>. It is working.

I can send you the snapshot of my Adapter configuration & XML design, if you can give me your mail ID.

Regards

- Lalit -

Former Member
0 Kudos

Hi

Pls mail ur snap shots to jithesh.balakrishnan@wipro.com

regards

jithesh

Former Member
0 Kudos

Thanks to Jithesh.

Problem is resolved, after adding the Key Field name <b>KF</b> in XML structure, I forgot to remove the double quotes from Key Field Values.

Updated Parameters ::

<i>Student.fieldNames KF,Name,Address,RollNo

Sub1.fieldNames SubName,SubMarks,SubNo

Student.keyFieldValue stud

Sub1.keyFieldValue subject</i>

- Lalit Chaudhary -

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

If there is any error in ur content conversion parameters then it will be reflected in RWB.But the issue is its not reaching XI so just check whether ur <b>adapter channel status is active</b>.if it is kept inactive u cant find messages in SXMB_MONI.

can u please post ur flat file structure.

regards

jithesh

Message was edited by: jithesh balakrishnan