Body and Attachment both in a mail
Hi,
I am working to send a mail from XI. My present scenarion is like this: I am using xslt mapping to generate code for a html page using source and using dumy target. Now I am using module adapter "localejbs/AF_Modules/MessageTransformBean" for getting attachments. I am able to get the attachment if i check "Keep Attachment" check box or else I am able to see the html pagein body of mail.
Here I am getting either body or attchment. Is there any way to get both body and attachment?
Thanks.
I am not using any adapter module method,
I am trying to use these statements:
<b>3.2.4 Sending a Mail with Attachment</b>
If you want to send a mail with a body and attachment, or with several attachments, the
message sender has to provide an XI message with additional attachments. For each
additional payload of the XI message, the mail adapter creates an attachment for the
mail. To enable this feature, you select the Keep Attachments checkbox when
configuring the mail adapter. By default, the payload of the message is also sent as an
-8-
attachment. If you do not want the payload to be sent as an attachment, set
ContentDisposition to inline.
If you want to give each attachment a certain name, you can use the swap module. The
swap module changes the main payload.
-- This is not talking about any methods to be implemented.
Thanks,
Similar Messages
-
Sending emails with both body and attachment to multiple recipients
I have a requirement to send email with body and attachment to multiple recipients.
Body of the email is a standard text. It is a proxy-to-mail scenario.
Here is what I've done: (I'm using PI 7.11)
One mapping from Source to Target structure (format of the attachment text file)
Second mapping from Target Structure to Mail Package format.
In the second mapping I'm concatenating the output of first step into "Content" of the Mail Package.
"XIPAYLOAD" is the message protocol used.
The "Keep attachments" option in the Mail adapter allows only to send "Content" as attachment or as body of the email.
How to send an email with both content and text?
The other problem is even with using ASMA, I can't send email to multiple recipients. I can only do CC and TO for 1 person each - a total of 2. Although I can resolve this by creating mailing lists, it is better if this can be addressed in PI.
Thanks for any input you can provide!
Edited by: crazylad on Jan 18, 2012 3:39 PMThank you for your response Mikael.
For the first question, I was able to find the solution in the following blog:
XI Mail Adapter : Dynamically building attachment and message body content using a simple UDF
(I just needed to search with the right set of key words )
The key is to set the "Content Encoding" as "None" in the mail adapter. If this is not done, the mail will be sent with an attachment - untitled.bin containing both the mail body and the attachment text. Also, don't forget to check the "Keep Attachments" checkbox in the mail adapter.
Multiple recipients could be added by separating the email IDs with a Comma. I have used ASMA to set the recipients. -
Receiver Mail Adapter - Body and Attachment
Hello All,
Based on the document How to Use the Mail Adapter of the XI 3.0 J2EE Adapter Engine section 3.2.4 says that the payload of the message is sent as the body and an attachment when the Keep Attachments checkbox is configured. By default, the payload of the message is also sent as an attachment.
In testing this feature - if it is checked I get the attachment - if it is not checked I get the payload in the body of the email. I do not get both.
I am using an xslt mapping.
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" xmlns:ns0="urn:sap-com:document:sap:rfc:functions" xmlns:ns="http://sap.com/xi/XI/Mail/30">
<xsl:output method="xml" encoding="utf-8" indent="no" omit-xml-declaration="yes"/>
<xsl:template match="/">
<xsl:apply-templates select="ORDERS02"/>
</xsl:template>
<xsl:template match="ORDERS02">
<ns:Mail>
<Subject>
<xsl:text>Sample Purchase Order: </xsl:text>
<xsl:value-of select="IDOC/E1EDK01/BELNR"/>
</Subject>
<From>
<xsl:text>mail@Com</xsl:text>
</From>
<To>
<xsl:text>mail@com</xsl:text>
</To>
<Content_Type>text/plain; charset="ISO-8859-1"</Content_Type>
<Content_Disposition>attachment; filename="order.dc"</Content_Disposition>
<Content>
<xsl:text> </xsl:text>
<xsl:value-of select="IDOC/E1EDK01/BELNR"/>
<xsl:text>A </xsl:text>
<xsl:text>ORD 238 </xsl:text>
<xsl:text>
</xsl:text>
<xsl:apply-templates select="IDOC/E1EDP01"/>
<xsl:text> </xsl:text>
</Content>
</ns:Mail>
</xsl:template>
<xsl:template match="IDOC/E1EDP01">
<xsl:value-of select="concat(' ',/ORDERS02/IDOC/E1EDK01/BELNR)"/>
<xsl:text>Z</xsl:text>
<xsl:value-of select="substring(concat(E1EDP19[QUALF=002]/IDTNR,' '),1,7)"/>
<xsl:value-of select="format-number(number(MENGE),'00000')"/>
<xsl:text> </xsl:text>
<xsl:text>
</xsl:text>
</xsl:template>
</xsl:stylesheet>Thank you so much for your patience. The mapping works if I do not use the extra content_type tags. Do I need to include the Mime-Version: 1.0....also, notice the
<Content_Type>multipart/mixed; boundary="b1"</Content_Type>
Versus
<Content>--b12 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit My Order --b1
Your example shows use of Content-Type - and the XSLT sample shows <Content_Type> Do you know what the correct format is to use?.
I changed my xsl per your instructions.
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:output method="xml" encoding="utf-8" indent="yes" omit-xml-declaration="yes"/>
<xsl:template match="/">
<xsl:apply-templates select="ORDERS02"/>
</xsl:template>
<xsl:template match="ORDERS02">
<ns:Mail xmlns:ns="http://sap.com/xi/XI/Mail/30">
<Subject>
<xsl:text>Purchase Order: </xsl:text>
</Subject>
<From>
<xsl:text>mail@com</xsl:text>
</From>
<To>
<xsl:text>mail@com</xsl:text>
</To>
<Content_Type>
<xsl:text>multipart/mixed; boundary="b1"</xsl:text>
</Content_Type>
<Content><xsl:text>--b12
</xsl:text>
<xsl:text>
</xsl:text>
<xsl:text>Content-Type: text/plain; charset=us-ascii </xsl:text>
<xsl:text>
</xsl:text>
<xsl:text>Content-Transfer-Encoding: 7bit </xsl:text>
<xsl:text>
</xsl:text>
<xsl:text>My Order</xsl:text>
<xsl:text>
</xsl:text>
<xsl:text>--b1</xsl:text>
<xsl:text>
</xsl:text>
<xsl:text>Content-Type: text/plain; charset=us-ascii</xsl:text>
<xsl:text>
</xsl:text>
<xsl:text>Content-Transfer-Encoding: 7bit</xsl:text>
<xsl:text>
</xsl:text>
<xsl:text>Content-Disposition: attachment; filename="order.dc"</xsl:text>
<xsl:text>
</xsl:text>
<xsl:text> </xsl:text>
<xsl:value-of select="IDOC/E1EDK01/BELNR"/>
<xsl:text>A </xsl:text>
<xsl:text>ORD 238 </xsl:text>
<xsl:text>
</xsl:text>
<xsl:text> </xsl:text>
<xsl:value-of select="IDOC/E1EDK01/BELNR"/>
<xsl:text>B</xsl:text>
<xsl:text>The Wolf Organization </xsl:text>
<xsl:text>
</xsl:text>
<xsl:text> </xsl:text>
<xsl:value-of select="IDOC/E1EDK01/BELNR"/>
<xsl:text>C</xsl:text>
<xsl:text>PO Box 2044 </xsl:text>
<xsl:text>
</xsl:text>
<xsl:text> </xsl:text>
<xsl:text>D</xsl:text>
<xsl:text>York, PA 17404-2044 </xsl:text>
<xsl:text>
</xsl:text>
<xsl:text> </xsl:text>
<xsl:value-of select="IDOC/E1EDK01/BELNR"/>
<xsl:text>E</xsl:text>
<xsl:text>
</xsl:text>
<xsl:text> </xsl:text>
<xsl:value-of select="IDOC/E1EDK01/BELNR"/>
<xsl:text>F</xsl:text>
<xsl:text>
</xsl:text>
<xsl:text> </xsl:text>
<xsl:value-of select="IDOC/E1EDK01/BELNR"/>
<xsl:text>G</xsl:text>
<xsl:text>
</xsl:text>
<xsl:apply-templates select="IDOC/E1EDP01"/>
<xsl:text> </xsl:text>
</Content>
<xsl:text>--b1--</xsl:text>
</ns:Mail>
</xsl:template>
<xsl:template match="IDOC/E1EDP01">
<xsl:text>Z</xsl:text>
<xsl:text> </xsl:text>
<xsl:text>
</xsl:text>
</xsl:template>
</xsl:stylesheet>
Now my results look like this:
- <ns:Mail xmlns:ns="http://sap.com/xi/XI/Mail/30">
<Subject>Purchase Order:</Subject>
<From>mail@com</From>
<To>mail@com</To>
<Content_Type>multipart/mixed; boundary="b1"</Content_Type>
<Content>--b12 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit My Order --b1 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="order.dc" 4500000185A ORD 238 4500000185BThe Wolf Organization 4500000185CPO Box 2044 DYork, PA 17404-2044 4500000185E 4500000185F 4500000185G Z Z</Content>
--b1--
</ns:Mail>
And the error is still:
Following error occurred while executing the application:
java.lang.IllegalArgumentException: can't parse argument number http://sap.com/xi/XI/Mail/30
Display Stack Trace
Stack trace for the above error message is:
java.lang.IllegalArgumentException: can't parse argument number http://sap.com/xi/XI/Mail/30
at java.text.MessageFormat.makeFormat(MessageFormat.java:1323)
at java.text.MessageFormat.applyPattern(MessageFormat.java:447)
at java.text.MessageFormat.(MessageFormat.java:347)
at java.text.MessageFormat.format(MessageFormat.java:800)
at jsp_auditlog1160053386093._jspService(jsp_auditlog1160053386093.java:274)
at com.sap.engine.services.servlets_jsp.server.jsp.JspBase.service(JspBase.java:112)
at com.sap.engine.services.servlets_jsp.server.servlet.JSPServlet.service(JSPServlet.java:544)
at com.sap.engine.services.servlets_jsp.server.servlet.JSPServlet.service(JSPServlet.java:186)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.runtime.RequestDispatcherImpl.doWork(RequestDispatcherImpl.java:316)
at com.sap.engine.services.servlets_jsp.server.runtime.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:372)
at com.sapportals.htmlb.page.PageProcessorServlet.handleRequest(PageProcessorServlet.java:68)
at com.sapportals.htmlb.page.PageProcessorServlet.doGet(PageProcessorServlet.java:29)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170) -
Send a mail with a body and attachment
Hi guys!!!!
I have a RFC -> XI -> Mail Scenario!
I'm able to send text in the body of the mail. I'm able to send text as an attachment. But I'd like to send both (text in the body and other text as an attachment). How can I do this?
thanks in advance
JulioFirst, I'd like to thank all the replies! And Jagesh, I solved my problem reading the thread you told me.
I created a message as follow:
<?xml version="1.0" encoding="UTF-8"?>
<ns:Mail xmlns:ns="http://sap.com/xi/XI/Mail/30">
<Subject>test</Subject>
<From>test_source @ abc.com</From>
<To>test_target @ abc.com</To>
<Content_Type>multipart/mixed; boundary="AaBb--984dfgeSSd3532"</Content_Type>
<Content>*AaBb984dfgeSSd3532*
Content-Type: text/plain
Hello, this is sample data.
*AaBb984dfgeSSd3532*
Content-Type: text/plain;name="CSV_data.csv"
abc
</Content>
</ns:Mail>
In addittion to this, I configured Mail channel as follow:
Content encondig = none
Keep Attachments = false -
Character- and attachement problems by E-Mail recipients
After upgrading to OSX Tiger and using Mail, I am experiencing problems by some of our customers using MS Outlook.The Danish characters ÆØÅ (æøå) are transformed into hieroglyphs, making the message look rather silly, if not unreadable. Also some of them can't locate (JPEG) attachements in the E-mail - they appear as picture in the mail, but can't be saved as files. The problem is only concerning JPEG-files - PDF's and ZIP's work allright. Other MAC- and PC users have none of the problems.
Any proposals?
G5 Power Mac Mac OS X (10.4.4)This is an Outlook problem (especially if other Mac and PC/Windoze users have none of these problems) and I believe it may depend on the Outlook version the recipient is using.
Sounds like you are using RTF for message composition and if so, try using Plain Text instead. -
Mail Adapter Use Mail Package, Mail Body and Attachment
Hello
Have some body a idea, how I can configure the mail adapter with use mail package, that I have in the mail a attachment with content from the messages and a mail body with also text from the message.
Thanks for your reply.
Regards Tom
The different Weblog , I have check:
/people/prasad.ulagappan2/blog/2005/06/07/mail-adapter-scenarios-150-sap-exchange-infrastructure
https://www.sdn.sap.com/sdn/weblogs.sdn?blog=/pub/wlg/1685 [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken]
/people/michal.krawczyk2/blog/2005/03/07/mail-adapter-xi--how-to-implement-dynamic-mail-addressHi Thomas,
If you are configuring your Mail adapter as reciever then refer
http://help.sap.com/saphelp_nw04/helpdata/en/6b/4493404f673028e10000000a1550b0/content.htm
your sender (say file) should have some message like this
<i>
<ml:Mail xmlns:ml=http://sap.com/xi/XI/Mail/30>
<Subject>Important</Subject>
<From>[email protected]</From>
<To>[email protected]</To>
<X_Mailer>Outlook Express </X_Mailer>
<Content>
This is the content.
</Content>
</ml:Mail></i>
And for Sender Mail Adpater
http://help.sap.com/saphelp_nw04/helpdata/en/23/c093409c663228e10000000a1550b0/content.htm
Hope this will be helpful
Regards
Suraj -
Mail workflow with variable recipient, subject, body and attachment
Here's what I'm trying to solve:
I do some payroll processing with Direct Deposit. A PDF file is created for each person's check stub, which I then e-mail to the person. Right now I have Excel generate a mailto: link which addresses the messages, inserts the subject and a brief note in the body. I then manually attach the PDF file and send.
I'd like to be able to have a single workflow that I can drop the PDF file onto and have it mailed to the intended recipient. The filename can be setup to include any necessary info as it is generated by a very extensive VB script in Excel.
But I can't figure out getting the variable items in to Automator.
Thanks for any insight.
TimI was able to find a commercial product that works very well. MaxBulk Mailer from Max Programming allows you to import a list of recipients, merge with personalized message and designate an attachment (just image types and PDFs, not all types work) and send.
-
Report by email with whole report as body and attached file
Hello,
I try to send my Reports by mail and have to attach a file to the report.
But this filename is't a static one. Is there a work-around to attach a dynamic file to my e-mail.
Here is a part of my destination.xml file:
<foreach>
<mail id="DEST1" to="&<address>" subject="&<subject>">
<body srcType="report" format="html">
<include src="mainSection"/>
</body>
<attach srcType="file">
<include src="/coup_cache/&<filename>"/>
</attach>
</mail>
</foreach>Is it possible to create my own xml tag to solve this problem?
something like <myAttach file="xyz"/>
and something build up the necessary tag.
<attach srcType="file">
<include src="xyz"/>
</attach>
I don't know much about xml. I read something about xsl to do that?
Any ideas?
looking forward to read your hints
Avis -
IOS 8 and attaching several pictures in mail
With IOS 8 all pictures attached in a mail from Iphone get the same name (FullSizeRender) instead of as before when the got names like Bild 1, Bild2. (Swedish = Picture1, Picture2 etc.) = different names enabling saving all pictures in one go from mail.
I have the same issue after iOS 8 update . Furthermore, geographical location (Geotag) data is removed from such a picture. Whether I send it by iMessage, email or Stratospherix FileBrowser app – all the geographical info is gone. All but Filebrowser also use this Fullsizerender filename instead of actual file name.
Curiously enough, it is only happening with my iPhone 5. My IPad mini and iPhone 4s seem to work as expected.
I erased my iPhone 5 and it started working fine i.e using correct filenames and geo info for photos when sending by imessage or email.
But as soon as I restored from backup – this problem came back.
what's the mystery here? -
How to email purchase order along with body and subject line
hi experts,
i have to email the purchase order along with the body and subject line. I am able to send the purchase order as a pdf attachment, but i have still not got a solution how to add body and subject line to this mail.
plz help me out.Hi Santosh,
if you investigate a little bit the PO output, you can find following information in SRM output customizing:
POs are edited by methode PROCESS_BBP_PO_MAI from class CL_PD_PO_PROCESSING_BBP.
Subject, body and attachments are handled here.
So create your own class and method, and assign them in this customizing point (SRM Server --> Cross-Application Basic Settings --> Set Output Actions and Output Format --> Define Actions for Purchase Order Output).
Rgds
Christophe
PS: please reward points for helpfull answers -
Receiver mailadapter with mailpackage and attachment
Hi there!!
My scenario is as folows:
I send via ABAP proxy an application XML and add additional plain text attachment to this. At the receiver side I use receiver mailadapter with mail-package. With my interface mapping I map application XML to mailpackage and use content-type text/HTML. I checked checkbox in adapter "keep attachments".
Result is that the mail i receive contains 2 attachments (1 HTML file and 1 .txt file). However the main body of the e-mail contains the content of the plain text file. I want to have the content of the html to be the main body of the mail. I already tried to use payload swap been however without succes because it seems that in the adapter module chain when reaching the actual mail module: sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean the main payload is switched to the plain text attachment. Also changing the sequence in the module chain did not work.
Any suggestions?
Cheers,
EmileWhen you want to use mail package to create an email with attachment, the whole email, body and attachment must be inside the tag content_type.
Like in this blog:
/people/stefan.grube/blog/2007/04/17/xi-mail-adapter-an-approach-for-sending-emails-with-attachment-with-help-of-java-mapping
In your scenario, you should uncheck the flag "mail package".
Regards
Stefan -
Still failed to read email attachment, both Mail and Enturoge
I can't open email attachments (tif and jpg) after installation of OS X 10.6 by using Mail.
I today installed MS Enturoge but still having same problem as Mail.
Can Apple tell me why? And how to solve this problem?Alex,
Yes, the inbound mail attachment is supported in B2B PS3 (11.1.1.4.0) but you cannot send both attachment and body to a JMS queue simultaneously from B2B. Body will be passed to the JMS queue and attachment will be written to the b2b.attachments.dir (set as B2B property in EM console) -
http://docs.oracle.com/cd/E23943_01/user.1111/e10229/app_isags.htm
Regards,
Anuj -
E-mail with Subject, Body and Attachments
Hi,
I am currently completing a project to create an intranet site for employees.
We need functionality to send email confirmation of a sale to customers. I'm going to start by saying i have zero web design experience and have only been doing this for 3 months heavily using the ribbon with minimal coding. So the situation is:
I have a button that i want employees to be able to click and it opens a new email from outlook with pre-populated body text (which is static and never changes) and 3 attachments also never changing. The employee will then enter the clients email address
and add their name to the email.
I have managed the email and subject no bother. However the body text i want to enter needs to look like this:
"TRAVEL INSURANCE
I confirm cover is in place.
If you need any assistance whilst abroad call: 0800 000 000 for 24 hour assistance or contact our claims department on:
0800 000 000. This office can be contacted on: 0800 000 000
asking for extension number:XXXX to speak to myself.
Yours Sincerely
XXXXXXXXXXXX
Travel Adviser
Please Note: This e-mail was sent from a notification-only email address that cannot accept incoming e-mail. Please do not reply to this message."
I've managed to get some of the body text in but no formatting. I've managed line breaks using %0D%0A but if i add a double break to get a clear line there doesn't seem to be enough room and it begins to lose the body text.
Thats issue 1.
Issue 2 is how you manage to attach files. Everything i look at says you need to do your own piece of coding which is far beyond my capability for this project!
Any help would be fantastic.
this is my code so far:
[email protected]?subject=Travel%20Confirmation%20Email&body=TRAVEL INSURANCE%0D%0A%0D%0AI confirm cover is in place.%0D%0AIf you are in need of any assistance whilst you are abroad please contact our 24 hour emergency
helpline on: (0000) 000 000 or the claims department on: 00000 000 000. If I can be of any further assistance, please contact our office on 0000 000 0000, extension number: XXXX.%0D%0AThank you for insuring with us.%0D%0AYours sincerely%0D%0AYOUR NAME%0D%0ATravel
Advisor
Thanks,
KHi,
According to your description, you might want to let users be able to send email with attachments.
As you might prefer a codeless solution, I would suggest you create a
SharePoint Designer workflow to achieve it.
A solution can be like this:
1. Create a list “ListA” for storing the three attachments which you want to add into your email, it will be referenced in the workflow;
2. Another list “ListB” with two columns “ClientEmailAddress” and “ClientNames”, it will be used to collect user input and sent to the workflow;
3. Create a SharePoint Designer workflow and attach to the “ListB”, set the workflow to be started when there is new item added in the current list.
By doing this, users can simply add a new item in “ListB” with two columns filled, an email will be sent out as you required.
In SharePoint Designer workflow, we can send email contains predefined format easily with the available workflow action in SharePoint Designer.
About how to
send email in SharePoint Designer workflow:
https://support.office.com/en-us/article/Send-e-mail-in-a-workflow-11d5f9dd-955f-412c-b70f-cde4214204f4
http://www.mpspartners.com/2012/05/spdesigner2010workflowsendingemailstomultipleusersfromasinglepeoplepickerfield/
To be able to
send email with attachments, you would like to install this solution in your environment, it provides a useful custom workflow action you will need:
http://sharepointstuff.codeplex.com/releases/view/66258
Best regards,
Patrick
Patrick Liang
TechNet Community Support -
Mail sending with subject and attachment
hai all,
my requiremnet is i want to send a mail with a body and pdf attachemnt , but with the below code iam able to send both as attachment , but how to send along with body.
*& Report ZV_TEST *
Report ZV_TEST no standard Page heading line-size 200.
Tables: Pa0105,
pernr,
QPPNP,
HRPY_RGDIR,
SSCRFIELDS,
pa0002.
Constants
constants:
begin of F__LTYPE, "type of line
CMD like PC408-LTYPE value '/:', "command
TXT like PC408-LTYPE value 's', "textline
end of F__LTYPE.
constants:
begin of F__CMD, "commands
NEWPAGE like PC408-LINDA value '<NEW-PAGE>',
end of F__CMD.
CONSTANTS: c_dev LIKE sy-sysid VALUE 'DEV',
c_no(1) TYPE c VALUE ' ',
c_device(4) TYPE c VALUE 'LOCL'.
Data Declaration
DATA:Begin of Itab occurs 0,
pernr like HRPY_RGDIR-PERNR,
SEQNR like HRPY_RGDIR-SEQNR,
PAYSLIP_VARIANT like BAPI7004-PAYSLIP_VARIANT,
end of itab.
data: P_INFO like PC407,
P_INFO1 like PC407,
P_FORM like PC408 occurs 0 with header line,
P_P_FORM like PC408 occurs 0 with header line,
RETURN like BAPIRETURN1 occurs 0 with header line,
PAY_VAR like BAPI7004-PAYSLIP_VARIANT value 'ESS_PAYSLIPS' ,
P_LIST like ABAPLIST occurs 1 with header line,
P_IDX type I.
data: begin of P_INDEX occurs 0,
INDEX type I,
end of P_INDEX.
data: OBJBIN like SOLISTI1 occurs 10 with header line,
DOCDATA like SODOCCHGI1,
OBJTXT like SOLISTI1 occurs 10 with header line,
OBJPACK like SOPCKLSTI1 occurs 1 with header line,
RECLIST like SOMLRECI1 occurs 1 with header line,
OBJHEAD like SOLISTI1 occurs 1 with header line,
TAB_LINES type I,
ATT_TYPE like SOODK-OBJTP.
data: PDF_TAB like TBL1024 occurs 0 with header line,
OTF_TAB like TBL1024 occurs 0 with header line.
Spool IDs
TYPES: BEGIN OF t_tbtcp.
INCLUDE STRUCTURE tbtcp.
TYPES: END OF t_tbtcp.
DATA: it_tbtcp TYPE STANDARD TABLE OF t_tbtcp INITIAL SIZE 0,
wa_tbtcp TYPE t_tbtcp.
Job Runtime Parameters
DATA: gd_eventid LIKE tbtcm-eventid,
gd_eventparm LIKE tbtcm-eventparm,
gd_external_program_active LIKE tbtcm-xpgactive,
gd_jobcount LIKE tbtcm-jobcount,
gd_jobname LIKE tbtcm-jobname,
gd_stepcount LIKE tbtcm-stepcount,
gd_error TYPE sy-subrc,
gd_reciever TYPE sy-subrc.
Spool to PDF conversions
DATA: gd_spool_nr LIKE tsp01-rqident,
gd_destination LIKE rlgrap-filename,
gd_bytecount LIKE tst01-dsize,
gd_buffer TYPE string.
Binary store for PDF
DATA: BEGIN OF it_pdf_output OCCURS 0.
INCLUDE STRUCTURE tline.
DATA: END OF it_pdf_output.
DATA: w_recsize TYPE i.
DATA: gd_subject LIKE sodocchgi1-obj_descr,
it_mess_bod LIKE solisti1 OCCURS 0 WITH HEADER LINE,
it_mess_att LIKE solisti1 OCCURS 0 WITH HEADER LINE,
gd_sender_type LIKE soextreci1-adr_typ,
gd_attachment_desc TYPE so_obj_nam,
gd_attachment_name TYPE so_obj_des.
data: PDF_CONTENT TYPE XSTRING,
PDF_FSIZE TYPE I.
data: error TYPE sysubrc.
DATA: v_dest LIKE tsp01-rqdest,
v_handle LIKE sy-tabix,
v_spool_id LIKE tsp01-rqident,
v_rc TYPE c,
v_errmessage(100) TYPE c,
v_text(70) TYPE c.
data: PAYSLIP LIKE BAPI7004_PAYSLIP occurs 0 with header line.
Data: v_index like sy-index value 1.
Data: Begin of I_Sent occurs 0,
pernr like pernr-pernr,
name(20),
usrid_long like pa0105-usrid_long,
Status(3),
End of I_sent.
Data: Begin of I_NSent occurs 0,
pernr like pernr-pernr,
usrid_long like pa0105-usrid_long,
End of I_Nsent.
DATA: I_FCODE TYPE TABLE OF sy-ucomm.
data: v_text1(255),
v_text2(255),
v_text3(255).
data: month_names like T247 occurs 0 with header line,
v_month(2) type c.
***********************Selection Screen********************
selection-screen Begin of Block b2 WITH FRAME TITLE TEXT-BL1 .
Parameters: P_Print type c default 'X' radiobutton group g1
user-command CMD,
P_DISP Type C Radiobutton Group g1.
Selection-screen end of Block b2.
selection-screen Begin of Block b1 WITH FRAME TITLE TEXT-BL2 .
Recipient address and Period
SELECT-OPTIONS : s_name FOR PERNR-PERNR Modif id M1,
s_period for HRPY_RGDIR-FPPER Modif id M1.
s_year for QPPNP-PABRJ Modif id M1.
SELECT-OPTIONS: p_num FOR PERNR-PERNR Modif id M2 .
Selection-screen end of Block b1.
*SELECTION-SCREEN FUNCTION KEY 1.
*SELECTION-SCREEN PUSHBUTTON /10(20) CHARLY USER-COMMAND ABCD.
***********************At Selection Screen Output**************
at selection-screen output.
Loop at screen.
if P_Print = 'X'.
if screen-group1 = 'M2'.
screen-active = 0.
endif.
else.
if screen-group1 = 'M1'.
if screen-name = 'S_NAME-LOW' Or screen-name = 'S_PERIOD'.
screen-active = 1.
endif.
Endif.
Modify Screen.
Endloop.
***********************INITIALIZATION********************
INITIALIZATION.
MOVE 'Preview' TO SSCRFIELDS-FUNCTXT_01.
MOVE 'Preview' TO CHARLY.
p_print = 'X'.
v_text1 =
'Please find enclosed your salary slip for the month of Apr 2006 as
*attachment. This is confidential '.
***********************AT SELECTION-SCREEN******************
AT SELECTION-SCREEN.
if p_print = 'X'.
if s_name[] is initial.
message e000(8i) with 'Make Entry into Personal Number Field'.
endif.
else.
if p_num[] is initial.
message e000(8i) with 'Make Entry into Personal Number Field'.
endif.
endif.
***********************Start-of-Selection********************
Start-of-Selection.
if p_print = 'X'.
APPEND 'NEXT' TO i_fcode.
APPEND 'PREV' TO i_fcode.
set pf-status 'ZHRF' excluding I_FCODE.
Perform Get_values.
Perform Print using v_index.
perform Write_Values.
else.
set pf-status 'ZHRF'.
Perform Get_values.
Perform Print using v_index.
endif.
***********************Top-of-page***************************
Top-of-page.
skip 2.
if p_print = 'X'.
write:50 'The Pay Slip Sent details'.
skip 1.
uline at 1(70).
write :/ sy-vline,2 'Personal Number',18 sy-vline,
19 'Name',40 sy-vline,
41 'User Mail-Ids',63 sy-vline,
64 'Status',70 sy-vline.
ULINE /1(70).
endif.
set left scroll-boundary Column 0.
*& Form Get_values
text
--> p1 text
<-- p2 text
FORM Get_values .
select *
from HRPY_RGDIR
into corresponding fields of table itab
where PERNR in s_name
AND
FPPER IN S_PERIOD.
if sy-subrc eq 0.
loop at itab.
Create receiver list
refresh RECLIST.
clear RECLIST.
select single *
from PA0105
where PERNR eq ITAB-PERNR
and USRTY eq '0010'.
if SY-SUBRC <> 0.
I_sent-PERNR = ITAB-PERNR.
i_sent-status = 'NO'.
select single *
from pa0002
where pernr eq itab-pernr.
concatenate pa0002-VORNA pa0002-NACHN into i_sent-name
separated by space.
append i_Nsent.
continue.
else.
refresh reclist.
RECLIST-RECEIVER = pa0105-usrid_long.
translate RECLIST-RECEIVER to lower case.
RECLIST-REC_TYPE = 'U'.
append RECLIST.
endif.
call function 'GET_PAYSLIP'
EXPORTING
EMPLOYEE_NUMBER = itab-PERNR
SEQUENCE_NUMBER = itab-SEQNR
PAYSLIP_VARIANT = PAY_VAR
IMPORTING
RETURN = RETURN
P_INFO = P_INFO
TABLES
P_FORM = P_FORM.
loop at P_FORM
where LINDA eq F__CMD-NEWPAGE
and LTYPE eq F__LTYPE-CMD.
P_INDEX-INDEX = SY-TABIX.
append P_INDEX.
endloop.
P_IDX = 1.
refresh P_P_FORM.
append lines of P_FORM from P_IDX to P_INDEX-INDEX
to P_P_FORM.
P_IDX = P_INDEX-INDEX.
export P_P_FORM to memory id '%%_P_FORM_%%'.
export P_INFO to memory id '%%_P_INFO_%%'.
submit RPCEDT_LIST_TO_MEMORY exporting list to memory and return.
call function 'LIST_FROM_MEMORY'
TABLES
LISTOBJECT = P_LIST.
call function 'TABLE_COMPRESS'
TABLES
IN = P_LIST
OUT = OBJBIN
EXCEPTIONS
others = 1.
Read table RECLIST index 1.
I_sent-PERNR = ITAB-PERNR.
i_sent-usrid_long = RECLIST-RECEIVER.
select single *
from pa0002
where pernr eq itab-pernr.
concatenate pa0002-VORNA pa0002-NACHN into i_sent-name
separated by space.
i_sent-status = 'YES'.
append i_sent.
concatenate ' Payslip-' '(' ITAB-PERNR+4(4) ')'
into DOCDATA-OBJ_DESCR.
CALL FUNCTION 'MONTH_NAMES_GET'
EXPORTING
LANGUAGE = SY-LANGU
TABLES
MONTH_NAMES = month_names
EXCEPTIONS
MONTH_NAMES_NOT_FOUND = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
if sy-datum+4(2) = '01'.
v_month = '12'.
else.
v_month = sy-datum+4(2) - 1.
endif.
read table month_names with key mnr = v_month.
concatenate 'Salary Slip for the month of' month_names-LTX
sy-datum+0(4) '-' i_sent-name
into DOCDATA-OBJ_DESCR.
DOCDATA-OBJ_NAME = 'Pay Slip'.
DOCDATA-OBJ_LANGU = SY-LANGU.
OBJTXT = 'Dear Mr.'.
concatenate OBJTXT i_sent-name into objtxt.
append OBJTXT.
append initial line to objtxt.
OBJTXT = 'Please find enclosed your salary slip for the month of'.
concatenate OBJTXT month_names-LTX sy-datum+0(4)
into objtxt separated by space.
append OBJTXT.
OBJTXT =
'as attachment This is confidential document and not be disclosed'.
append OBJTXT.
OBJTXT =
'shared with any other employee.In case of any queries on this subject'.
append OBJTXT.
OBJTXT =
'you are requested to contact the Payroll administrator Sabitha '.
OBJTXT = 'email:[email protected]'.
append OBJTXT.
append initial line to objtxt.
append initial line to objtxt.
OBJTXT = 'With Kind Regards'.
append OBJTXT.
append initial line to objtxt.
append initial line to objtxt.
OBJTXT = 'Sabitha'.
append OBJTXT.
OBJTXT = 'Payroll Administrator'.
append OBJTXT.
OBJTXT = 'Enteg Infotech Pvt Lyd.'.
append OBJTXT.
OBJTXT = 'Banaglore'.
append OBJTXT.
Write Packing List (Main)
describe table objtxt.
read table OBJTXT index sy-tfill.
DOCDATA-DOC_SIZE = ( sy-tfill - 1 ) * 255 + strlen( OBJTXT ).
clear OBJPACK-TRANSF_BIN.
OBJPACK-HEAD_START = 1.
OBJPACK-HEAD_NUM = 0.
OBJPACK-BODY_START = 1.
OBJPACK-BODY_NUM = sy-tfill.
OBJPACK-DOC_TYPE = 'TXT'.
append OBJPACK.
Create Message Attachment
Write Packing List (Attachment)
ATT_TYPE = 'ALI'.
describe table OBJBIN lines TAB_LINES.
read table OBJBIN index TAB_LINES.
OBJPACK-DOC_SIZE =
( TAB_LINES - 1 ) * 255 + strlen( OBJBIN ).
OBJPACK-TRANSF_BIN = 'X'.
OBJPACK-HEAD_START = 1.
OBJPACK-HEAD_NUM = 0.
OBJPACK-BODY_START = 1.
OBJPACK-BODY_NUM = TAB_LINES.
OBJPACK-DOC_TYPE = ATT_TYPE.
OBJPACK-OBJ_NAME = 'ATTACHMENT'.
OBJPACK-OBJ_DESCR = 'Payslip'.
append OBJPACK.
Send the document
call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
DOCUMENT_DATA = DOCDATA
PUT_IN_OUTBOX = ''
COMMIT_WORK = '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 = 8.
endloop.
endif.
ENDFORM. " Get_values
*****************************At User Command*************************
at User-Command.
case Sy-ucomm.
When 'NEXT'.
describe table itab.
if sy-tfill GT v_index.
v_index = v_index + 1.
Perform Print using v_index.
else.
message E000(8i) with 'You Have Reached the Last Entry'.
endif.
When 'PREV'.
if v_index LE 1.
Message E000(8i) with 'You Have Reached the First Entry'.
else.
v_index = v_index - 1.
Perform Print using v_index.
endif.
When 'BACK'.
leave to screen 0.
WHen 'EXIT'.
set Screen 0.
leave screen.
Endcase.
*& Form Print
text
--> p1 text
<-- p2 text
FORM Print using v_index.
if v_index = 1.
select *
from HRPY_RGDIR
into corresponding fields of table itab
where PERNR in P_num
endif.
if not itab[] is initial.
sort itab by pernr .
read table itab index v_index.
select single *
from PA0105
where PERNR eq ITAB-PERNR
and USRTY eq '0010'.
call function 'GET_PAYSLIP'
EXPORTING
EMPLOYEE_NUMBER = itab-PERNR
SEQUENCE_NUMBER = itab-SEQNR
PAYSLIP_VARIANT = PAY_VAR
IMPORTING
RETURN = RETURN
P_INFO = P_INFO
TABLES
P_FORM = P_FORM.
loop at P_FORM
where LINDA eq F__CMD-NEWPAGE
and LTYPE eq F__LTYPE-CMD.
P_INDEX-INDEX = SY-TABIX.
append P_INDEX.
endloop.
P_IDX = 1.
refresh P_P_FORM.
append lines of P_FORM from P_IDX to P_INDEX-INDEX
to P_P_FORM.
P_IDX = P_INDEX-INDEX.
export P_P_FORM to memory id '%%_P_FORM_%%'.
export P_INFO to memory id '%%_P_INFO_%%'.
IMPORT P_P_FORM FROM MEMORY ID '%%_P_FORM_%%'.
IMPORT P_INFO FROM MEMORY ID '%%_P_INFO_%%'.
new-page "VKIK008647
line-size p_info-pcols
line-count p_info-psize
no-title
no-heading.
SET BLANK LINES ON.
LOOP AT P_P_FORM.
if sy-tabix lt 20.
NEW-LINE NO-SCROLLING.
endif.
CASE P_P_FORM-LTYPE.
WHEN F__LTYPE-TXT.
WRITE:/ P_P_FORM-LINDA.
WHEN F__LTYPE-CMD.
IF P_P_FORM-LINDA EQ F__CMD-NEWPAGE.
NEW-PAGE.
ENDIF.
WHEN others.
hide: itab,v_index.
WRITE:/ P_P_FORM-LINDA.
if sy-tabix lt 20.
NEW-LINE NO-SCROLLING.
else.
NEW-LINE SCROLLING.
endif.
ENDCASE.
ENDLOOP.
SET BLANK LINES OFF.
v_index = 1.
endif.
ENDFORM. " Print
*& Form Write_Values
text
--> p1 text
<-- p2 text
FORM Write_Values .
if p_print = 'X'.
loop at i_sent.
write :/ sy-vline,2 i_sent-pernr,18 sy-vline,
19 i_sent-name,40 sy-vline,
41 i_sent-usrid_long,63 sy-vline,
64 i_sent-status,70 sy-vline.
ULINE /1(70).
endloop.
endif.
ENDFORM. " Write_Values
i want to send the contents of objtxt has body.
cheersHi,
in the below code, BOLD Characters coming as body text in my mail.after that i am attaching V_LINE as the attachment.pl compare this with ur code.
revert, if you need any clarifications.
<b>*-populate body text</b>
CONCATENATE <b>'Japan BOL details for the Delivery#'
V_VBELN
',is attached'</b> INTO WA_OBJTXT SEPARATED BY SPACE.
APPEND WA_OBJTXT TO IT_OBJTXT.
<b>*---- Append Date and Time into Body of email.</b>
MOVE 'File is generated on'(004) TO V_INFO.
V_TIME = SY-UZEIT.
WRITE : SY-UZEIT TO V_TIME USING EDIT MASK '__:__:__'.
CONCATENATE V_TIME+0(2)
V_TIME+2(2)
V_TIME+4(2)
INTO
V_TIME2 SEPARATED BY ':'.
WRITE : sy-datum MM/DD/YYYY TO lv_date .
CONCATENATE SY-DATUM+4(2)
SY-DATUM+6(2)
SY-DATUM+0(4)
INTO V_DATE.
CONCATENATE <b>V_INFO
V_DATE
'At'
V_TIME2
INTO V_INFO</b> SEPARATED BY SPACE.
<b>WA_OBJTXT = V_INFO.</b> APPEND WA_OBJTXT TO IT_OBJTXT.
*-document size
CLEAR : V_TABLE_LINES.
DESCRIBE TABLE IT_OBJTXT LINES V_TABLE_LINES.
READ TABLE IT_OBJTXT INTO WA_OBJTXT INDEX V_TABLE_LINES.
X_DOC_CHNG-DOC_SIZE =
( V_TABLE_LINES - 1 ) * 255 + STRLEN( WA_OBJTXT ).
*-populate packing list for body text
CLEAR IT_OBJPACK-TRANSF_BIN.
WA_OBJPACK-HEAD_START = 1.
WA_OBJPACK-HEAD_NUM = 0.
WA_OBJPACK-BODY_START = 1.
WA_OBJPACK-BODY_NUM = V_TABLE_LINES.
WA_OBJPACK-DOC_TYPE = 'RAW'.
APPEND WA_OBJPACK TO IT_OBJPACK.
CLEAR WA_OBJPACK.
*--for attachment
*--add Internal table lines here, as attachment.
WA_OBJBIN = V_LINE.
APPEND WA_OBJBIN TO IT_OBJBIN.
CLEAR WA_OBJBIN.
*-get total no.of lines of Object table(attachment)
CLEAR : V_TABLE_LINES.
DESCRIBE TABLE IT_OBJBIN LINES V_TABLE_LINES.
*-populate object header
CONCATENATE 'Delivery#'(005)
V_VBELN
SY-DATUM
V_TIME
INTO
WA_OBJHEAD SEPARATED BY SPACE.
APPEND WA_OBJHEAD TO IT_OBJHEAD.
CLEAR WA_OBJHEAD.
*-packing list for attachment
WA_OBJPACK-TRANSF_BIN = C_X.
WA_OBJPACK-HEAD_START = 1.
WA_OBJPACK-HEAD_NUM = 1.
WA_OBJPACK-BODY_START = 1.
WA_OBJPACK-BODY_NUM = V_TABLE_LINES .
WA_OBJPACK-DOC_TYPE = 'CSV' .
WA_OBJPACK-DOC_TYPE = 'RAW' .
WA_OBJPACK-OBJ_NAME = 'POTR'.
CONCATENATE 'Delivery details for '(005)
CONCATENATE TEXT-005
V_VBELN
SY-DATUM
V_TIME
'.CSV'
INTO
WA_OBJPACK-OBJ_DESCR SEPARATED BY SPACE.
BREAK-POINT.
WA_OBJPACK-DOC_SIZE = V_TABLE_LINES * 255.
APPEND WA_OBJPACK TO IT_OBJPACK.
CLEAR WA_OBJPACK. -
Body and Signature not getting in reciever mail adapter
Hi Friends,
My requirement is the reciever mail adapter having the Attachment and Body and signature.
Here i am getting Attachment only. I am not getting Body( example: the ftp successfully genrated this file abbc_12/03/2014.txt) and Signature.
Signature like
Thanks
company name.
Thanks
BhanuHi Galla,
I have some doubts about your scenario, Is your scenario FTP to MAIL?, do you want to send the file as attachment or you want the file content as mail body or where the body is taken? where is the signature, inside the file?
Meantime, you can check these documents about file-mail scenario:
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a0a27c01-26b0-2c10-bd8a-94498efa7ff6?quicklink=index&overridelayout=true
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/5083371b-5bd2-2e10-3f8b-ad877d24c9ce?QuickLink=index&overridelayout=true&52475910426407
Regards.
Maybe you are looking for
-
How can i get mac app store on my macbook, how can i get mac app store on my macbook
hi i cant downloads applications and games on my macbook and i cant find the mac app store can someone help me and tell me how can i find it or download it thx
-
Certificates in lieu of Oracle connection Manager for our Applets -- Help!!
I support an application named IDEA out of New York. The IDEA application is an INTRANET application for use within our company Firewall. Currently, the IDEA application's front end resides on a Windows 2000 Server running IIS 5 and JRun 3.0. The bac
-
Bluetooth connection IOS 8.1.2 can connect but no audio
Hello, I have a problem with the audio of my Iphone 5s connected to a skoda fabia bluetooth carkit Paring is no problem and playing music from the Iphone works as well, only phonecalls cannot by heared and the caller cannot hear me speaking Tried the
-
Clustering/Session Replication
Hi, I know that's a fairly basic question, but I just want to make sure I am not missing anything here. We have an application which runs on a cluster of WebLogics and the user sometimes is requested to sign in again (it seems like it hit another ins
-
How do i hide url WITHOUT hiding tabs in fullscreen mode (F11)?
Title says it all. I want a fullscreen mode that works exactly like it did in Firefox 4.0.