Reading an PDF Attachment From Sender Mail Adapter
Hi All,
i am able to get a mail from my Mail Server, But my aim is need to Read an PDF attachment from the mail, in SXMB Moni i am getting the Payload with attachment, I have a created a module to convert that PDF to XML(Module is working fine in file to file sceneraio) .
In adapter should i need to use Payload Swap Bean Module also , because in sap help said that i need Select Keep Attachments. I want to know how that how to Push the PDF attachment to My Custom Module which is used to convert the PDF To XML.
If Payload Swap Bean Module needs to be Used , please tell me the Key Names and Key Values to be used.(swap.keyName,swap.keyValues)
Thanks and Regards,
Kamal
Note: Points will be awarded
Kamal...
See if this helps
[Module Name]
AF_Modules/PayloadSwapBean
[Module Parameters]
The following parameters are used for this module
swap.keyName the name of a supported attribute.
swap.keyValue the value of a partial string that is required
to appear.
The supported attributes (swap.keyName) include the payload attributes
such as payload-name, payload-description and any content attributes
such as content-type, content-disposition, content-description, etc.
Regards
Ravi Raman
Similar Messages
-
How to download / read text attachment in Sender Mail Adapter IN XI
Hi
I would like to know how to download / read text attachment in sender mail Adapter & sent same attachment to target system using file adapter.
Please help how to design / resolve this concept.
Regards
DSRI would like to know how to download / read text attachment in sender mail Adapter & sent same
attachment to target system using file adapter.
Take help from this blog:
/people/michal.krawczyk2/blog/2005/12/18/xi-sender-mail-adapter--payloadswapbean--step-by-step
From the blog:
However in most cases
our message will not be a part of the e-mail's payload but will be sent as a file attachment.
Can XI's mail adapter handle such scenarios? Sure it can but with a little help
from the PayloadSwapBean adapter module
Once your message (attachment) is read by the sender CC, you can perform the basic mapping requirement (if any) to convert the mail message fromat to the file format.....configure a receiver FILE CC and send the message...this should be the design...
Regards,
Abhishek. -
Using header paramter SHeaderX-MS-HAS-ATTACH in Sender mail adapter
I am trying to check if an e-mail contains attachment in reciever determintion
I set the Variable Header XHeaderName1 to be SHeaderX-MS-HAS-ATTACH
in Sender mail adapter
I added a condition in the receving determintation
XHeaderName1 = yes
I see the DynamicConfiguration tab in sxmb_moni and the value of SHeaderX-MS-HAS-ATTACH is "yes"
but the message fails with the error
No receiver could be determined
any ideas?Hi,
In Receiver determination you need to set SHeaderX-MS-HAS-ATTACH = yes instead of XHeaderName1.
As far my understanding, in receiver determination you need to verify the condition with SHeaderX-MS-HAS-ATTACH = yes (check with syntax also ie. case sensitive and all)
Thanks
Swarup -
Read multi-tabbed excel file attachments from Sender Mail Adapter.
There is a need to read excel attachments from incoming email to a
mailbox. We know we can use Sender Mail adapter to easily read .xml, .txt
or .csv attachments.
For excel attachments we know from SDN that you have to write
adapter modules to handle excel. However the excel file we need to read has
multiple worksheets(tabs) and data may be contained in any of them.
Is it possible to use SAP XI Mailsender adapter to read such a file as an attachment? What kind of module development would we need for this? I am not much of a Java programmer so examples or links to other documentation would help.
Thanks,
RudraRudra,
Use Java Mapping. There is a free java api available called JExcelAPI to achieve this.
Shabarish's blog describes about this. This might be helpful to you
/people/shabarish.vijayakumar/blog/2009/04/05/excel-files--how-to-handle-them-in-sap-xipi-the-alternatives -
Read filename of email attachment for sender mail adapter
Hi All,
We have a requirement to read filename of email attachment received from Sender email adapter and send details to SAP by Proxy call.
Can we retrieve the filename of email attachment ?
Any help on this will be really useful.
Regards,
AshishHi,
>>>Can we retrieve the filename of email attachment ?
Please see the below link, it might be useful to you.
http://wiki.sdn.sap.com/wiki/display/XI/AdapterModulePI7.0GetAttachmentName
Regards,
P.Rajesh -
Facing problem with logo in the PDF attachment when sending mail...
hi friends,
i'm facing problem with logo in the PDF attachment to the mail.
my requirement:
1. enter spool number and mail id in the selection screen.
process:
1. now the program will fetch the spool data and converts it to PDF.
2. but when i'm trying to send mail with this PDF as attachment.
when i open the PDF file from the mail, logo is not coming properly (looks disturbed).
can anyone help me how to resolve this issue...
thanks in advance, murashali.hi dinakar, thanks for your mail...
logo looks good in spool/script/smartform.
even it look good when i download this spool to pdf and to the presentation server as pdf file.
i'm using CONVERT_OTFSPOOLJOB_2_PDF.
when i used CONVERT_ABAPSPOOLJOB_2_PDF, is gives a msg - 'spool number not found'.
here i'm using folloing code to pass pdf to the function module: SO_NEW_DOCUMENT_ATT_SEND_API1.
code:
Transfer the 132-long strings to 255-long strings
lt_mtab_pdf[] = pdf[].
LOOP AT lt_mtab_pdf INTO lwa_mtab_pdf.
TRANSLATE lwa_mtab_pdf USING ' ~'.
CONCATENATE lv_gd_buffer lwa_mtab_pdf INTO lv_gd_buffer.
CLEAR lwa_mtab_pdf.
ENDLOOP.
TRANSLATE lv_gd_buffer USING '~ '.
DO.
lwa_mess_att = lv_gd_buffer.
APPEND lwa_mess_att TO lt_mess_att.
CLEAR lwa_mess_att.
SHIFT lv_gd_buffer LEFT BY 255 PLACES.
IF lv_gd_buffer IS INITIAL.
EXIT.
ENDIF.
ENDDO.
NOTE: problem i believe is with ''. i'm getting this tilt symbol () in my pdf internal table. here in the above code the line TRANSLATE lv_gd_buffer USING '~ ' is changing the existing tilt to space. so my logo is getting disturbed.
even i tried with REPLACE this tilt with other char, but it doent work.
can you give any idea... -
Dynamic file name of the attachment in sender mail adapter
Hi
I have configured a sender mail adapter which receives some attachments.
Right now the file name of the attachment is hardcoded to "MailAttachment-1" "MailAttachment-2" using the content-description from "AF_Modules/PayloadSwapBean" module.
I want to set it to dynamic ie. instead of "MailAttachment-1"... i want it with real name of the attach.
please suggest a solution w/o the need to develop a custom adapter module.
Thanks!
Regards,
Mariano.Thanks Prateek,
Now, i can see that the name of the original file is into the content type named as text/xml; name"name of the file.xml" when i send the email from outlook.
If i send it from hotmail, this is not happend.
Do you know why happend this?
If i always would have the original name inside the content type, my problem will be solved.
Edited by: Mariano Vidal on Feb 13, 2009 2:26 PM -
Smartform to convert as pdf attachment and sending mail.
Program to convert smartform as PDF and send PDF as an atachment to email id.
********Variable Declarations ****************************
DATA: gv_form_name TYPE rs38l_fnam, " Used to store the function module generated by Smartform
gv_bin_filesize TYPE i, " Store the file size
gv_pos TYPE i,
gv_len TYPE i,
gv_tab_lines TYPE i.
*******Constants ******************************************
DATA : gc_text(11) TYPE c VALUE 'Form Output',
gc_tst(3) TYPE c VALUE 'TST',
gc_testing(7) TYPE c VALUE 'Testing'.
CONSTANTS : c_formname TYPE tdsfname VALUE 'ZSMART_T'. "Zsmart_t is the smartform name.
********Work Area Declarations ****************************
DATA: gs_docdata TYPE sodocchgi1, " Data of an object which can be changed
gs_ctrlop TYPE ssfctrlop, " Smart Forms: Control structure
gs_outopt TYPE ssfcompop, " SAP Smart Forms: Smart Composer (transfer) options
gs_otfdata TYPE ssfcrescl, " Smart Forms: Return value at end of form printing
gs_reclist TYPE somlreci1, " SAPoffice: Structure of the API Recipient List
gs_pdf_tab TYPE tline, " Workarea for SAP Script Text Lines
gs_objbin TYPE solisti1, " SAPoffice: Single List with Column Length 255
gs_objpack TYPE sopcklsti1. " SAPoffice: Description of Imported Object Components
********Internal tables Declarations ****************************
DATA: gt_reclist TYPE TABLE OF somlreci1, " SAPoffice: Structure of the API Recipient List
gt_pdf_tab TYPE TABLE OF tline, " SAPscript: Text Lines
gt_otf TYPE TABLE OF itcoo, " OTF Structure
gt_objbin TYPE TABLE OF solisti1, " SAPoffice: Single List with Column Length 255
gt_objpack TYPE TABLE OF sopcklsti1. " SAPoffice: Description of Imported Object Components
DATA: customer TYPE scustom,
bookings TYPE ty_bookings,
connections TYPE ty_connections.
CLEAR : gv_form_name,
gs_ctrlop,
gs_outopt,
gs_otfdata,
gv_bin_filesize,
gv_pos,
gv_len,
gv_tab_lines.
START-OF-SELECTION.
Generate Function Module name
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = c_formname
IMPORTING
fm_name = gv_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.
Assigning values to Form Control Structure and Form Composer
gs_ctrlop-getotf = 'X'.
gs_ctrlop-device = 'PRINTER'.
gs_ctrlop-preview = ''.
gs_ctrlop-no_dialog = 'X'.
gs_outopt-tddest = 'LP01'. "or 'LOCL'.
Getting the OTFDATA
CALL FUNCTION gv_form_name
EXPORTING
control_parameters = gs_ctrlop
output_options = gs_outopt
user_settings = ' '
customer = customer
bookings = bookings
connections = connections
IMPORTING
job_output_info = gs_otfdata
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Assigning the OTFDATA to OTF Structure table
CLEAR gt_otf.
gt_otf[] = gs_otfdata-otfdata[].
Convert the OTF DATA to SAP Script Text lines
CLEAR gt_pdf_tab.
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
max_linewidth = 132
IMPORTING
bin_filesize = gv_bin_filesize
TABLES
otf = gt_otf
lines = gt_pdf_tab
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Assigning the Description of the object sent in the mail
CLEAR gs_docdata.
gs_docdata-obj_name = gc_tst.
gs_docdata-obj_descr = gc_testing.
Assigning the email id to Structure of the API Recipient List table
CLEAR : gt_reclist, gs_reclist.
IF internal mail id
gs_reclist-receiver = sy-uname.
GS_RECLIST-REC_TYPE = 'B'.
if external mail id
gs_reclist-receiver = mailid.com'.
gs_reclist-rec_type = 'U'.
APPEND gs_reclist TO gt_reclist.
Passing the SAP Script text lines to SAPoffice: Single List with Column Length 255 table
CLEAR : gs_objbin, gs_pdf_tab.
LOOP AT gt_pdf_tab INTO gs_pdf_tab.
gv_pos = 255 - gv_len.
IF gv_pos > 134. "length of pdf_table
gv_pos = 134.
ENDIF.
gs_objbin+gv_len = gs_pdf_tab(gv_pos).
gv_len = gv_len + gv_pos.
IF gv_len = 255. "length of out (contents_bin)
APPEND gs_objbin TO gt_objbin.
CLEAR: gs_objbin, gv_len.
IF gv_pos < 134.
gs_objbin = gs_pdf_tab+gv_pos.
gv_len = 134 - gv_pos.
ENDIF.
ENDIF.
ENDLOOP.
IF gv_len > 0.
APPEND gs_objbin TO gt_objbin.
ENDIF.
Filling the details in SAPoffice: Description of Imported Object Components table
DESCRIBE TABLE gt_objbin LINES gv_tab_lines.
CLEAR gs_objbin.
READ TABLE gt_objbin INTO gs_objbin INDEX gv_tab_lines.
IF sy-subrc = 0.
gs_objpack-doc_size = ( gv_tab_lines - 1 ) * 255 + STRLEN( gs_objbin ).
gs_objpack-transf_bin = 'X'.
gs_objpack-head_start = 1.
gs_objpack-head_num = 0.
gs_objpack-body_start = 1.
gs_objpack-body_num = gv_tab_lines.
gs_objpack-doc_type = 'PDF'.
gs_objpack-obj_name = 'ATTACHMENT'.
gs_objpack-obj_descr = 'test'.
APPEND gs_objpack TO gt_objpack.
ENDIF.
Sending the Form Output in the PDF format to email
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = gs_docdata
put_in_outbox = 'X'
commit_work = 'X'
TABLES
packing_list = gt_objpack
contents_bin = gt_objbin
receivers = gt_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 sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
WRITE 'Sent Successfully'.
ENDIF.
SUBMIT rsconn01
WITH mode EQ 'INT'
AND RETURN.
END-OF-SELECTION.Hi
Use function modules
CALL FUNCTION 'CONVERT_OTF'
and CALL FUNCTION 'SX_TABLE_LINE_WIDTH_CHANGE' to convert as a pdf document
for sending mail CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
Regards,
Gopi -
Support package of attachment for Sender mail adapter
can anyone tell me after which support package XI supports
Attachments in sender mail Adapter.
Thanks
Sunil Singhhi sunil,
check this links
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6d967fbc-0a01-0010-4fb4-91c6d38c5816
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/9e6c7911-0d01-0010-1aa3-8e1bb1551f05
http://www.sapag.co.in/SAP-XI-Mail-Adaptor-FAQ'S.html
regards
srinivas -
How to retrieve client certificate information from sender mail adapter
Hi, expert:
I have a requirement to verify the validation of coming email with digital certification. The mail is with digital certification. If the coming email is valid, I 'll get the attachemt of the mail for further processing. I have a sender mail adapter and receiver file adapter configued.
I have already my own developed adapter module, which is configued in mail adapter. My question is how to retrieve the detailed certificate information in the adapter module developed by myself. Is it feasible?
Thanks a lot.The WL-Client-Proxy cert should be the cert used on the proxy side if SSL is configured between Apache and WebLogic, so I believe that is the reason why that does not work. Basically, the problem here is that SSL is end-to-end, and the two ends of this transaction are the client and apache.
That said, when you add the +ExportCertData option, this should record the client's SSL certificate in the vairable SSL_CLIENT_CERT. So you should be able to use request.getAttribute("SSL_CLIENT_CERT").
See:
http://www.modssl.org/docs/2.8/ssl_reference.html
If this doesn't work for you (which is possible if the WL_Proxy is doing something funny to the request), it is probably best just to dump out the entire contents of the session, and see what you have:
for (Enumeration e = request.getAttributeNames() ; e.hasMoreElements() ; ) {
String attr = (String)e.nextElement();
System.out.println("ATTR = " + attr);
System.out.println("VAL = " + request.getAttribute(attr));
If you can't see any SSL certificate there, you will have to work out some way to pass this on manually.
cheers,
Trevor -
Issue with reading attachment in sender mail adapter
Hi, I am working on Email to file scenario, where I have to connect to exchange server and take the attachment of the email (xml file) and save it on to PI server. I have configured sender mail communication channel with following details:
Protocol: POP3
Message protocol: XIPAYLOAD
Mail attributes: keep attachments
Module:
1 localejbs/AF_Modules/PayloadSwapBean Local Enterprise Bean 1
2 localejbs/sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean Local Enterprise Bean mail
1 swap.keyName Content-Description
1 swap.keyName Content-Description
1 swap.keyValue attachment,filename="MailAttachment-1.xml"
1 swap.keyValue MailAttachment-1
Also, configured receiver file adapter.
Since I donu2019t have to read mail content , I havenu2019t created any design components in ESR. I have just refrred to dummy namespace, interface (both sender and receiver). in receiver determination, interface determination, sender agreement and receiver agreements.
It was working fine, not sure what changes happened. Now I could see the attachment payload in message monitor.
Under Inbound message->payloads->
MailMessage ( text/xml;charset=utf-8 )
MailAttachment-1 ( text/xml;name="****************")
But the fille that is getting created doesnu2019t have the contents of the attachment (xml file) . It has some other information, shown below:
Directory: ******
Name: ********.xml
=NextPart_002_01CB2C5B.B033B325#
content-type:text/plain;charset="us-ascii"#
content-length:30#
content-transfer-encoding:quoted-printable#
<<**********.xml>>=20#
=NextPart_002_01CB2C5B.B033B325#
content-type:text/html;charset="us-ascii"#
content-length:#
content-transfer-encoding:quoted-printable#
=NextPart_002_01CB2C5B.B033B325 #
Can you please let me know what is going wrong here.using following parameters in module resolved my problem:
MOdule name Type Module Key
AF_Modules/PayloadSwapBean Local Enterprise Bean transform sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean Local Enterprise Bean mail
Module Key Parameter Name Parameter value
transform swap.keyName Payload-Name
transform swap.keyName MailAttachment-1 -
Separate valid mail attachment in sender mail adapter
Hi Experts,
I am working on Mail -> RFC scenario in pi 7.3.
Our channel is able to process new mail having valid attachement (i.e. .xml) file.
But sometime attachment contain invalid format also like pdf, or .txt file with valid attachment.
With these types of mail, channel throw error and do not process it. But my requirement is to separate the valid attachment and process it and delete it from mail box.
What our channel is doing is it skips these kind of mails and only change the status from unread to read.
Regards
JitenderHi Jean ,
I got the same issue too, the Scenario is MAIL ->FILE . Mail Sender Adapter picks up the 1 PDF attachment and saves in network folder successfully but not multiple attachments of a mail.
These are the setting in Module configuration I made:
1. The IMAPS was used in Mail Sender Adapter : imaps://10.192.101.16:993/Inbox
*IP address of the Mail Server was got from the Admin )
2. Ports : 143, 993 are opened for the Mail Server to access for XI SERver ( Raised an Ticket to open Ports of Mail server :NZTxxx.dknz.nzcorp.net)
3. As the attachment was only in PDF : Added swapbean in Module tab as below :
Process Sequesnce :
-Make sure: AF_Modules/PayloadSwapBean Modul key : TRANSFORM is added before sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean
-And under Module Configuration select : TRANSFORM as Module Key and add >
swap.keyName Content-Disposition
swap.keyName Content-Description
swap.keyValue attachment;filename='MailAttachment-1.pdf"
swap.keyValue MailAttachment-1
-IF you get to know how to fetch multiple attachment , Please update.
Thanks,
Vara -
Multiple attachment in sender mail adapter with PI 7.11
Hello all,
I've got a scenario MAIL -> PI -> MAIL.
In my sender adapter mail, i have two attachment.
From what i've saw on different thread, it wasn't possible to handle this case in standard with PI 7.0.
Is it possible now with PI 7.11 ? Or must i develop a specific module for that ?
Thank you.Hi Jean ,
I got the same issue too, the Scenario is MAIL ->FILE . Mail Sender Adapter picks up the 1 PDF attachment and saves in network folder successfully but not multiple attachments of a mail.
These are the setting in Module configuration I made:
1. The IMAPS was used in Mail Sender Adapter : imaps://10.192.101.16:993/Inbox
*IP address of the Mail Server was got from the Admin )
2. Ports : 143, 993 are opened for the Mail Server to access for XI SERver ( Raised an Ticket to open Ports of Mail server :NZTxxx.dknz.nzcorp.net)
3. As the attachment was only in PDF : Added swapbean in Module tab as below :
Process Sequesnce :
-Make sure: AF_Modules/PayloadSwapBean Modul key : TRANSFORM is added before sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean
-And under Module Configuration select : TRANSFORM as Module Key and add >
swap.keyName Content-Disposition
swap.keyName Content-Description
swap.keyValue attachment;filename='MailAttachment-1.pdf"
swap.keyValue MailAttachment-1
-IF you get to know how to fetch multiple attachment , Please update.
Thanks,
Vara -
Attachment Content When sending PDF attachment in Send Mail Step
Hi all ,
I am sending a PDF document which is on the file system using "send_mil" step . It is not executing the send_mil step with out entering anything in the Attachment Content. If i enter some thing , the Send_mil step is executed but the PDF is not opening in the received mil as it is not Properly decoded.
Regards,
Deepthi lakshmi.AHi,
Attachment Content is not Mandatory to enter unless you wish to override the Attachment Property.
Basically we use this content along with Encoded Image Property like chart, spc and image loader action block.
If you are loading file from system using Proper path in Attachment Section then no need to use Attachment Content section.
Ensure that you have set the Attachment Content Type to "application/pdf" to send pdf files and a valid File path in Attachment section.
Hope this helps!!
Regards,
Adarsh -
READ PDF ATTACHMENT FROM SAP INBOX
Hi all,
can any one tell me the FM's used to read the pdf attachment from the sap inbox.
Thanks& Regards,
Arun.Hi Arun
See this [PDF|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/2c678dc3-0401-0010-3c80-8ef48f450491] of SCN
Regards
S@chin
Maybe you are looking for
-
How to set which E-Mail gets used on a group
I use groups to send specfic E-Mails to specific people. I have two diferent groups with the same people on it, but the E-Mail should be sent to diferent adresses (ex. Home, or Work). Since Lion, I can't define anymore in the Group "Home" which E-Mai
-
How do I sync notes from mac to ipad?
I have iCloud turned on for both devices as far as I can tell. Notes will sync from my iPad to the mac, but not from my mac to the iPad. How do I make it sync both ways? I have iPad2 with updated software and iMac with mountain lion. Thanks in adva
-
After 10.5.5 update, MacBook Pro LCD not working.
After I updated to 10.5.5 my MacBook Pro worked fine, until I put it to sleep. Now, the screen won't come back on even after restarting and removing the battery. Also, I can't even get an external monitor to work. I can hear the volume idicator sound
-
Import data without opening explorer built in Import visual button
Hi How can I Import data without opening explorer. If I add Import button visual and click on it automatically opens explorer to chose exported file. But I already know location and name of exported file so I don't want that explorer to appear. How
-
What is the red block on left of Materialized View in SQL Object Browser
Hi In APEX 4.0 i have a few Materialized Views - all work fine, but when I view them in the SQL Workshop Object Browser, a little red block appears on the left hand side of the MV name. I'm curious to know what this might mean. Thanks Mike