cancel
Showing results for 
Search instead for 
Did you mean: 

Fixed Length File attachment to Mail Receiver

Former Member
0 Kudos

Hi,

I have an interface requirement IDOC - PI - Fixed Length File attached to email.

Is it possible to do this? I need to pass the IDOC through a mapping and content conversion to build the fixed length file, I then need to attach this file to an email and send it to a user.

Any help would be greatly appreciated.

Thanks

Gareth

Accepted Solutions (0)

Answers (2)

Answers (2)

RaghuVamseedhar
Active Contributor
0 Kudos

Hi Gareth O´Brien,

If you need to convert XML (IDOC XML) to Flat file, you can use this module StrictXml2PlainBean Link2 . Please do not consider using File Content Convertion option in File channel, according to your requirements, you have to use receiver Mail channel.

Regards,

Raghu_Vamsee

RaghuVamseedhar
Active Contributor
0 Kudos

Hi Gareth O´Brien,

I understand your scenario as, PI has to convert IDOC to a flat file and send that one as attachment in a mail.

It is possible. From PI7.11 there is module IDOCXmlToFlatConvertor Link1 . You can use this module in receiver mail adapter.

If you are using <PI7.11, this module is not available. Then, you need to develop Java Mapping (Graphical and XSLT will not generate flat file) to convert IDOC XML to Flat file.

Regards,

Raghu_Vamsee

Former Member
0 Kudos

Hi,

I actually need to convert the IDOC to a different file format before sending it on. Eg.

<IDOC>

<Segment 1...n>

<username>User</username>

<address>Address 1</Address>

</Segment>

<Segment>

<username>User2</username>

<address>Address 2</Address>

</Segment>

<IDOC>

Converted to flat file with structure:

User......Address 1.....

User2....Address 2.....

The file needs to have fields of Fixed Length (thats what the .... after each field is to represent)

So I think the Data Type I am using for the file needs to go through Content Conversion to do this change, and then the file attached to an email.

I hope this makes sense.

Former Member
0 Kudos

Hi,

This can be acheived using the Modules of the PI ..Message transform Beans StrictXMLtoPlain can be used for the same..

After doing the mapping using your idoc and target structure ...use the mail as receiver adapter and at the mail adapter module tab configure the same..

for more details search sap help for the same...

We had a similar requirement and achieved using the same..

HTH

Rajesh

Former Member
0 Kudos

Thanks Guys I will check out the StrictXml2PlainBean.

Gareth

Former Member
0 Kudos

HI,

I used the StrictXml2PlainBean and I now have fixed length file attached to an email.

Is it possible for me to change the filename of the attachment? The files are being attached as: "MainAttachment.txt" I would like to change the filename dynamically, need to add a timestamp to the filename.

Also, there is a second file attached to each email, ATT563873.xml. Is there anyway to stop this?

Thanks.