cancel
Showing results for 
Search instead for 
Did you mean: 

Sender Mail Adapter - Module conversion issue.

Former Member
0 Kudos

Hello all,

We had a issue in reading the details in Email body ( PS - Reading details from Email body. Not from Attachment )

Email from one of our customer looks like below . We use IMAP as Transport protocol

From: XXX XXXX XXXX [mailto:XXX_XXXX@XXXXX.com]
Sent: 21 October 2015 11:30
To: Rama
Subject: RE: ASN - 9999

Automated Email response:

Please find below the document number created in our system with reference to your ASN.

ASN: 9999

Customer Ref: 0009990011

Please quote the Customer Reference number in all correspondence.

***************************************************************
The contents of this Email and any files transmitted with it
are confidential and intended solely for the use of the
individual or entity to whom it is addressed. The views stated
herein do not necessarily represent the view of the company.
If you are not the intended recipient of this Email you may not
copy, forward, disclose or otherwise use it or any part of it
in any form whatsoever. If you have received this mail in
error please Email the sender.
***************************************************************

XYZ PLC.

______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________

EXPECTED Output XML message ( Data types

<?xml version="1.0" encoding="UTF-8"?>

<ns0:MT_TEST_ASNNO xmlns:ns0="http://abc/pi/test">

  <Recordset>

        <Vendor_ASN_NO>

           <Key>ASN: </Key>

            <VND_ASN_NO>9999</VND_ASN_NO>

       </Vendor_ASN_NO>

       <Cust_ASN_NO>

            <Key>Customer Ref: </Key>

            <Cust_ASN_NO>0009990011</Cust_ASN_NO>

       </Cust_ASN_NO>

  </Recordset>

</ns0:MT_TEST_ASNNO>

Please suggest the module configuration settings that we can use to achieve this scenario.

I have used below module configuration to read data from an csv attachment. But scenario I want to achieve is completely different now. 

Processing Sequence.

Number

Module Name

Type

Module Key

1

localejbs/AF_Modules/PayloadSwapBean

Local Enterprise Bean

TRANSFORM

2

localejbs/AF_Modules/MessageTransformBean

Local Enterprise Bean

set

3

localejbs/AF_Modules/MessageTransformBean

Local Enterprise Bean

txtxml

4

localejbs/sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean

Local Enterprise Bean

mail

Module config

Module Key

Parameter Name

Parameter Value

TRANSFORM

  1. swap.keyName

payload-name

TRANSFORM

  1. swap.keyValue

MailAttachment-1

set

  1. Transform.ContentDescription

MailAttachment-1

set

  1. Transform.ContentDisposition

attachment;filename="MailAttachment-1.bin"

set

  1. Transform.ContentType

application/octet-stream;charset="ISO-8859-1"

txtxml

  1. Transform.Class
  2. com.sap.aii.messaging.adapter.Conversion

txtxml

  1. xml.conversionType

SimplePlain2XML

txtxml

  1. xml.documentName

MT_TEST2_ZVIP

txtxml

  1. xml.documentNamespace

urn://XYZ.com/PI/TEST_2/00

txtxml

  1. xml.fieldFixedLengths

3,1,5

txtxml

  1. xml.fieldNames

Data_1,Data_2,Data_3

txtxml

  1. xml.lastFieldsOptional

YES

txtxml

  1. xml.processFieldNames

fromConfiguration


Accepted Solutions (1)

Accepted Solutions (1)

radek_rucinski
Explorer
0 Kudos

Hi,

Instead of trying to convert the message using adapter module I would read the message using standard configuration and then extract required values in the message mapping (for example with UDF) or XSLT from the Content field.

You will need XSD for the mail message: https://websmp205.sap-ag.de/~sapidb/012006153200000361852004E/ximail30_xsd.txt

Communication Channel settings:

Message payload:

Regards,

Radek

Former Member
0 Kudos

Hi Radek,

Thanks your Idea helps me to achieve my results.

Answers (0)