Regarding mail

how to send the pdf file as an attachment to some other mail......
give me sufficient examples........
fine solution reward with maximum points.........

*& Report ZSEND_PDF_EMAIL
REPORT zsend_pdf_email.
DATA: itcpo LIKE itcpo,
tab_lines LIKE sy-tabix.
Variables for EMAIL functionality
DATA: maildata LIKE sodocchgi1.
DATA: mailpack LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
DATA: mailhead LIKE solisti1 OCCURS 1 WITH HEADER LINE.
DATA: mailbin LIKE solisti1 OCCURS 10 WITH HEADER LINE.
DATA: mailtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE.
DATA: mailrec LIKE somlrec90 OCCURS 0 WITH HEADER LINE.
DATA: solisti1 LIKE solisti1 OCCURS 0 WITH HEADER LINE.
PERFORM send_form_via_email.
FORM SEND_FORM_VIA_EMAIL *
FORM send_form_via_email.
CLEAR: maildata, mailtxt, mailbin, mailpack, mailhead, mailrec.
REFRESH: mailtxt, mailbin, mailpack, mailhead, mailrec.
Creation of the document to be sent File Name
maildata-obj_name = 'TEST'.
Mail Subject
maildata-obj_descr = 'Subject'.
Mail Contents
mailtxt-line = 'Here is your file'.
APPEND mailtxt.
Prepare Packing List
PERFORM prepare_packing_list.
Set recipient - email address here!!!
mailrec-receiver = '[email protected]'.
mailrec-rec_type = 'U'.
APPEND mailrec.
Sending the document
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = maildata
put_in_outbox = 'X'
TABLES
packing_list = mailpack
object_header = mailhead
contents_bin = mailbin
contents_txt = mailtxt
receivers = mailrec
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
operation_no_authorization = 4
OTHERS = 99.
commit work.
ENDFORM. "SEND_FORM_VIA_EMAIL
Form PREPARE_PACKING_LIST
FORM prepare_packing_list.
CLEAR: mailpack, mailbin, mailhead.
REFRESH: mailpack, mailbin, mailhead.
DESCRIBE TABLE mailtxt LINES tab_lines.
READ TABLE mailtxt INDEX tab_lines.
maildata-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( mailtxt ).
Creation of the entry for the compressed document
CLEAR mailpack-transf_bin.
mailpack-head_start = 1.
mailpack-head_num = 0.
mailpack-body_start = 1.
mailpack-body_num = tab_lines.
mailpack-doc_type = 'RAW'.
APPEND mailpack.
Creation of the document attachment
This form gets the OTF code from the SAPscript form.
If you already have your OTF code, I believe that you may
be able to skip this form. just do the following code, looping thru
your SOLISTI1 and updating MAILBIN.
PERFORM get_otf_code.
LOOP AT solisti1.
MOVE-CORRESPONDING solisti1 TO mailbin.
APPEND mailbin.
ENDLOOP.
DESCRIBE TABLE mailbin LINES tab_lines.
mailhead = 'TEST.OTF'.
APPEND mailhead.
Creation of the entry for the compressed attachment
mailpack-transf_bin = 'X'.
mailpack-head_start = 1.
mailpack-head_num = 1.
mailpack-body_start = 1.
mailpack-body_num = tab_lines.
mailpack-doc_type = 'OTF'.
mailpack-obj_name = 'TEST'.
mailpack-obj_descr = 'Subject'.
mailpack-doc_size = tab_lines * 255.
APPEND mailpack.
ENDFORM. "PREPARE_PACKING_LIST
Form GET_OTF_CODE
FORM get_otf_code.
DATA: BEGIN OF otf OCCURS 0.
INCLUDE STRUCTURE itcoo .
DATA: END OF otf.
DATA: itcpo LIKE itcpo.
DATA: itcpp LIKE itcpp.
data control type SSFCTRLOP.
data output type SSFCOMPOP.
data otfdata type SSFCRESCL.
control-getotf = 'X'.
OUTPUT-TDDEST = 'Lp01'.
control-DEVICE = 'LOCL'.
control-NO_DIALOG = 'X'.
CLEAR itcpo.
itcpo-tdgetotf = 'X'.
CALL FUNCTION '/1BCDWB/SF00000279'
EXPORTING
CONTROL_PARAMETERS = control
OUTPUT_OPTIONS = output
USER_SETTINGS = ' '
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO = otfdata
JOB_OUTPUT_OPTIONS =
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5.
IF sy-subrc <> 0.
ENDIF.
Move OTF code to structure SOLI form email
CLEAR solisti1. REFRESH solisti1.
LOOP AT otfdata-otfdata into otf.
solisti1-line = otf.
APPEND solisti1.
ENDLOOP.
ENDFORM. "GET_OTF_CODE

Similar Messages

  • Regarding Mail:  When I return to my computer after it has gone to sleep, my accounts go offline, and are always asking me for the password.  THis is very annoying.  How can I prevent this?

    Regarding Mail:  When I return to my computer after it has gone to sleep, my accounts go offline, and are always asking me for the password.  THis is very annoying.  How can I prevent this?

    Back up all data.
    Launch the Keychain Access application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Keychain Access in the icon grid.
    Select the login keychain from the list on the left side of the Keychain Access window. If your default keychain has a different name, select that.
    If the lock icon in the top left corner of the window shows that the keychain is locked, click to unlock it. You'll be prompted for the keychain password, which is the same as your login password, unless you've changed it.
    Right-click or control-click the login entry in the list. From the menu that pops up, select Change Settings for Keychain "login". In the sheet that opens, uncheck both boxes, if not already unchecked.
    From the menu bar, select
    Keychain Access ▹ Preferences ▹ First Aid
    If the box marked Keep login keychain unlocked is not checked, check it.
    Select
    Keychain Access ▹ Keychain First Aid
    from the menu bar and repair the keychain. Quit Keychain Access.

  • Regarding Mail step in a workflow.

    Hi All,
    I have a Mail step in the work flow and the mail needs to be send to all people in a particular position. But the position number is not a static one it is determined dynamically in back ground step and is available in an element of the workflow container.
    The problem is when i choose position in the Agents i am not able to assign the workflow container element.
    The WF container element refers to: SWHACTOR-OBJID
    Could anyone please tell me the solution.
    Points are definite.
    Thanks & Regards,
    Goutham.

    Hi Umang,
    Thanks for your reply. I have 2 doubts about this.
    1.) Is it fine if I change the event of this standard workflow itself. i.e. from RELEASESTEPCREATED to RELEASED ?
    2.)If I create a customised workflow & if I change the event from  RELEASESTEPCREATED to RELEASED then will it send the mail to PO releaser for each release, because the current process to send mail to each releaser is a must, only the confirmation for each PO reelase should be stopped.
    Please suggest .

  • Regarding   Mailing of PO :

    Dear SAP Friends
    I need one clarification regarding  sending of Purhcase order through EMAIL ..
    For doing the same , what is the steps needs to be taken , what Setting to be made in Customisation in MM point of view ..
    Please kindly explain the step by step process for the same
    It will be helpful
    rgds
    Surya

    Hi,
    Please follow the given procedure steps.
    You can send purchase order via e-mail in SAP system, there are some configurations and pre-requisites to do as follow:
    1. You must maintain an e-mail address in the address in the vendor master.
    2. The same applies to your own user master. You also have to specify an e-mail address there in order to identify the sender.
    Note that it is not possible to change the e-mail address of the vendor via the SAP purchase order transaction (ME21N, ME22N, and so on). The system only uses the e-mail address of the vendor that is maintained in the vendor master!
    3. For the output type for default values, a communication strategy needs to be maintained in the Customizing that supports the e-mail. You can find the definition of the communication strategy in the Customizing via the following path: (SPRO -> IMG -> SAP Web Application Server -> Basic Services -> Message Control -> Define Communication Strategy). As a default, communication strategy CS01 is delivered. This already contains the necessary entry for the external communication. Bear in mind that without a suitable communication strategy it is not possible to communicate with a partner via Medium 5 (external sending).
    4. Use the standard SAP environment (program 'SAPFM06P', FORM routine 'ENTRY_NEU' and form 'MEDRUCK') as the processing routines.
    5. In the condition records for the output type (for example, Transaction MN04), use medium '5' (External send).
    6. You can use Transaction SCOT to trigger the output manually. The prerequisite for a correct sending is that the node is set correctly. This is not described here, but it must have already been carried out.
    7. To be able to display, for example, the e-mail in Outlook, enter PDF as the format in the node.
    For more details, check out the OSS note :191470
    You can also refer thread.
    External Sending PO by Email
    Hope this will help.
    Deepak

  • Regarding mail sending in ALV

    Hi All,
    I got a requirement to develop a report,
    when executed, will execute and send a mail automatically of output,  to a particular user.
    Please tel me where to put the logic.
    Thank You,
    Rohith.

    Hi Rohit,
    Check the below link:
    Mailing ALV report OUTPUT
    Regards,
    Saba

  • Regarding mail attachment data in body

    Hi all,
              I am trying send an attached ASCCI file i.e text file using mail program.
              I am able to send program but i am getting a peculiar problem where the attachment content is
               again coped in the body.
               Can anyone suggest me what could be the problem,below i am providing my peice of code.
    << Unformatable code removed >>
    Thanks,
    karan
    Edited by: karan kakkad on Apr 29, 2009 8:24 PM
    Edited by: Rob Burbank on Apr 29, 2009 2:36 PM

    Hi Karan ,
               I am also facing the same problem.The attachment content is again coped in the body of the mail.If you got any solution for this, could you please let me know.I am using the FM ' SO_NEW_DOCUMENT_ATT_SEND_API1'.
    Waiting for your reply.
    Regards,
    Rakesh.

  • Regarding mail sending while saving VA02

    Dear Experts,
    I have requirement  mail to be sent while saving VA02 .
    Mail ids are maintained plant wise in custom table.I have to send the mail to the mail id maintained in custom table while saving the VA02.
    Here in VA02 we have added output type which is related to mail which triggers the program RSNASTS0.
    But while saving this program is not getting triggered.But mail is coming to the SAP INBOX.
    Why this program is not triggered and how can i do the abouve requirement.
    Regards
    Ramakrishna L

    Hi Rama,
    First of all, could you please tell me whether the NAST program that you wrote is sending the mail to SAP Inbox. If that program is sending the mail to SAP indox, then to send the mail outside SAP, like the users official mail id, you need to activate auto forwarding feature. This can be done using Tcode "SO36". You can activate this feature and try to test it out.
    Please let me know if this will server your purpose.
    Regards
    Maneesh Chandran
    Edited by: Maneesh Chandran on Aug 9, 2010 8:35 PM

  • Help regarding mail

    I am facing extremely unusual problem with mail. I have synchronised my hotmail and google accounts with mail. since day before yesterday whenever I am trying to check my emails via mail, suddenly internet connection is gone, i cant check any other sites until i made exit from mail. this problem not only with my connection but my flatmates internet connection is also lost if i access the mail. its really weird this problem, initially i thot its network problem but its not its only when i start using mail.
    Kindly provide me with the guidance regarding that.

    Personally I wouldn't worry about the problem since its user abuse that causes the problem. It's like trying to stop someone from sending a message over and over again with any email application.
    If you really want to do this I would implement the following. When you generate the form that is used to enter in the text for the email have the server generate a unique transaction token and put it in the form as a hidden field and serve up the page. The server will need to keep track of these tokens, probably in some database table. Now you have a valid token on the server and a single page on a browser somewhere with the same token. Any time something is submitted for processing check to see that the token from the form is valid. If it is valid, process the request and then delete it from the valid token list. If the user uses the back button and tries to resubmit the form he will be trying to use a token that has already been deleted from the servers directory. You'll also want to create something to timeout the tokens so they don't get stored forever if not used.
    Of course you will have created the problem of a user who fills out an email, sends it, and realizes that he forgot something. This person would want to use the back button to add something to the message that he forgot and send again instead of retyping the entire message.

  • Regarding Mail using Collaboration

    Hi,
    I have activated mail service using Portal Collaboration.
    In that I am able to send mails within my domain and not outside that.
    Is there any settings to be done to get the mail delivered outside the domain?
    Please comment on this.
    Regards
    Vivek

    Suggest a workaround for code we can not view in a product whose version is unknown to us? <g>
    Post your full and complete version number ... that means all three decimal places ... and the relevant portion of your code.

  • Regarding mail adapter

    hi
      i am receving the error msg from receiver..hw could i send the error msg to mail adapter to send a mail...
    i know hw to config mailadapter..but i want how the error msg are captured..
    if any blog is available..
    plz reply to me.
    thx in advance

    Use BPM and this OSS Note:
    https://service.sap.com/sap/support/notes/748024
    See also : http://help.sap.com/saphelp_erp2004/helpdata/en/80/942f3ffed33d67e10000000a114084/frameset.htm

  • Regarding Mail notification in standard Workflow WS20000075

    Hi Experts,
    I am using the standard workflow to send mail to releaser for PO release. The task TS20000168 sends a mail notification to the PO creator saying that the PO is released after every release done by the concerned persons. Now the user requirement is that they want a mail notification to the PO creator only after final release. They dont want notification after each release. Only when the final releaser releases the PO, the creator should get a notification.
    They want to stop the intermediate mail notifications of PO releases.
    Can anybody suggest how to make the changes in this standard workflow ?
    Thanks in advance.

    Hi Umang,
    Thanks for your reply. I have 2 doubts about this.
    1.) Is it fine if I change the event of this standard workflow itself. i.e. from RELEASESTEPCREATED to RELEASED ?
    2.)If I create a customised workflow & if I change the event from  RELEASESTEPCREATED to RELEASED then will it send the mail to PO releaser for each release, because the current process to send mail to each releaser is a must, only the confirmation for each PO reelase should be stopped.
    Please suggest .

  • Regarding mail with attached file

    hi experts,
              i am doing on a report where mail with attached file should fire everyday at 9am. when i am doing it in background,mail is sent to everyone with attached file but when i schedule it in background,mail is firing but attached file is missing.how can i solve this problem?
    thanks.

    try to place ur file onn application server when u run BC.
    Thanks
    Kiran

  • Regarding mail attachement

    Hi to All,
    Hi i am using mail api for my project . I am working with windos xp and Eclipse . I have two doubts .
    1. I want to download attachment with out using file concept.Can i download the attachement
    2.Here i am having attachment in my mail .I want to forward the attachement with out attache again.
    can u help me..
    Thanks...

    Yes, you can read the data that's in an attachment without saving it to a file.
    If you want to extract the data from an attachment and attach it to a new message
    that you're creating, you can do that too. Just keep the data in memory instead of
    in a file. ByteArrayInputStream, ByteArrayOutputStream, and ByteArrayDataSource
    are your friends.

  • Regarding mail sent

    Hi Abap Experts,
                                 i have 4 fields in my selection screen.
                                1.  Trigger mail it is check box.
                                2.  Mail ids it is parameter field
                                3. display all      it is radio button
                                4. display exception   it is radio button
            my requirement is if i mark check in trigger mail then maild field should enable and allows to enter the mail id.
    in the radio button if i click display all then the data from the display all should be linked to mail id and its get triggered.
    similarly if i press display exceptions then the data from this is linked to mail id field and mail gets trigerred.
    for that i am using the function module called so_new_document_api1. i need how to link the data from radio button to the mail id.  i hope u understood my query.

    HI EXPERTS MY PROBLENM IS SOLVED BY TAKING THAT FUNCTION MODULE

  • Regarding Mail sending

    Hi,
    Iam using the function module SO_NEW_DOCUMENT_SEND_API1 to send the mails. I want to hard code the sender on the email to Mailbox?
    --Naveen Inuganti

    Hi,
    Sending mail can be done using some other function modules that are sepcific to send mails
    Go to se37 search for mail F4 u shall get a list of function modules to send mail.
    CRM_EMAIL_SEND_EMAIL etc.
    Hope this solves your issue...
    Thanks
    Ravi Aswani

Maybe you are looking for

  • Time stamp / serial number

    Trying to create a serial number that is stamped with a dealer ID code, and the current date/time when the form is initially opened. var dealer_id = String(Dealer_ID.rawValue); var today = new Date(); var serializedNumber = Dealer_ID + today.getTime(

  • WHen is iOS 5 coming out in Australia

    When???

  • Where is " SAVE ALL " in Preview?

    In M. Lion, " Save All " in Preview disappeared, so how to use this function after editing a pack of photo???

  • Niggling SAN issues

    Hardware: 2 x M5000 (both have exact same issue as described below) Hitachi VSP Storage Brocade Switches in between. Storage has configured so we see 8 paths to each SAN Disk (which solved the PLOGI errors) 28 SAN Disks shared to each of the M5000's

  • Firefox vs out-dated plugins

    Hello, can someone tell me if there are any plans (for future versions of FF) that Firefox will automatically check for latest versions of plugins/addons and disable out-dated plugins (like G.Chrome is doing right now). I´m specially interested in Ja