cancel
Showing results for 
Search instead for 
Did you mean: 

filling Mail subject , to en from using a user defined function

Former Member
0 Kudos

Hello people,

Im trying to use dynamic configuration in message mapping ( as described in the blog by William Li) to fill mail subject, to and from mail adress fields.

The coding I use is the following:

   //write your code here
 String valueFrom = "jasper.brugman@uphantis.com";
 String valueSubject = "AutoMail gegenereerde factuurinformatie";
 DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/Mail",  "XHeaderName1");
DynamicConfigurationKey key2 = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/Mail",  "XHeaderName2");
DynamicConfigurationKey key3 = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/Mail",  "XHeaderName3");

conf.put(key, MailAdres);
conf.put(key2, valueFrom);
conf.put(key3, valueSubject);

  return  "";

In the message monitoring I see that the values are filled.

Next step is that I want the mail to , from and subject field get filled in the communication channel. Somehow I can't figure out how to do this.

I this possible and yes how , if not is there a way to solve this (maybe by splitting up de the incomming IDoc in two messages ?)

Is there some one who could help me with this ?

Regards,

Jasper

Accepted Solutions (1)

Accepted Solutions (1)

stefan_grube
Active Contributor
0 Kudos

Check this page for the technical names:

http://help.sap.com/saphelp_nw04/helpdata/en/6b/4493404f673028e10000000a1550b0/frameset.htm

from = THeaderFROM

to = THeaderTO

subject = THeaderSUBJECT

Regards

Stefan

Former Member
0 Kudos

Hello Stefan,

when I use these fields in the coding do I leave the fields blank in the communication channel ?

thnx,

Jasper

stefan_grube
Active Contributor
0 Kudos

As the header field overwrite the entries in the channel, you may enter a default adress or subject for the case that the mapping cannot determine the header fields.

But you can leave the fields empty as well.

Regards

Stefan

Former Member
0 Kudos

Hello Stefan,

Thanx for the solution..of course I rewarded you.

Regards,

Jasper

Answers (0)