cancel
Showing results for 
Search instead for 
Did you mean: 

MessageTransformBean StructPlain2XML without key fields

javier_alcubilla
Contributor
0 Kudos

Hi gurus

I have a problem trying to convert a text file to XML.

The structure is like this:

<Recordset>

     <Record>

          <Field1>

          <Field2>

          <Field3>

          ...

     </Record>

     <Record>

          <Field1>

          <Field2>

          <Field3>

          ...

     </Record>

     ...

</Recordset>

When i use SimplePlain2XML the record tag is missing, when i use StructPlain2XML, PI ask for key values

What could be my problem?

Kind regards

Accepted Solutions (1)

Accepted Solutions (1)

santosh_k3
Active Participant
0 Kudos

Hi Javier,

As mentioned by Satish please look into the above thread.

For the given XML structure by you, include the parameters mentioned in the SimpleConversion in the above document in the CC along with the modified parameter value that i have mentioned below

provide the xml.documentName : Recordset ,

                xml.structureTitle : Record ,

                xml.fieldNames : Field1,Field2,Filed3..

                xml.fieldFixedLengths if it is a fixed lenght fields else go for the xml.fieldSeparator

Thanks

Sai

javier_alcubilla
Contributor
0 Kudos

Hi Sai

Sorry I missed the document in my first post.My xml needs to be like this

<INT00_Interface_MT xmlns:ns="urn:xxxx.com:xxx:xxxx">

<Calendars>

     <Calendar>

          <Field1>

          <Field2>

          <Field3>

          ...

     </Calendar>

     <Calendar>

          <Field1>

          <Field2>

          <Field3>

          ...

     </Calendar>

     ...

</Calendars>

</INT00_Interface_MT>

So, the content conversion will be like this using content conversion parameters in adapter(already running):

Now, I need to reproduce this behaviour with MessageTransformBean module

Thanks for your help

ambrish_mishra
Active Contributor
0 Kudos

Hi Javier,

Should be something like below

Specifications in the Module Configuration of Module Pocessor

Module Key

Parameter Name

Parameter Value


Plain2XMLTransform.Classcom.sap.aii.messaging.adapter.Conversion

Plain2XML

Transform.ContentType

text/xml;charset=utf-8


Plain2XML

xml.conversionType

SimplePlain2XML


Plain2XML

xml.processFieldNames

fromConfiguration


Plain2XML

xml.documentName

INT00_Interface_MT

Plain2XML

xml.documentNamespace

urn:xxxx.com:xxx:xxxx


Plain2XML

xml.structureTitle

Calendar


Plain2XML

xml.fieldNames

field-name1,field-name2,field-name3


Plain2XML

xml.fieldSeparator

|






I am not sure why you have nested Calendar under Calendars. You can simply have a data type without node Calendars. Calendar should be 1...unbounded.

Ambrish

javier_alcubilla
Contributor
0 Kudos

Hi Ambrish and Bhavani

I have tested this solution already, as you said, the xml generated miss the <calendars> tag.

My requirement needs the given structure and i wanted to maintain that structure. With this solution I have to change the structure and change the mapping or create a new mapping that match the new structure to the existing one.

I can't believe that MessageTransformBean can't reproduce the same configuration that i used in a file adapter.

Thanks for your responses

Javier

ambrish_mishra
Active Contributor
0 Kudos

Hi Javier,

You can do some hit and trial:

  • try giving

Plain2XML

xml.structureTitle

Calendars

  • If the above does not work, don't provide structureTitle.
  • If that does not work, try xml.ignoreRecordsetName or xml.ignorestructureTitle. Set it to true.

Last option would be to change the data type, see if you can read the file and then the mapping...

Ambrish


anandvithal
Active Participant
0 Kudos

Hi Javier,

I have faced the same issue.The trick to resolve the issue is simple . Give recordset structure as below

Recordset Strcuture: Calendar,99999

then it will not ask for a key field name or value.

hope it helps,

Thanks,

Anand

Answers (2)

Answers (2)

Former Member
0 Kudos

once you have to try below parameters :

Thanks,

former_member194612
Active Participant
0 Kudos
javier_alcubilla
Contributor
0 Kudos

Hi Satish

I've seen that help, but i don't have any key value...

Thanks for your quick response