Receiver Mail Adapter message with PDF attachment
Hi.
We are trying to generate emails from the mail adapter that includes the plain text in the body of the resulting email and an attached PDF file. We receive the following structure:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:newMailRequest_MT xmlns:ns0="http:/pdk/sap/TorstenTest">
<Sender/>
<Receiver/>
<BodyContent/>
<Subject/>
<Attachment/>
</ns0:newMailRequest_MT>
I have set up an interface and mail adapter to be able to produce emails with plain text in the body. I used SAP note 748024 for this.
So right now I can make XI send emails with dynamic mail addresses. My problem lies in sending attached files with the mails as well.
I have read most of the threads in here, but none of them seem to answer just how to include the attachment. Which field in the 'Mail' message type is used for the attachment??
What needs to be added to the communication channel and adapter for it to include attachments, while the body of the mail still keeps the plain text message??
hi
I have used the following links to send the file as an attachement and as payload.
so it may help u.
links:
/people/prasad.ulagappan2/blog/2005/06/07/mail-adapter-scenarios-150-sap-exchange-infrastructure - Mail Adaptor options , mail attatchment
Sender mail adapter - PayloadSwapBean - Step by step - https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6d967fbc-0a01-0010-4fb4-91c6d38c5816
/people/prasad.ulagappan2/blog/2005/06/07/mail-adapter-scenarios-150-sap-exchange-infrastructure
https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1685 [original link is broken] [original link is broken] [original link is broken]
/people/michal.krawczyk2/blog/2005/11/23/xi-html-e-mails-from-the-receiver-mail-adapter
points if helpful.
regards
sreeni
Similar Messages
-
Is anyone else having a problem sending a mail message with PDF attached?
Is anyone else having a problem sending a mail message with PDF attached? I receive the following message:
Sending the message content to the server failed.
Select a different outgoing mail server from the list below or click Try Later to leave the message in your Outbox until it can be sent.
Is there a fix for this?Anyone? I was hoping my problem would just 'fix itself'... but I still have some clients telling me they're not receiving any email from me. I've since deleted that account on my computers and re-added it. But still having the same issue.
-
Receiver Mail adapter - Text as a attachment
HI folks,
These are my screen shot link of my receiver CC
http://farm4.static.flickr.com/3279/2946574549_aa08b8464c_o.jpg
http://farm4.static.flickr.com/3063/2946575933_e8689c240d_o.jpg
In my receiver Communication channel,
I mentioned these parameters also,
From : xxxxATxyz.com ( i could not at the rate symbol ..bec it considers as a email)
to : sapATmye.com
subject: test
Content encoding: none
I am mailing with in network only
I could get email in my receiver (sapATmye.com ) inbox but only i am getting message in text format only.
I could not get as a the attachment.
I want the output in text format as a attachment
My advanced thanks for the inputs.
Thanks
PrabaharanHI Gaurav,
I am getting the error ( i tried like as u said) . even i tried that way before also ( i got the same error)
I am getting the error RWB , CC monitoring,
Message processing failed. Cause: com.sap.aii.af.modules.conversion.xml2plain.ConversionException: Insufficient number of fields read for structure SalesEmployee. Expected 4, got 3 at XML element MT_Receiver,SalesEmployee
Even link for Receiver CC
http://farm4.static.flickr.com/3289/2947598091_6dc5423a82_o.jpg
I do not know why i am getting this kind of error even though,
i mentioned SalesEmployee.fieldLengthExceeded ; = ignore
in my receiver message type 2 attributes has occurence as 1 to unbounded, another 2 attributes occurence as 0 to unbounded
Thanks
Praba
Edited by: Prabaharan on Oct 17, 2008 3:04 AM -
Receiver Mail Adapter with external Email-Provider
Hi everyone,
I have implemendet an Scenario with a receiver Mail Adapter. With using the SAP-Mail-Server it works fine.
Now I want to use an external Email Provider like GMX or yahoo. But the Parameter e.g. smtp://mail.gmx.net does not work.
Is this generally with an external Email Provider possible?
Thanks in advice
ChristophHi,
of course it is, but:
your XI has to see the external provider = opened ports
Regards,
michal -
Receiver File Adapter fails saving an attachment
Dear XI/PI experts. I have a file to file scenario where I send a XML message with PDF attachment. I am using Additional Files configuration in the Sender adapter. I can monitor that the attachment goes succesfully through Xi runtime environment and to Adapter Engine. Even there I can monitor that the attachment is with the xml message when the saving is done but only main payload, xml message is saved to disk. No errors, pdf file just do not appear in the folder, Is there any extra configuration needed to be done e.g Module configurations in Receiver adapter?
well the reason i can think of is that the receiver system is not capable of handling XML message with attachments.
have a look at the help.sap document and see all the constraints and if all the conditions are met
http://help.sap.com/saphelp_nw04/helpdata/en/3c/b4a6490a08cd41a8c91759c3d2f401/frameset.htm
Thanx
Aamir -
Cc header in the triggered mail using receiver mail adapter
Hi,
How can we have cc option in the triggered mail using receiver mail adapter.
message protocol is XI payload with mail package.
thanks,
Ramya ShenoyHi !
Check this link:
http://help.sap.com/saphelp_nw04s/helpdata/en/6b/4493404f673028e10000000a1550b0/frameset.htm
under the title:
"Mail Attributes for Message Protocol XIPAYLOAD"
Regards,
Matias
ps:please award points if helpful. -
Dynamic attachment name with receiver mail adapter and use mail package
We need to send mapped XML payload as attachment (with dynamic name) to a recepient (recepient email id is part of input xml payload, but not part of the mapped XML payload).
I could probably do this using the adapter module (as per the following link),
http://wiki.sdn.sap.com/wiki/display/XI/Adapter%20Module%20PI%207.0%20Set%20Attachment%20Name?bc=true
I would like to explore if this would be feasible using Mail package and XI payload.I already have a Java mapping that is converting the input XML to required Output format. If I am using Mail package (XI Payload), how do I go about sending this Output XML from java mapping as attachment to email id available in the input payload?Hi,
1) XML payload as attachment (with dynamic name)
2) recipient (recipient email id is part of input xml payload, but not part of the mapped XML payload)
These two is possible by using Mail Package. You have a standard xsd for mail package which you can download from the SAP Note 748024.
The xml created in you java mapping which will be your attachment should be put into the <content> tag of the mail package xml structure. and the file name can be set in the <Content_Type> tag.
<?xml version="1.0"; encoding="UTF-8"?>
<p2:Mail xmlns:p2="http://sap.com/xi/XI/Mail/30">
<Subject>My Invoice</Subject>
<From>from email address<;/From>
<To>to email address</To>
<Content_Type>text/plain;name="MyFile.csv";</Content_Type> --> file name here
<Content>123;A49;aaa</Content> -> attachment xml here
</p2:Mail>
And you have to select MailPackage in the receiver mail adapter.
Regards,
Aravind -
Receiver Mail Adapter, Mail Package with Payload as Attachment
Hi Everyone,
I have spent the better part of the day today searching and testing all of the different combinations that I could think of to solve this problem, so please don't just do an SDN search for me and cut/paste in the links as there are too many contradictive answers piling up over the last year.
I am trying to use a Receiver mail adapter to send some data using the mail package, and I want to have the <content> tag be in an attachment. I am using mail package to dynamically set the mail address, but to also try and turn my data into a csv file that the recipient can open in Excel.
My mail package sets the following values:
<Content_Type>text/plain</Content_Type>
<Content_Disposition>attachment</Content_Disposition>
<Content>Sample Text</Content>
This blog is basically what I am trying to do:
<a href="/people/community.user/blog/2006/09/08/email-report-as-attachment-excelword:///people/community.user/blog/2006/09/08/email-report-as-attachment-excelword
But no where in here is he setting ContentDisposition, and he is (potentially) not using the MessageTransformBean module.
It is unclear if I need to use the MessageTransformBean to make this work?
Questions:
1) Do I need to use the MessageTransformBean?
2) Do I need to set the ContentDisposition in the mail package?
3) Does Service Pack matter with these settings? We are on SP15 upgrading to SP18 very soon.
Thanks
PeterHi Peter,
try:
<Content_Type>text/plain;name="file.csv"</Content_Type>
<Content_Disposition>attachment;filename="file.csv"</Content_Disposition>
<Content>Sample Text</Content>
Regards
Stefan -
Problem in sending mail with PDF attachment
Hi all,
Kindly check this code..
I neeed to send the smartform as a PDF attachment..
PDF generated form of smartform is generated successfully..
<b>but PDF going as attachment is showing errors in opening</b> .
Please help me to solve this issue as soon as possible
DESCRIBE TABLE objtxt LINES tab_lines.
READ TABLE objtxt INDEX tab_lines.
doc_chng-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
doc_chng-doc_size = tab_lines * 255.
Creation of the entry for the compressed document
CLEAR objpack-transf_bin.
objpack-head_start = 1.
objpack-head_num = 0.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = 'RAW'.
APPEND objpack.
Creation of the document attachment
DESCRIBE TABLE objbin LINES tab_lines.
Creation of the entry for the compressed document
CLEAR objpack-transf_bin.
objpack-transf_bin = 'X'.
objpack-head_start = 1.
objpack-head_num = 0.
objpack-body_start = 1.
READ TABLE objbin INDEX tab_lines.
objpack-doc_size = tab_lines * 255 .
objpack-body_num = tab_lines.
objpack-doc_type = 'PDF'.
objpack-obj_name = 'SMART'.
objpack-obj_descr = 'test'.
APPEND objpack.
Completing the recipient list
target recipent
CLEAR reclist.
reclist-receiver = '[email protected]'.
reclist-express = 'X'.
reclist-rec_type = 'U'.
APPEND reclist.
Sending the document
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = doc_chng
put_in_outbox = 'X'
TABLES
packing_list = objpack
object_header = objhead
contents_bin = objbin
contents_txt = objtxt
receivers = reclist
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 99.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Regards,
ajithHello Ajith,
Use this Code.
Internal Table declarations
DATA: i_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,
i_tline TYPE TABLE OF tline WITH HEADER LINE,
i_receivers TYPE TABLE OF somlreci1 WITH HEADER LINE,
i_record LIKE solisti1 OCCURS 0 WITH HEADER LINE,
Objects to send mail.
i_objpack LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
i_objtxt LIKE solisti1 OCCURS 0 WITH HEADER LINE,
i_objbin LIKE solisti1 OCCURS 0 WITH HEADER LINE,
i_reclist LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
Work Area declarations
wa_objhead TYPE soli_tab,
w_ctrlop TYPE ssfctrlop,
w_compop TYPE ssfcompop,
w_return TYPE ssfcrescl,
wa_doc_chng typE sodocchgi1,
w_data TYPE sodocchgi1,
wa_buffer TYPE string,"To convert from 132 to 255
Variables declarations
v_form_name TYPE rs38l_fnam,
v_len_in LIKE sood-objlen,
v_len_out LIKE sood-objlen,
v_len_outn TYPE i,
v_lines_txt TYPE i,
v_lines_bin TYPE i.
call function 'SSF_FUNCTION_MODULE_NAME'
exporting
formname = 'ZZZ_TEST1'
importing
fm_name = v_form_name
exceptions
no_form = 1
no_function_module = 2
others = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
w_ctrlop-getotf = 'X'.
w_ctrlop-no_dialog = 'X'.
w_compop-tdnoprev = 'X'.
CALL FUNCTION v_form_name
EXPORTING
control_parameters = w_ctrlop
output_options = w_compop
user_settings = 'X'
IMPORTING
job_output_info = w_return
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
i_otf[] = w_return-otfdata[].
call function 'CONVERT_OTF'
EXPORTING
format = 'PDF'
max_linewidth = 132
IMPORTING
bin_filesize = v_len_in
TABLES
otf = i_otf
lines = i_tline
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
others = 4.
Fehlerhandling
if sy-subrc <> 0.
endif.
loop at i_tline.
translate i_tline using '~'.
concatenate wa_buffer i_tline into wa_buffer.
endloop.
translate wa_buffer using '~'.
do.
i_record = wa_buffer.
append i_record.
shift wa_buffer left by 255 places.
if wa_buffer is initial.
exit.
endif.
enddo.
Attachment
refresh:
i_reclist,
i_objtxt,
i_objbin,
i_objpack.
clear wa_objhead.
i_objbin[] = i_record[].
Create Message Body
Title and Description
i_objtxt = 'test with pdf-Attachment!'.
append i_objtxt.
describe table i_objtxt lines v_lines_txt.
read table i_objtxt index v_lines_txt.
wa_doc_chng-obj_name = 'smartform'.
wa_doc_chng-expiry_dat = sy-datum + 10.
wa_doc_chng-obj_descr = 'smartform'.
wa_doc_chng-sensitivty = 'F'.
wa_doc_chng-doc_size = v_lines_txt * 255.
Main Text
wa_doc_chng-doc_size = ( v_lines_txt - 1 ) * 255 + strlen( i_objtxt )
clear i_objpack-transf_bin.
i_objpack-head_start = 1.
i_objpack-head_num = 0.
i_objpack-body_start = 1.
i_objpack-body_num = v_lines_txt.
i_objpack-doc_type = 'RAW'.
append i_objpack.
Attachment
(pdf-Attachment)
i_objpack-transf_bin = 'X'.
i_objpack-head_start = 1.
i_objpack-head_num = 0.
i_objpack-body_start = 1.
Länge des Attachment ermitteln
describe table i_objbin lines v_lines_bin.
read table i_objbin index v_lines_bin.
i_objpack-doc_size = v_lines_bin * 255 .
i_objpack-body_num = v_lines_bin.
i_objpack-doc_type = 'PDF'.
i_objpack-obj_name = 'smart'.
i_objpack-obj_descr = 'test'.
append i_objpack.
clear i_reclist.
i_reclist-receiver = '[email protected]'.
i_reclist-rec_type = 'U'.
append i_reclist.
call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = wa_doc_chng
put_in_outbox = 'X'
TABLES
packing_list = i_objpack
object_header = wa_objhead
CONTENTS_BIN = i_objbin
contents_txt = i_objtxt
receivers = i_reclist
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
others = 8.
if helped reward points
Vasanth -
Dynamic attachment name in receiver mail adapter for 1 attachment?
Hi,
seems to be a tricky thing....
The sender interface (file) picks up an xml file and a pdf document.
The receiver wants to get the xml file as a txt file and the pdf, both sent together by mail.
We are following this thread:
"Sending multiple attachments winthin a single Receiver Mail adapter in required format".
So far we are able to generate the txt file and send it together with the pdf to the recipient.
The txt file gets its name from the payload of the xml file.
Unfortunately the pdf should be renamed to the same name as the txt file.
And here we are stuck.
We generate the filename for the txt file in the mapping to the mail message (as usual ximail30.xsd).
But for the pdf we are only able to set a static name in the channel module page using
Transform.ContentDisposition.
Any ideas how to solve this are really welcome!!!!
(Solutions that do not talk about using a new module to be written are prefered.)
Regards
DirkHi,
seems to be a tricky thing....
The sender interface (file) picks up an xml file and a pdf document.
The receiver wants to get the xml file as a txt file and the pdf, both sent together by mail.
We are following this thread:
"Sending multiple attachments winthin a single Receiver Mail adapter in required format".
So far we are able to generate the txt file and send it together with the pdf to the recipient.
The txt file gets its name from the payload of the xml file.
Unfortunately the pdf should be renamed to the same name as the txt file.
And here we are stuck.
We generate the filename for the txt file in the mapping to the mail message (as usual ximail30.xsd).
But for the pdf we are only able to set a static name in the channel module page using
Transform.ContentDisposition.
Any ideas how to solve this are really welcome!!!!
(Solutions that do not talk about using a new module to be written are prefered.)
Regards
Dirk -
Receiver mail adapter - Payload as a Text attachment
Hi,
In my proxy to mail adapter scenario, when i want to send payload to email as a Text email, where i need to content conversion in XI (XML to Txt file)
when i send payload, currently i am receiving as a XML file.
I try to follow like Rushikesh Deshmukh XI thread: Text Attachment in Mail Adapter in XI forum(topic)
I have having following config
Processing Sequence
localejbs/CreateAttachment Local Enterprise Bean XML2Plain
localejbs/sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean Local Enterprise Bean mail
Module Configuration
XML2Plain Transform.Class com.sap.aii.messaging.adapter.Conversion
XML2Plain Transform.ContentType text/plain;charset=utf-8
XML2Plain xml.Header1000.fieldFixedLengths 100,10,10,30,30,80,80,20,10,10,20,20,30,10,18,240,10,30,18,10
XML2Plain xml.Header2000.fieldFixedLengths 100,30,40,240
XML2Plain xml.addHeaderLine 0
XML2Plain xml.conversionType StructXML2Plain
XML2Plain xml.recordsetStructure Header1000,Header2000
Please suggest some solution."
Could you tell me exactly where i need to do all these setting and
do i need import localejbs/CreateAttachment Local Enterprise Bean XML2Plain...I mean shall i add same in my processing sequence
give in detail ? (in Receiver mail adapter Communication channel, advanced mode additional parameters)
I tried to follow this also
http://help.sap.com/saphelp_nw04/helpdata/EN/4e/c153426da9bd30e10000000a155106/frameset.htm
but i could not find much info on this help.sap.com reg. req.
Thanks
PrabaharanHi
f i create like this Receiver CC (module Tab)
number: 1
Module Name: localejbs/CreateAttachment
Module Type: Local Enterprise Bean
Module Key: mail
is it enough? do i need any other setting like this
Did you deployed CreateAttachment on PI server. As this is not a standard SAP module this is a custom module?
mail as module key is already used by XIMAILAdapterBean use some other key for CreateAttachment
Settings are fine for the Module
Processing Sequence
localejbs/CreateAttachment Local Enterprise Bean XML2Plain
localejbs/sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean Local Enterprise Bean mail
Module Configuration
XML2Plain Transform.Class com.sap.aii.messaging.adapter.Conversion
In this:
Module Key: XML2Plain
Parameter Name: Transform.Class
Parameter Value: com.sap.aii.messaging.adapter.Conversion
is it right?
Processing sequence is fine
XML2Plain Transform.ContentType text/plain;charset=utf-8
XML2Plain xml.Header1000.fieldFixedLengths 100,10,10,30,30,80,80,20,10,10,20,20,30,10,18,240,10,30,18,10
XML2Plain xml.Header2000.fieldFixedLengths 100,30,40,240
XML2Plain xml.addHeaderLine 0
XML2Plain xml.conversionType StructXML2Plain
XML2Plain xml.recordsetStructure Header1000,Header2000
can i anyone explain how to these settings?
Is this key valid to provide inputs to the module check with the code for this module
This looks like valid for MessageTransformBean ro StrictXMLtoPlainBean
Thanks
Gaurav
Edited by: Gaurav Bhargava on Oct 15, 2008 5:34 AM -
Configuring Receiver mail adapter with dynamic email addresses
Hi,
I'm a newbie to XI and I have problems in configuring the Receiver mail adapter with the "Use Mail package" option selected. I am trying pickup a file (using file adapter on Sender side, picks up a simple XML file) and after mapping in XI, send the message as an email message to dynamic email addresses.
Everything works fine if I did not select the "Use Mail Package". But when I choose that option it errors out. I followed this blog posted on SDN -
/people/michal.krawczyk2/blog/2005/03/07/mail-adapter-xi--how-to-implement-dynamic-mail-address
The following XML message is my source
<ns0:Messages xmlns:ns0="http://sap.com/xi/XI/Somenamespace">
<ns0:Message1>
<ns1:studentlisttest xmlns:ns1="urn:karthiksender_to_karthikreceiver">
<Student>
<studentid>1</studentid>
<lastname>Studentlastname</lastname>
<firstname>Studentfirstname</firstname>
</Student>
<Mail>
<From>[email protected]</From>
<To>[email protected]</To>
<Subject>Test mail adapter</Subject>
</Mail>
</ns1:studentlisttest>
</ns0:Message1>
</ns0:Messages>
What I want to accomplish is, I have a simple message mapping where the Studentdetails are mapped to, lets say Customer details. For convenience lets keep it simple, StudentId --> Customerid, (student)Firstname --> (customer)Firstname, (Student)Lastname --> (customer)Lastname
I would like to get the Customer details as an XML attachment or in the body of an email with from, to and subject corresponding to that specified in the <Mail> node.
I followed the instructions posted on the blog and it works fine if I don't map the studentdetails to customerdetails. I did multimapping, with one source message (the xml file I posted above) and two target messages (customerdetails and Mail, which is the external definition posted on the blog). I beleive I'm missing something here. Could somebody please guide me through this?
Thanks
Karthikhi,
I still have not found the solution for this problem. Michal, your blog works fine when my source message has got only the mail details. As per your advice, I tried modified the structure of the xsd file as follows
<xs:schema targetNamespace="http://sap.com/xi/XI/Mail/30"
xmlns:xi="http://sap.com/xi/XI/Mail/30"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!--
Mail
-->
<xs:element name="Mail">
<xs:annotation>
<xs:documentation>Mail package for XI - Mail Adapter</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="Subject" type="xs:string" minOccurs="0"/>
<xs:element name="From" type="xs:string" minOccurs="0"/>
<xs:element name="To" type="xs:string" minOccurs="0"/>
<xs:element name="Reply_To" type="xs:string" minOccurs="0"/>
<xs:element name="Content_Type" type="xs:string" minOccurs="0"/>
<xs:element name="Date" type="xs:dateTime" minOccurs="0"/>
<xs:element name="Message_ID" type="xs:string" minOccurs="0"/>
<xs:element name="X_Mailer" type="xs:string" minOccurs="0"/>
<xs:element name="Content" minOccurs="0">
<xs:annotation>
<xs:documentation>any type</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
<xs:attribute name="encoding" type="xs:string"/>
</xs:complexType>
</xs:element>
<xs:element name="MailReceipt">
<xs:annotation>
<xs:documentation>Mail Receipt for XI - Mail Adaper</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="Server" type="xs:string"/>
<xs:element name="Format" type="xs:string"/>
<xs:element name="UseMailPackage" type="xs:boolean"/>
<xs:element name="Encoding" type="xs:string"/>
<xs:element name="Subject" type="xs:string" minOccurs="0"/>
<xs:element name="From" type="xs:dateTime" minOccurs="0"/>
<xs:element name="To" type="xs:string" minOccurs="0"/>
<xs:element name="Date" type="xs:dateTime" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="CustomerlistExternal">
<xs:annotation>
<xs:documentation>Customer List</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="Customername" type="xs:string"/>
<xs:element name="Customerid" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
My source message will be something like
<?xml version="1.0" encoding="UTF-8"?>
<ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
<ns0:Message1>
<ns1:studentlisttest xmlns:ns1="urn:karthiksender_to_karthikreceiver">
<Student>
<studentid>1</studentid>
<lastname>abclname</lastname>
<firstname>abcfname</firstname>
</Student>
<Mail>
<From>[email protected]</From>
<To>[email protected]</To>
<Subject>Testing Mail adapter</Subject>
</Mail>
</ns1:studentlisttest>
</ns0:Message1>
</ns0:Messages>
I have mapped the <student></student> information to customerlist, with customerid --> studentid and customername --> firstname or lastname (for symplicity). This was a multimapping with one source and two target messages. My test mapping output is
<?xml version="1.0" encoding="UTF-8"?>
<ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
<ns0:Message1>
<ns2:Mail xmlns:ns2="http://sap.com/xi/XI/Mail/30">
<Subject>Testing Mail adapter</Subject>
<From>[email protected]</From>
<To>[email protected]</To>
</ns2:Mail>
</ns0:Message1>
<ns0:Message2>
<ns2:CustomerlistExternal xmlns:ns2="http://sap.com/xi/XI/Mail/30">
<Customername>abclname</Customername>
<Customerid>1</Customerid>
</ns2:CustomerlistExternal>
</ns0:Message2>
</ns0:Messages>
So how would I get this part of the <CustomerlistExternal></CustomerlistExternal> part of the message as an attachment to the mail address specified in the <ns2:Mail></ns2:Mail> tags.
I'm definitely not understanding it right and am missing something. Could you give me step by step instructions to acheive this. I apologize for the trouble..this would be of great help to me.
Thanks
Karthik -
Receiver Mail Adapter - Avoid attachment
Hello
Could anyone please let me know, how to prevent a mail attachment with a Receiver Mail Adapter. I have chosen XIPAYLOAD as Message Protocol. When the mail is received there is no mail body, instead only the attachment contains the message.
Thanks
John JeyarajHi,
Use Mail XSD as target structure in your mapping and enable use Mail package in your receiver channel...
for avoiding attachments..
HTH
Rajesh -
Sending mails from sap to outlook with pdf attachment
Hi All
I am using the function module 'SO_NEW_DOCUMENT_ATT_SEND_API1' to send
mail with the pdf attachment to a SMTP mail id(outlook). I have done all the configuration settings in SCOT transaction. But still i am not able to get the mail in my outlook mailbox. Following are the details of the steps i have followed.
step1.
Get the OTF data output from the SMARTFORMS function module.
step2,
convert the OTF output data to PDF format.
step3.
populate all the required table to pass data to the function
module 'SO_NEW_DOCUMENT_ATT_SEND_API1' -
packing_list
contents_bin
contents_txt
receivers
and call the function module.
After doing the above steps still i am not able to get the mail in my outlook mailbox. Please Help.
Thanks
Jitendra Kumar Tripathy.hi,
kindly chk the code i wrote for my program.
it will solve ur issue.
Internal Table declarations
DATA: i_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,
i_tline TYPE TABLE OF tline WITH HEADER LINE,
i_receivers TYPE TABLE OF somlreci1 WITH HEADER LINE,
i_record LIKE solisti1 OCCURS 0 WITH HEADER LINE,
Objects to send mail.
i_objpack LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
i_objtxt LIKE solisti1 OCCURS 0 WITH HEADER LINE,
i_objbin LIKE solisti1 OCCURS 0 WITH HEADER LINE,
i_reclist LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
Work Area declarations
wa_objhead TYPE soli_tab,
w_ctrlop TYPE ssfctrlop,
w_compop TYPE ssfcompop,
w_return TYPE ssfcrescl,
wa_doc_chng typE sodocchgi1,
w_data TYPE sodocchgi1,
wa_buffer TYPE string,"To convert from 132 to 255
Variables declarations
v_form_name TYPE rs38l_fnam,
v_len_in LIKE sood-objlen,
v_len_out LIKE sood-objlen,
v_len_outn TYPE i,
v_lines_txt TYPE i,
v_lines_bin TYPE i.
call function 'SSF_FUNCTION_MODULE_NAME'
exporting
formname = 'ZZZ_TEST1'
importing
fm_name = v_form_name
exceptions
no_form = 1
no_function_module = 2
others = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
w_ctrlop-getotf = 'X'.
w_ctrlop-no_dialog = 'X'.
w_compop-tdnoprev = 'X'.
CALL FUNCTION v_form_name
EXPORTING
control_parameters = w_ctrlop
output_options = w_compop
user_settings = 'X'
IMPORTING
job_output_info = w_return
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
i_otf[] = w_return-otfdata[].
call function 'CONVERT_OTF'
EXPORTING
format = 'PDF'
max_linewidth = 132
IMPORTING
bin_filesize = v_len_in
TABLES
otf = i_otf
lines = i_tline
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
others = 4.
Fehlerhandling
if sy-subrc <> 0.
endif.
loop at i_tline.
translate i_tline using '~'.
concatenate wa_buffer i_tline into wa_buffer.
endloop.
translate wa_buffer using '~'.
do.
i_record = wa_buffer.
append i_record.
shift wa_buffer left by 255 places.
if wa_buffer is initial.
exit.
endif.
enddo.
Attachment
refresh:
i_reclist,
i_objtxt,
i_objbin,
i_objpack.
clear wa_objhead.
i_objbin[] = i_record[].
Create Message Body
Title and Description
i_objtxt = 'test with pdf-Attachment!'.
append i_objtxt.
describe table i_objtxt lines v_lines_txt.
read table i_objtxt index v_lines_txt.
wa_doc_chng-obj_name = 'smartform'.
wa_doc_chng-expiry_dat = sy-datum + 10.
wa_doc_chng-obj_descr = 'smartform'.
wa_doc_chng-sensitivty = 'F'.
wa_doc_chng-doc_size = v_lines_txt * 255.
Main Text
wa_doc_chng-doc_size = ( v_lines_txt - 1 ) * 255 + strlen( i_objtxt )
clear i_objpack-transf_bin.
i_objpack-head_start = 1.
i_objpack-head_num = 0.
i_objpack-body_start = 1.
i_objpack-body_num = v_lines_txt.
i_objpack-doc_type = 'RAW'.
append i_objpack.
Attachment
(pdf-Attachment)
i_objpack-transf_bin = 'X'.
i_objpack-head_start = 1.
i_objpack-head_num = 0.
i_objpack-body_start = 1.
Länge des Attachment ermitteln
describe table i_objbin lines v_lines_bin.
read table i_objbin index v_lines_bin.
i_objpack-doc_size = v_lines_bin * 255 .
i_objpack-body_num = v_lines_bin.
i_objpack-doc_type = 'PDF'.
i_objpack-obj_name = 'smart'.
i_objpack-obj_descr = 'test'.
append i_objpack.
clear i_reclist.
i_reclist-receiver = '[email protected]'.
i_reclist-rec_type = 'U'.
append i_reclist.
call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = wa_doc_chng
put_in_outbox = 'X'
TABLES
packing_list = i_objpack
object_header = wa_objhead
CONTENTS_BIN = i_objbin
contents_txt = i_objtxt
receivers = i_reclist
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
others = 8.
if helped rwrd points
anver -
In Receiver Mail Adapter ,how to ignore SOAP Header attachment
HI Folks,
Am using Receiver Mail Adapter and am getting 2 attachments.
1. one is Soap header which contains Control records
2. payload
I want only Payload as attachment and need to ignore SOAP Header(AT00001.xml).
The configuration is as below:-Trasport protocol : SMTP
Message Protocol: XIALL
Please provide Inputs.
Thanks & Regards
Ashok ReddyHi Gagandeep,
Scenario: File------>mail( Bypass scenario)
i had posted file in FTP and am getting attachment properly but aditionally am getting ATT00001.xml as SoapHeader.this i need to ignore.
PFB Module Parametrs i used:
localejbs/AF_Modules/MessageTransformBean LocalEnterpriseBean transform
Modulekey Parameterattribute value
transform Transform.ContentDisposition attachment;filename=”Pocr_860.txt”
transform Tansform.ContentType text/plain
Regards
Ashok
Maybe you are looking for
-
How can I modify one column of current and next record depending of some criteria?
Having DDL CREATE TABLE #ServiceChange( [ID] [int] identity(1,1), [SHCOMP] [char](2) NOT NULL, [SHCRTD] [numeric](8, 0) NOT NULL, [SHCUST] [numeric](7, 0) NOT NULL, [SHDESC] [char](35) NOT NULL, [SHTYPE] [char](1) NOT NULL, [SHAMT] [numeric](9, 2) NO
-
How to know if a thread is busy?
I have a main class and a Thread class that is a client. I need this feature: client receive a data and pass it to main class; main class, by its methods, process this data; during processing, client could receive a new data, but if main class is sti
-
Hi , There is a requirement where the client wants a report where when he enters PERNR he gets the required workcenter to which the pernr is assigned. The client insists to get this through pernr( means the input should be pernr and result should be
-
OD User home icon not connected in finder?
I Have a user that can login to his OD just fine, all docs etc are there, BUT if he clicks on his home (house) icon in the finder is is misted out and states : exampleuser's account cannot be found" but if he clicks on documents in finder it all conn
-
Enterprise Asset Management(EAM)
Hello Friends I want to know about Enterprise Asset Management(EAM) ,whether it is an SAP process ,under SAP which module it covers .plz guide me in this. Regards, Kiran