cancel
Showing results for 
Search instead for 
Did you mean: 

using SHeaderFROM in mailsender CC and in receiver determination

Former Member
0 Kudos

Hi

I am using a mailsender adapter where I need to send messages from one particular sender adress to one folder and messages from other senders to an other folder.

In my mailsender communication channel I am using the AF_Modules/PayloadSwapBean module as the message comes as an attachment. In my receiver determination I am using the SHeaderFROM in this fashion:

SHeaderFROM u2260 8716867999 xxxorg

SHeaderFROM = 8716867999 xxxorg

However, that is not working and even though I select the "Set Adapter Specific Message Attributes" in the mailsender communication channel I cannot see the SHeaderFROM value in the ABAP monitor under "DynamicConfiguration".

What can I do?

BR Mikael

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

go through this blog

/people/mohammed.zabiulla/blog/2008/03/26/have-you-ever-tried-to-determine-mail-cc-dynamically

Former Member
0 Kudos

Hi Fabio

Thanks for the answer. Is there a way of avoiding using the MailPackage?

I get this error:

An error occurred when deserializing in the simple transformation program ST_XMS_MSGHDR30_DYNAMIC; ApplicationFaultMessage: null; ErrorStack: XML tag SOAP:Envelope(1)SOAP:Header(1)sap:DynamicConfiguration(3)sap:Record(17) (or one of the attributes) has incorrect value from pv-app03.prod.local (10.2.1.100)by pv-cps.prod.local (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec16 2008; 64bit)) with SMTP id <0L7G004QE2OZURF0pv-cps.prod.local> for5790001406xxx.org; Fri, 20 Aug 2010 11:36:35 +0200 (CEST) An error occurred when deserializing in the simple transformation program ST_XMS_MSGHDR30_DYNAMIC Data loss occurred when converting from pv-app03.prod.local (10.2.1.100)by pv-cps.prod.local (Sun Java(tm)

I have deselected "Use MailPackage" and selected both "Set Adapter Spacific Message Attributes" and "Variable Transport Binding" in the mailsender communication channel.

I use AF_Modules/PayloadSwapBean on the Module tab.

In the Adapter error log under Message Content tab the SHeaderFROM is present:

<sap:Record namespace="http://sap.com/xi/XI/System/Mail" name="SHeaderFROM">"8716867999xxx.org" <8716867999xxx.org></sap:Record>

Former Member
0 Kudos

Hi,

you can use UDF in mapping, like this

//write your code here

//Fabio Boni:- UDF for generating the mail parameters from & to

String valueFrom = "XXXXXX.com";

String Mail_address_to = "XXXXXX.com";

DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key1 = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/Mail", "THeaderFROM");

DynamicConfigurationKey key2 = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/Mail", "THeaderTO");

DynamicConfigurationKey key3 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");

conf.put(key1, valueFrom);

conf.put(key2, Mail_address_to);

conf.put(key3,Attachment_name);

return "";

and then in CC put "XHeaderName1" in MailAttributeFrom and "XHeaderName2" in MailAttribute2.

Flag ASMA e Variable Transport Binding in tab Advanced.

go through this:

Edited by: Fabio Boni on Apr 5, 2011 2:23 PM

Former Member
0 Kudos

Hi Fabio

I would like to avoid UDF, as I do not have a mapping; I only pass the message thru.

Besides, I found out, that in order to get access to SHeaderFROM I have to select Variable Transport Binding, but unfortunately this populates a number of records containing various variables among these "SHeaderRECEIVED". However, the value of the SHeaderRECEIVED is invalid, so it errors. I think the string might be too long:

<sap:Record namespace="http://sap.com/xi/XI/System/Mail" name="SHeaderRECEIVED">from pv-app03.prod.local ([10.2.1.100])by pv-cps.prod.local (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec16 2008; 64bit)) with SMTP id <0L7G004QE2OZURF0pv-cps.prod.local> for5790001406xxx.org; Fri, 20 Aug 2010 11:36:35 +0200 (CEST)</sap:Record>

So maybe the solution is to write a module which deletes tha value of that record, or can you think of an other way?

Thanks for your replys

Former Member
0 Kudos

To conclude this then I worked around the problem with the invalid content of the SHeaderRECEIVED record by using Advanced Adapter Engine (Integrated Configuration) in stead as in this case the java stack will not have to transfer the ("illigal")content of the record to the Integration Engine as only java is used and java had no problem handling the content of that record.

Thanks for your contributions.

MIkael