How to pass an attachment to a email

Hi All!
I am using FM <b>SO_NEW_DOCUMENT_ATT_SEND_API1</b> to send a email and I am successful in doing it.But could not able to attach a word document to the FM which i want to pass it to the receiver.Please advise what parameters to take care of.
Regards
Praneeth

Hi praneeth,
1. There is some trick involved
in the binary files.
2. I have made a program (and it works fantastic)
ONLY 6 LINES FOR EMAILING
BELIEVE ME
ITS A FANTASTIC PROGRAM.
IT WILL WORK LIKE OUTLOOK EXPRESS !
3. The user is provided with
a) file name
b) email address to send mail
and it sends ANY FILE (.xls,.pdf .xyz..)
Instantaneously !
4. Make two things first :
1. Include with the name : ZAMI_INCLFOR_MAIL
2. Report with the name : ZAM_TEMP147 (any name will do)
3. Activate both and execute (2)
4. After providing filename, email adress
5. Code for Include :
10.08.2005 Amit M - Created
Include For Mail (First Req F16)
Modification Log
Data
DATA: docdata LIKE sodocchgi1,
objpack LIKE sopcklsti1 OCCURS 1 WITH HEADER LINE,
objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE,
objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE,
objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE,
objhex LIKE solix OCCURS 10 WITH HEADER LINE,
reclist LIKE somlreci1 OCCURS 1 WITH HEADER LINE.
DATA: tab_lines TYPE i,
doc_size TYPE i,
att_type LIKE soodk-objtp.
DATA: listobject LIKE abaplist OCCURS 1 WITH HEADER LINE.
FORM
FORM ml_customize USING objname objdesc.
Clear Variables
CLEAR docdata.
REFRESH objpack.
CLEAR objpack.
REFRESH objhead.
REFRESH objtxt.
CLEAR objtxt.
REFRESH objbin.
CLEAR objbin.
REFRESH objhex.
CLEAR objhex.
REFRESH reclist.
CLEAR reclist.
REFRESH listobject.
CLEAR listobject.
CLEAR tab_lines.
CLEAR doc_size.
CLEAR att_type.
Set Variables
docdata-obj_name = objname.
docdata-obj_descr = objdesc.
ENDFORM. "ml_customize
FORM
FORM ml_addrecp USING preceiver prec_type.
CLEAR reclist.
reclist-receiver = preceiver.
reclist-rec_type = prec_type.
APPEND reclist.
ENDFORM. "ml_customize
FORM
FORM ml_addtxt USING ptxt.
CLEAR objtxt.
objtxt = ptxt.
APPEND objtxt.
ENDFORM. "ml_customize
FORM
FORM ml_prepare USING bypassmemory whatatt_type whatname.
IF bypassmemory = ''.
Fetch List From Memory
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = listobject
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
MESSAGE ID '61' TYPE 'E' NUMBER '731'
WITH 'LIST_FROM_MEMORY'.
ENDIF.
CALL FUNCTION 'TABLE_COMPRESS'
IMPORTING
COMPRESSED_SIZE =
TABLES
in = listobject
out = objbin
EXCEPTIONS
OTHERS = 1
IF sy-subrc <> 0.
MESSAGE ID '61' TYPE 'E' NUMBER '731'
WITH 'TABLE_COMPRESS'.
ENDIF.
ENDIF.
Header Data
Already Done Thru FM
Main Text
Already Done Thru FM
Packing Info For Text Data
DESCRIBE TABLE objtxt LINES tab_lines.
READ TABLE objtxt INDEX tab_lines.
docdata-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
CLEAR objpack-transf_bin.
objpack-head_start = 1.
objpack-head_num = 0.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = 'TXT'.
APPEND objpack.
Packing Info Attachment
att_type = whatatt_type..
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 = whatname.
APPEND objpack.
Receiver List
Already done thru fm
ENDFORM. "ml_prepare
FORM
FORM ml_dosend.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = docdata
put_in_outbox = 'X'
commit_work = 'X' "used from rel. 6.10
IMPORTING
SENT_TO_ALL =
NEW_OBJECT_ID =
TABLES
packing_list = objpack
object_header = objhead
contents_bin = objbin
contents_txt = objtxt
CONTENTS_HEX = objhex
OBJECT_PARA =
object_parb =
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
IF sy-subrc <> 0.
MESSAGE ID 'SO' TYPE 'S' NUMBER '023'
WITH docdata-obj_name.
ENDIF.
ENDFORM. "ml_customize
FORM
FORM ml_spooltopdf USING whatspoolid.
DATA : pdf LIKE tline OCCURS 0 WITH HEADER LINE.
Call Function
CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = whatspoolid
TABLES
pdf = pdf
EXCEPTIONS
err_no_otf_spooljob = 1
OTHERS = 12.
Convert
PERFORM doconv TABLES pdf objbin.
ENDFORM. "ml_spooltopdf
FORM
FORM doconv TABLES
mypdf STRUCTURE tline
outbin STRUCTURE solisti1.
Data
DATA : pos TYPE i.
DATA : len TYPE i.
Loop And Put Data
LOOP AT mypdf.
pos = 255 - len.
IF pos > 134. "length of pdf_table
pos = 134.
ENDIF.
outbin+len = mypdf(pos).
len = len + pos.
IF len = 255. "length of out (contents_bin)
APPEND outbin.
CLEAR: outbin, len.
IF pos < 134.
outbin = mypdf+pos.
len = 134 - pos.
ENDIF.
ENDIF.
ENDLOOP.
IF len > 0.
APPEND outbin.
ENDIF.
ENDFORM. "doconv
CODE FOR PROGRAM
5.
REPORT zam_temp147 .
INCLUDE zami_inclfor_mail.
DATA
DATA : itab LIKE tline OCCURS 0 WITH HEADER LINE.
DATA : file_name TYPE string.
data : path like PCFILE-PATH.
data : extension(5) type c.
data : name(100) type c.
SELECTION SCREEN
PARAMETERS : receiver TYPE somlreci1-receiver lower case.
PARAMETERS : p_file LIKE rlgrap-filename
OBLIGATORY.
AT SELECTION SCREEN
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CLEAR p_file.
CALL FUNCTION 'F4_FILENAME'
IMPORTING
file_name = p_file.
START-OF-SELECTION
START-OF-SELECTION.
PERFORM ml_customize USING 'Tst' 'Testing'.
PERFORM ml_addrecp USING receiver 'U'.
PERFORM upl.
PERFORM doconv TABLES itab objbin.
PERFORM ml_prepare USING 'X' extension name.
PERFORM ml_dosend.
SUBMIT rsconn01
WITH mode EQ 'INT'
AND RETURN.
FORM
FORM upl.
file_name = p_file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = file_name
filetype = 'BIN'
TABLES
data_tab = itab
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.
path = file_name.
CALL FUNCTION 'PC_SPLIT_COMPLETE_FILENAME'
EXPORTING
complete_filename = path
CHECK_DOS_FORMAT =
IMPORTING
DRIVE =
EXTENSION = extension
NAME = name
NAME_WITH_EXT =
PATH =
EXCEPTIONS
INVALID_DRIVE = 1
INVALID_EXTENSION = 2
INVALID_NAME = 3
INVALID_PATH = 4
OTHERS = 5
ENDFORM. "upl
regards,
amit m.

Similar Messages

  • I don't understand how to download an attachment on an email. It appears to countdown as I; downloading, but I can't find it. Anyone help, please

    I don't understand how to download an attachment on  an email, on my iPad. It counts down as if downloaded, but I can't find it? What am I doing wrong?

    What kind of attachment you are trying to download? After downloading, it should appear with the icon of the program that mostly likely will open it.
    Some formats are not supported...

  • How to pass variable from link in email into HTML DB

    On our helpdesk application, we want to send emails to impacted customers, and have them click on a link in the email (that contains their ticket number) to get to a response form in HTML DB without having to copy and paste or re-enter that ticket number. How would I do this? At this point I don't know if the email will come from Outlook or from HTML DB.
    Also, I see that there is a version of HTML DB for Windows machines. Does it interface with MS Exchange?
    Thank you.

    Hi,
    I have a HR Incident Reporting HTMLDB application that sends details of assigned calls to the assignee's email account, detailing the issue and including a URL to the relevant page in the application.
    When the user clicks on the URL (appears as a link in their email) they go straight into the relevant application page (via login screen).
    We use lotus notes, but I see no reason Exchange would work in the same way.
    Cheers,
    Rob Chalton

  • How to forward an attachment to another email

    Without forwarding the email itself, we need to get an attachment, usually a PDF, from email #1 and send it as the same kind of attachment in a new email. Some methods seem to send the PDF as a jpg which is almost unreadable. What I've figured out takes many steps (I'll write it below) and I wonder if there is a faster way to do this? (Note that forwarding the original email will not let me delete the original sender or his text. We don't want this to show on new email)
    What I CAN do that works:
    1) save an attachment:
    Cursor on it, click, download, yes, up, select here, wait to complete. (It will end up in files, media card, blackberry, documents folder)
    then
    2) create a new email
    start an email, press bb menu, attach file, media card, blackberry, documents, cursor on file, “select” or press button

    JMB (and kwm1337),
    The steps you outlined are the way to do it, and it really isn't all that difficult. You 'd have to do the same thing on the computer to send an attachment without the "forwarding" information being sent.... download/save attachment, start a fresh, new email, attach previously saved attachment and send.

  • How to NOT embed attached image into email message...

    Hi all, I am using nokia E6 anna as my workhorse. One problem I come across is that when I use Nokia Mail (@ovi.com) to send email with photo attachment, the receiver will get the email with that photo embedded into the message, rather than an attachment download option at the end. It causes inconvenience as sometimes I use the phone to send 8MP photo via email and such attached photo "stretches" the message big at the receiver side.
    However, if I use mail for exchange with gmail to send photo, everything is OK, the attached photo doesn't embed into the message.
    Thanks for your advice.

    Hi chanchukwan,
    Thanks for the quick response.
    Contact your local Care line who will be able to reset your Nokia Messaging account. This will most likely fix the issue if removing and adding the Ovi account hasn't worked. They will also be able to help you out if resetting the account doesn't make a difference. 
    In regards to the maximum email download size, this option is indeed not included in the E6. When developing an update we will always take the comments on the boards into consideration, so thank you for your feedback.
    Let me know if you have any further questions.
    Iris9290
    If my post has helped you in any way, please accept it as a solution or click on the white star, so that other users will be able to benefit from it too.

  • How to move an attachment from 1 email to another

    moving an email attachment to a different email

    Please update to Firefox 18.0.1. [[Update Firefox to the latest version]]
    To move attachments you'll have to save it from one email to your computer, then attach to the other email.

  • How to extract a attachment from an email

    Hello SDN,
    we receive email via the configuration of TAC SO28 and trigger a workflow. What would be a good/possible way to extract potential attachments (such as pdf's or tif's) from the email within SAP workflow?
    Are there any methods or FM's, which could extract them from the binary?
    I appreciate any advise!
    Cheers,
    Torsten

    Hi Torsten,
    Does it automatically convert to a SAP Office document? If so you could use the SAP Office apis... search for function modules names SOAPI1.
    Alternatively you may be able to use one of the OTF routines - again search on OTF for suitable function modules.
    Regards,
    Jocelyn

  • Attachment from an email

    Hi All,
    I just want to ask how to view an attachment from an email using ipod touch? Thanks in advance.
    Regards,
    TOpher

    Fromt he Users Guide:
    Viewing Attachments
    iPod touch displays image attachments in many commonly used formats (JPEG, GIF,
    and TIFF) inline with the text in email messages. iPod touch can play many types of
    audio attachments, such as MP3, AAC, WAV, and AIFF. You can download and view files
    (such as PDF, webpage, text, Pages, Keynote, Numbers, and Microsoft Word, Excel, and
    PowerPoint documents) that are attached to messages you receive.
    View an attached file:  Tap the attachment to open it in Quick Look.
    You may need to download the attachment first by tapping  (if it appears at the end
    of the message in a dotted box with the document name).
    Tap attachment
    to download
    You can view attachments in portrait or landscape orientation.
    If the format of an attached file isn’t supported by iPod touch, you can see the name of
    the file but you can’t open it. iPod touch supports the following document types:
    .doc Microsoft Word
    .docx Microsoft Word (XML)
    .htm webpage
    .html webpage
    .key Keynote
    .numbers Numbers
    .pages Pages
    .pdf Preview, Adobe Acrobat
    .ppt Microsoft PowerPoint
    .pptx Microsoft PowerPoint (XML)
    .rtf Rich Text Format
    .txt text
    .vcf contact information
    .xls Microsoft Excel
    .xlsx Microsoft Excel (XML)
    Open an attached file with another app:  Touch and hold the attachment, then
    choose an app. If no apps are available, you can choose to open the attachment in
    Quick Look.
    Save an attached photo to your Saved Photos album:  Tap the photo, then tap Save
    Image. If the photo hasn’t been downloaded yet, tap the download notice first.
    Save an attached video to your Saved Photos album:  Touch and hold the
    attachment, then tap Save Video. If the video hasn’t been downloaded yet, tap the
    download notice first.

  • From report 6i send email as attachment How to pass recipient Column.

    When I execute report and at preview stage when
    click on e-mail button then e-mail box appear
    Auto Pick following Fields
    1 Subject : "Report sent through Report Builder"
    2 Attach : "Report with <file Size>"
    My qs is How to pass e-mail id to RECIPIENT(To:) column in Email Box.

    thanks for your reply
    i 'm doing what exactly you mention here .
    my problem here is
    i have 15 columns
    i am executing a query based on the values of the column(column name)  in the target page
    1)here i am passing(all) the column values to the next page-but  i want to pass only one column values(column name)
    when i click on any cell of that  column
    OR
    2)i can pass all column name to target page -there(in the target page) i can filter out
    i think option 1 would good if you filter out the unwanted columns
    Regards
    Amul

  • How to Change Outlook Default Folder for Insert-Attachment and Save Email/Attachemnt while Outlook is open (VBA)

    Hello,
    Office 2010 32bit, VBA
    Is it possible to programmatically do the above while Outlook is running?  If so, I'm hoping to make that change from a Word macro.
    I tried tinkering with the reg key and that doesn't work because it appears Outlook only respects it at startup time. Similary changing Word File-options-location of documents is respected only when Outlook starts.
    I'm looking to seamlessly keep Outlook's default folder in sync with Word's default folder as the users change working folders in Word, which they do many times per day (and they chose the folder among a couple of thousand possibilities).
    I'm hoping there is a difficult-to-find Outlook object I can manipuate to get to the end result.  IF there is such an Object I have been unable to find it.
    Many thanks!
    Julie

    Hi Julie,
    Based on my research, I think outlook object model doesn’t provide the way to change the default folder for insert attachment and save email/attachment.
    The way to change it is that we need to modify the registry setting and the outlook app should be restart.
    # How to set the default attachment folder in Outlook
    https://support.microsoft.com/kb/252732?wa=wsignin1.0
    You may create the add-in to custom these actions (e.g. attach attachment, save email)
    Regards
    Starain
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Please, I have a PDF attachment in an email on Russian language, how can I open it and convert to WO

    Please, I have a PDF attachment in an email on Russian language, how can I open it and convert to WORD (doc.) on Russian?

    Hi Senior gal,
    If you have purchased the ExportPDF subscription, then just save the PDF to your desktop and follow any of the two mathod mentioned in the article below to convert the PDF to word
    http://forums.adobe.com/docs/DOC-2412
    ~Pranav

  • How can I print only the attachment without the email content

    How can I print only the attachment without the email content. Every time I send to print, It prints the email itself with the attachment- can I cancel that?

    Hello Riklama,
    When you first open the attachment (e.g. on your phone) than you can mail only that attachment. Works fine with my husbands blackberry.
    Elsy

  • How do I change my security questions email? There is an old one attached that no longer works.

    How do I change my security questions email? There is an old one attached that no longer works.

    The Three Best Alternatives for Security Questions and Rescue Mail
        1. Use Apple's Express Lane.
              Go to https://expresslane.apple.com ; click 'See all products and services' at the
              bottom of the page. In the next page click 'More Products and Services, then
              'Apple ID'. In the next page select 'Other Apple ID Topics' then 'Forgotten Apple
              ID security questions' and click 'Continue'. Please be patient waiting for the return
              phone call. It will come in time depending on how heavily the servers are being hit.
         2.  Call Apple Support in your country: Customer Service: Contacting Apple for support or
              Apple ID- Contacting Apple for help with Apple ID account security. Ask to speak to
              Account Security.
         3.  Rescue email address and how to reset Apple ID security questions.
    How to Manage your Apple ID: Manage My Apple ID

  • I have scanned a document and saved it to desk top - when I have then attached to an email it says no plug and attachments don't send. How do I add plug in so pdf documents can be attached and opened.

    I have scanned a document and then saved it to desktop. It has saved as a pdf. When I have then attached it to email and sent - an message comes up saying no plug ins - The recipent couldnt open files. How can I rectify this so that I can attach pdf pleaase

    search the app store for PDF Writer. I've found a lot that will convert documents to PDF, but none yet that will write within the PDF. One thing you want to avoid are cloud based apps. Any of them that talk about editing on the cloud, etc, aren't going to be as standalone as you want.
    It's possible, if you can take your template PDF, turn it into a word document that you can edit, you can then convert that to PDF...kinda a workaround way to do what you want. And apps that convert to PDF are much easier to find

  • How to pass variable to data tab which replace text in Word attachment

    Dear ABAP folks,
    I use METHOD cl_gui_frontend_services=>gui_upload to upload my word doc in BINARY and sucessful sent this word doc as attachment with Thomas Jung's FUNCTION 'Z_E_KEG_SEND_SIMPLE_EMAIL'.
    However, inside the word file, i need insert varible personnel number p0000-pernr.
    *How to pass the value p0000-pernr to data tab (lt_data) which replace symbol text &s_pernr& in doc before created as attachment ? *
    I try 'SCMS_BINARY_TO_TEXT'  and 'SCMS_BINARY_TO_STRING'    but fail.
    Need expert 's help.
    Thanks & Rgds,
    Felice
    Below are my code:
    ** Upload file to read data as binary
        CALL METHOD cl_gui_frontend_services=>gui_upload
    IF lt_data[] IS NOT INITIAL.
        CALL FUNCTION 'SO_SPLIT_FILE_AND_PATH'
         EXPORTING
            full_name     = lv_filename
          IMPORTING
            stripped_name = lv_str_filename
          EXCEPTIONS
            x_error       = 1
            OTHERS        = 2.
        SPLIT lv_str_filename AT '.' INTO lv_junk lv_filetype.
        ls_attach-type = lv_filetype.
        ls_attach-subject = lv_str_filename.
        ls_attach-CONTENT_HEX[] = lt_data[].
        APPEND ls_attach TO lt_attach.
        CLEAR ls_attach.
    ENDIF.
    CALL FUNCTION 'Z_E_KEG_SEND_SIMPLE_EMAIL'
    EXPORTING
    REQUESTED_STATUS = 'E'
    DOCUMENTS = lt_attach
    RECIPIENTS = lt_rec
    MESSAGE = t_objtxt
    SUBJECT = 'Confirmation Review'.
    COMMIT WORK.
    clear lt_rec.
    clear ls_rec-i_copy.

    Dear Luigi,
    Do you have sample code which replace the value in Word file ?
    I try sample code below, but the mergefield 'Title' in Word file not replace instead it override the whole file.
    Even i try with different download path, it also not update field 'Title'.
    The mergefield i insert by microsoft word > mailings > insert merge field >Title.
    report ztestmail_c.
    data: global_filename LIKE RLGRAP-FILENAME.
    data: begin of imerge occurs 0,
    Title(85) type c, field02(85) type c,
    field03(85) type c, field04(85) type c,
    end of imerge.
    data: begin of itabf occurs 31,
    ff(10),
    end of itabf.
    itabf-ff = 'Title'. "append itabf.
    imerge-Title = 'test0'.
    append imerge. clear imerge.
    global_filename = 'c:\temp\confirm-form0508.doc'.
    CALL FUNCTION 'WORD_OLE_FORMLETTER'
    EXPORTING
    WORD_DOCUMENT = global_filename
    *   hidden        =
    *   word_password =             "               Password for the mail merge file (.DOC)
    *   password_option = 1         " i             Controls password use
    *   file_name =  'confirm-form0508'               " rlgrap-filename  Name of download file (w/o ext.)
    *   new_document =              "               Create new Word document
    DOWNLOAD_PATH = 'C:\temp\confirm-form0615.doc'
    TABLES
    DATA_TAB = imerge
    FIELDNAMES = itabf
    EXCEPTIONS
    INVALID_FIELDNAMES = 1
    USER_CANCELLED = 2
    DOWNLOAD_PROBLEM = 3
    COMMUNICATION_ERROR = 4
    OTHERS = 5.

Maybe you are looking for