cancel
Showing results for 
Search instead for 
Did you mean: 

File content conversion using SOAP adapter

Former Member
0 Kudos

Hi,

I'm using a receiver SOAP adapter in my IDOC to file scenario and need to do file content conversion in the receiver side.

Are any standard modules available for file content conversion in the SOAP adapter or do I need to write custom EJB modules for this.

Please note that I have to use a SOAP adapter, can't use any other adapter.

Thanks in advance

Shiladitya

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

XML Document Conversion Type

● Enter recordTypes as the parameter name.

Under Parameter Value, enter the complete, comma-separated list of all names of recordset types that occur in the document to be converted.

If you decide to use this method, you can define a different conversion type for each recordset type that occurs in the XML document.

For example, you could name the recordset types as follows: RecordType1,RecordType2,RecordType3.

● Enter singleRecordType as the parameter name.

Under Parameter Value, enter the name of a recordset type that is to be used to convert all elements that occur in the XML document.

If you decide to use this method, define the same conversion type for each recordset type that occurs in the XML document.

You must enter exactly one parameter only. Whichever parameter you choose, you automatically exclude the second parameter.

You define further parameters for each recordset type.

In the remainder of this documentation the parameters are specified by the prefix <RecordType>. In your configuration, replace this name with the name of the recordset type.

Conversion Type List with Separators

&#9679; <RecordType>.fieldSeparator

Enter the field separator that is written between the individual fields of a record.

This specification is mandatory.

Conversion Type List with Fixed Field Length

&#9679; <RecordType>.fieldLengths

Specify a character string that contains a list of fixed field lengths that are separated by commas and which determines the number and the length of fields generated in the text file.

For example, you want to write a recordset with three elements that have field widths of five, ten, and fifteen characters. Enter:

<RecordType>.fieldLengths = 5,10,15

This specification is mandatory.

&#9679; <RecordType>.fieldLengthExceeded

Specify how you want to handle fields that exceed the configured field length. Permitted values for the parameter value are:

&#9675; error (default)

Interrupts processing of message with error

&#9675; cut

Cuts off superfluous characters

&#9675; ignore

Ignores the field length restriction

Further Entries

&#9679; <RecordType>.beginSeparator

Enter a string. The string is placed in front of the first field of a recordset.

&#9679; <RecordType>.endSeparator

Enter a string. The string is appended to the last field of a recordset as a concluding character. The default is \r\n.

&#9679; contentType

Enter the MIME type of the converted payload. The default value is text/plain.

&#9679; addHeaderLine

Only define this parameter if you have already defined singleRecordType.

Define whether a header line is to be added to the result of the conversion.

&#9675; none (default)

Does not insert a header line

&#9675; fromXML

The header line is generated from the element name of the first recordset of the XML document

&#9675; fromConfiguration

The header line is determined by the configuration parameter headerLine.

&#9679; headerLine

Only define this parameter if you have already set addHeaderLine=fromConfiguration.

The value that you define is placed in front of the result of the conversion as a header line.

&#9679; fixedLineWidth

Enter the maximum line length n (in characters) that can be written to the resulting document. The separator specified by lineSeparator is inserted in the resulting document every n characters.

&#9679; lineSeparator

Only define this parameter if you have already defined fixedLineWidth.

Specify the string that is written to the resulting document at the end of each line that is written with fixedLineWidth. The default is \r\n.

Use of Special Characters

You can use special characters in the following parameters: <RecordType>.fieldSeparator, <RecordType>.beginSeparator, <RecordType>.endSeparator, headerLine, and lineSeparator.

&#9679; Tabulator: \t

&#9679; Carriage Return (CR): \r

&#9679; Line Feed (LF): \n

&#9679; Arbitrary character: \x<code>

<code>indicates the hexadecimal character code of the character to be displayed.

Regards,

Phani

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

yes there is an adapter module available to do this with SOAP adapter

localejbs/AF_Modules/MessageTransformBean>Local Enterprise Bean-

-


>XML2Plain

Here you have to use below parameters for Module configuration

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

Transform.ContentType = Application/x-www-form-urlencoded

xml.<StructureName>.fieldSeparator

xml.<StructureName>.endSeparator

xml.addHeaderLine = 0(No) or 1(yes)

xml.conversionType = StructXML2Plain

xml.recordsetStructure = <Structure Name1,name2,..>

let me know if you need anymore help on this.

I have successfully implied it in one of the scenario.

Thanks

Swarup

stefan_grube
Active Contributor
0 Kudos

You can use the MessageTransformBean or the StrictXml2PlainBean

http://help.sap.com/saphelp_nw2004s/helpdata/en/44/748d595dab6fb5e10000000a155369/frameset.htm

Regards

Stefan

Former Member
0 Kudos

Hi,

You can use standard Message Transfrom Bean of Adapter FrameWork to perform Content Conversion on the fly in any J2EE based Adapter (Communication Channel)

Regards,

Sudharshan N A.