SO_NEW_DOCUMENT_ATT_SEND_API1 - Send Picture as an attachment
Hello,
I'am in trouble with trying to send a picture as an attachment using the function module
SO_NEW_DOCUMENT_ATT_SEND_API1. The problem is, that I dont know the right way to send the
picture's data in table OBJBIN.
I need a good idea... thank you in advance!
Thomas
data: objpack like sopcklsti1 occurs 0 with header line. "->SOPCKLSTI1
data: objbin like solisti1 occurs 0 with header line. "->SO_TEXT255
objhead = 'sap_logo'.
append objhead.
objpack-transf_bin = 'X'.
objpack-head_start = 1.
objpack-head_num = 1.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = 'RAW'.
objpack-obj_name = 'sap_logo.gif'.
objpack-obj_descr = 'sap_logo.gif'.
objpack-doc_size = tab_lines * 255.
append objpack.
* Does not work...
refresh objbin.
append '4749463839613B001E00B30F00012F6444668E8C9CB1A3B5C8FFFFFFB9C9D8CC' to objbin.
* I could load the bitmap from the Mime-Repository, but I don't know how to conter the XSTRING into the Table OBJBIN...
data: mime_repository type ref to if_mr_api,
url type string value '/SAP/PUBLIC/SAP/sap_logo.gif'.
data: content type xstring.
mime_repository = cl_mime_repository_api=>get_api( ).
call method mime_repository->get
exporting
i_url = url
importing
e_content = content.
Hello,
just a few minutes after posting, I found the wonderful funktion module 'SCMS_XSTRING_TO_BINARY'.
Kind regards
Thomas
Similar Messages
-
How to send a picture as an attachment
I'm new here and not sure I'm in the correct place .
I just bought a imac and I'm trying to send a picture as an attachment. I showes up in the body of the email. How do I get it to be just an attachment like on a computer?Try using the Finder Compress the file, then attach the resultant file to the e-mail.
-
IPhone: Sending a picture as an attachment, not embedded within the email?
Hello Community,
Does anyone have a suggestion as to how to e-mail a picture from your iPhone, as an attachment? NOT embedded within the e-mail....?
My wife's e-mail client (school teacher) will not allow her to receive/view emails that have pictures embedded within the body text. She can only receive pictures if they are attached separately on the e-mail.
The only work-around I have found, is by installing the Google Mail app onto my iPhone. Google Mail will allow you to send pictures as attachments. But I do not prefer this. I would like to use the iPhone's native e-mail application.
Thanks,
BPTo follow up on this question, is there any way to receive *.tiff or *.jpg on an iPhone/iOS device in general as an attachment rather than imbedded in the email, and "open with" some other application, or save to an application store, like GoodReader does with say, *.pdf's?
-
How can I send pictures not embedded, but as an attachment? THX
How can I send pictures not embedded, but as an attachment? THX
I had the same problem. I closed the message, tried again selecting the correct imessage contact number and it worked.
I'm guessing I first selected a non-imessage phone number and it got stuck in a gray/can't send mode (bug). -
Sending more than 1 picture from iPhone pictures as an attachment????
Is it possible to send more than 1 picture as an attachment in the 1 message when picking the photos from my iPhone picture library??
Yes if you have the latest version of the iPhone software 4.0 or higher.
In the Photo app when you can see a grid of photos (i.e. don't go to an individual photo), touch the box with the arrow in the upper right of the screen, you will then be asked to select the photos you want to sen. You are limited to 19 photos max to share, use the share button in the lower left once you have selected your photos. -
Email works without pictures, but when attaching a picture the mail will not send
Hi,
In Mail > Preferences > Accounts to can find out which STMP server you are using for outgoing items.
This can be one account.
I do this with a dial Up account I still have access to.
I can "fetch" mail over DSL and now Fibre.
However I have to be Logged in via Dial up to actually use their Servers to Send.
As a Consequence I "send" via one of the other Accounts STMP servers. (I tend to add a signature that reflects this account change)
The other thing that might explain what you are seeing is the Full Name Box.
8:38 PM Monday; April 8, 2013
iMac 2.5Ghz 5i 2011 (Mountain Lion 10.8.3)
G4/1GhzDual MDD (Leopard 10.5.8)
MacBookPro 2Gb (Snow Leopard 10.6.8)
Mac OS X (10.6.8),
Couple of iPhones and an iPad
"Limit the Logs to the Bits above Binary Images." No, Seriously -
How to send mail with pdf attachment.
hello,
I want to know if I can send a pdf attachment via mail. My PDF file is somewhere in the server and its content doesn't need to be changed by the program. the program just needs to find the pdf in server, then it will just send pdf file as attachment to the mail. is it possible ? thanks in advance.Hi Friend,
You can easily send the document by email as follows :
REPORT ZSENDEXTERNAL.
DATA: OBJPACK LIKE SOPCKLSTI1 OCCURS 2 WITH HEADER LINE.
DATA: OBJHEAD LIKE SOLISTI1 OCCURS 1 WITH HEADER LINE.
DATA: OBJBIN LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
DATA: OBJTXT LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
DATA: RECLIST LIKE SOMLRECI1 OCCURS 5 WITH HEADER LINE.
DATA: DOC_CHNG LIKE SODOCCHGI1.
DATA: TAB_LINES LIKE SY-TABIX.
Creation of the document to be sent
File Name
DOC_CHNG-OBJ_NAME = 'SENDFILE'.
Mail Subject
DOC_CHNG-OBJ_DESCR = 'Send External Mail'.
Mail Contents
OBJTXT = 'Minimum bid : $250000'.
APPEND OBJTXT.
OBJTXT = 'A representation of the pictures up for auction'.
APPEND OBJTXT.
OBJTXT = 'was included as attachment.'.
APPEND OBJTXT.
DESCRIBE TABLE OBJTXT LINES TAB_LINES.
READ TABLE OBJTXT INDEX TAB_LINES.
DOC_CHNG-DOC_SIZE = ( TAB_LINES - 1 ) * 255 + STRLEN( OBJTXT ).
Creation of the entry for the compressed document
CLEAR OBJPACK-TRANSF_BIN.
OBJPACK-HEAD_START = 1.
OBJPACK-HEAD_NUM = 0.
OBJPACK-BODY_START = 1.
OBJPACK-BODY_NUM = TAB_LINES.
OBJPACK-DOC_TYPE = 'RAW'.
APPEND OBJPACK.
Creation of the document attachment
(Assume that the data in OBJBIN is in BMP format)
*OBJBIN = ' \O/ '. APPEND OBJBIN.
*OBJBIN = ' | '. APPEND OBJBIN.
*OBJBIN = ' / \ '. APPEND OBJBIN.
*DESCRIBE TABLE OBJBIN LINES TAB_LINES.
*OBJHEAD = 'PICTURE.BMP'.
*APPEND OBJHEAD.
Creation of the entry for the compressed attachment
*OBJPACK-TRANSF_BIN = 'X'.
*OBJPACK-HEAD_START = 1.
*OBJPACK-HEAD_NUM = 1.
*OBJPACK-BODY_START = 1.
*OBJPACK-BODY_NUM = TAB_LINES.
*OBJPACK-DOC_TYPE = 'PDF'.
*OBJPACK-OBJ_NAME = 'PICTURE'.
*OBJPACK-OBJ_DESCR = 'Representation of object 138'.
*OBJPACK-DOC_SIZE = TAB_LINES * 255.
*APPEND OBJPACK.
Completing the recipient list
RECLIST-RECEIVER = <External Email id >.
RECLIST-REC_TYPE = 'U'.
APPEND RECLIST.
*RECLIST-RECEIVER = 'SAPUSERNAME'.
*RECLIST-REC_TYPE = 'P'.
*APPEND RECLIST.
Sending the document
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
DOCUMENT_DATA = DOC_CHNG
PUT_IN_OUTBOX = 'X'
TABLES
PACKING_LIST = OBJPACK
OBJECT_HEADER = OBJHEAD
CONTENTS_BIN = OBJBIN
CONTENTS_TXT = OBJTXT
RECEIVERS = RECLIST
EXCEPTIONS
TOO_MANY_RECEIVERS = 1
DOCUMENT_NOT_SENT = 2
OPERATION_NO_AUTHORIZATION = 4
OTHERS = 99.
CASE SY-SUBRC.
WHEN 0.
WRITE: / 'Result of the send process:'.
LOOP AT RECLIST.
WRITE: / RECLIST-RECEIVER(48), ':'.
IF RECLIST-RETRN_CODE = 0.
WRITE 'The document was sent'.
ELSE.
WRITE 'The document could not be sent'.
ENDIF.
ENDLOOP.
WHEN 1.
WRITE: / 'No authorization for sending to the specified number',
'of recipients'.
WHEN 2.
WRITE: / 'Document could not be sent to any recipient'.
WHEN 4.
WRITE: / 'No send authorization'.
WHEN OTHERS.
WRITE: / 'Error occurred while sending'.
ENDCASE.
Regards
Dhirendra Pandit -
I can no longer send picture e-mails from my ipod. Why?
I use to be able to send pictures from the Photos app to my e-mail. Now when I try & send them, I never get them. I also tried sending them to the Facebook mail, but again- never get them. No error message pops up on my ipod. Any suggestions?
Oh my goodness! Thank you sooo much! This worked. I can now stop sending the business e-mails from my personal account - ha ha. Since you helped me with this, maybe you can help me with one more thing. I haven't been able to attach to e-mails in this account for quite awhile now, just been using a jump drive, since a previous automatic update. I didn't obsess over it due to the fact that I could still send e-mails. Any more help you can provide is greatly appreciated!
By the way, you also put it in terms I could understand. I'm not computer illiterate, just not as up to date as I should be. Step-by-steps help alot! :D -
Issue in sending the file as attachment
I am using functional module 'SO_NEW_DOCUMENT_ATT_SEND_API1' to send the email with attachment.
If the file type is 'RAW', the records are getting displayed as that of the source file. For the other file types, all the records are getting displayed in a single line in the output. Please let me know the solution for this.Hi Saranya,
Chk this example:
DATA : DS_OBJPACK TYPE SOPCKLSTI1,
DS_OBJHEAD TYPE SOLISTI1,
DS_OBJBIN TYPE SOLISTI1,
DS_OBJTXT TYPE SOLISTI1,
DS_RECLIST TYPE SOMLRECI1.
*--MAIL related Internal tables
DATA: DS_XDOCCHNG TYPE SODOCCHGI1, " document
" attributes
DT_OBJPACK TYPE STANDARD TABLE OF SOPCKLSTI1, " attachment
" table
DT_OBJHEAD TYPE STANDARD TABLE OF SOLISTI1, " objectheader
" table
DT_OBJBIN TYPE STANDARD TABLE OF SOLISTI1, " binary table
DT_OBJTXT TYPE STANDARD TABLE OF SOLISTI1, " object text
DT_RECLIST TYPE STANDARD TABLE OF SOMLRECI1. " mail
" recipients
DATA: DL_TEXT TYPE CHAR50,
DL_TABLELINES TYPE SY-TABIX,
DL_STARTDATE(10) TYPE C,
DL_ENDDATE(10) TYPE C,
DL_SUBJECT(100) TYPE C, "sin_obj_de, Subject for Mail
DL_SDATE TYPE CHAR10,
DL_DDATE TYPE CHAR10,
DL_CDATE TYPE CHAR10,
DL_DATE TYPE CHAR10,
DL_FDATE TYPE CHAR10,
DL_SYDATE TYPE CHAR10.
*subject of the mail
*if delivery date in entered
IF NOT S_CONDAT[] IS INITIAL.
WRITE S_CONDAT-LOW TO DL_STARTDATE MM/DD/YYYY.
WRITE S_CONDAT-HIGH TO DL_ENDDATE MM/DD/YYYY.
IF S_CONDAT-HIGH IS INITIAL.
CONCATENATE 'Capital FutIssue- Dtd Btn'(007)
DL_STARTDATE
DL_STARTDATE
INTO DL_SUBJECT SEPARATED BY SPACE.
ELSE.
CONCATENATE 'Capital FutIssue- Dtd Btn'(007)
DL_STARTDATE
'and'
DL_ENDDATE
INTO DL_SUBJECT SEPARATED BY SPACE.
ENDIF.
ELSE.
WRITE SY-DATUM TO DL_SYDATE MMDDYY.
CONCATENATE 'Capital FutIssue- Exectd on'(008)
DL_SYDATE
INTO DL_SUBJECT SEPARATED BY SPACE.
ENDIF.
*-- Populate mail id
CHECK S_USERID[] IS NOT INITIAL." OR P_DLIST IS NOT INITIAL.
IF NOT S_USERID[] IS INITIAL.
LOOP AT S_USERID.
CONCATENATE S_USERID-LOW '@ntmcon02.emn.com'(009) INTO
DS_RECLIST-RECEIVER.
DS_RECLIST-REC_TYPE = 'U'.
APPEND DS_RECLIST TO DT_RECLIST.
ENDLOOP.
ENDIF.
*-- Mail subject line
CLEAR: DS_XDOCCHNG.
DS_XDOCCHNG-OBJ_NAME = 'HEADING'.
DS_XDOCCHNG-OBJ_DESCR = DL_SUBJECT.
*-- Mail body
CONCATENATE TEXT-010 SPACE INTO DS_OBJTXT SEPARATED BY SPACE.
DS_OBJTXT = TEXT-010.
APPEND DS_OBJTXT TO DT_OBJTXT.
*-- Populate the attachment text.
*-- Header
CONCATENATE TEXT-036
TEXT-026
TEXT-053
TEXT-052
TEXT-037
TEXT-018
TEXT-019
TEXT-022
TEXT-021
TEXT-017
TEXT-023
TEXT-024
TEXT-025
TEXT-027
TEXT-028
TEXT-020
TEXT-029
TEXT-030
TEXT-038
TEXT-046
TEXT-047
TEXT-048
TEXT-049
TEXT-031
TEXT-032
TEXT-034
TEXT-035
INTO DS_OBJBIN
SEPARATED BY CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.
APPEND DS_OBJBIN TO DT_OBJBIN.
CLEAR DS_OBJBIN.
*--Body
CLEAR: DS_FINAL.
LOOP AT DT_FINAL INTO DS_FINAL.
DG_MENGE = DS_FINAL-MENGE.
DG_CMOQTY = DS_FINAL-CMOQTY.
DG_WEMNG = DS_FINAL-RECV_QTY.
DG_BALANCE = DS_FINAL-BALANCE.
DG_DAYS = DS_FINAL-DAYDIFF.
WRITE DS_FINAL-CONSDT TO DL_DATE MM/DD/YYYY NO-ZERO.
WRITE DS_FINAL-SLFDT TO DL_SDATE MM/DD/YYYY NO-ZERO .
WRITE DS_FINAL-EINDT TO DL_DDATE MM/DD/YYYY NO-ZERO.
WRITE DS_FINAL-AEDAT TO DL_CDATE MM/DD/YYYY NO-ZERO.
Calling conversion exit to display WBS in external format
PERFORM CONV_EXIT_ABPSN_OUT CHANGING DS_FINAL-WBS.
CONCATENATE DL_DATE
DL_DDATE
DS_FINAL-DAYDIFF
DS_FINAL-EXPEDITE
DS_FINAL-FLTDT
DS_FINAL-AUFNR
DS_FINAL-CMOITEM
DG_CMOQTY
DG_BALANCE
DG_MENGE
DG_WEMNG
DS_FINAL-EBELN
DL_CDATE
DL_SDATE
DS_FINAL-EBELP
DS_FINAL-TXZ01
DS_FINAL-MATNR
DS_FINAL-MAKTX
DS_FINAL-WBS
DS_FINAL-INDOOR
DS_FINAL-FOOTPRINT
DS_FINAL-WEIGHT
DS_FINAL-STORAGE
DS_FINAL-LIFNR
DS_FINAL-NAME1
DS_FINAL-EKGRP
DS_FINAL-AFNAM
INTO DS_OBJBIN
SEPARATED BY CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.
TRANSLATE DS_OBJBIN USING ', '.
CONCATENATE CL_ABAP_CHAR_UTILITIES=>NEWLINE DS_OBJBIN INTO DS_OBJBIN
APPEND DS_OBJBIN TO DT_OBJBIN.
CLEAR DS_OBJBIN.
ENDLOOP.
**-- Populate packing list for body text
DS_OBJPACK-TRANSF_BIN = ''.
DS_OBJPACK-HEAD_START = 1.
DS_OBJPACK-HEAD_NUM = 0.
DS_OBJPACK-BODY_START = 1.
DS_OBJPACK-DOC_TYPE = 'RAW'.
APPEND DS_OBJPACK TO DT_OBJPACK.
CLEAR DS_OBJPACK.
*-- Get total no.of lines of Object table(attachment)
CLEAR : DL_TABLELINES.
DESCRIBE TABLE DT_OBJBIN LINES DL_TABLELINES.
DL_TEXT = DL_SUBJECT.
*-- Packing list for attachment
DS_OBJPACK-TRANSF_BIN = 'X'.
DS_OBJPACK-HEAD_START = 1.
DS_OBJPACK-HEAD_NUM = 1.
DS_OBJPACK-BODY_START = 1.
DS_OBJPACK-BODY_NUM = DL_TABLELINES .
DS_OBJPACK-DOC_TYPE = 'XLS'.
DS_OBJPACK-OBJ_NAME = ' '.
DS_OBJPACK-OBJ_DESCR = DL_TEXT.
DS_OBJPACK-DOC_SIZE = DL_TABLELINES * 255.
APPEND DS_OBJPACK TO DT_OBJPACK.
CLEAR DS_OBJPACK.
*-- Sending the EMail document in given format
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
DOCUMENT_DATA = DS_XDOCCHNG
PUT_IN_OUTBOX = 'X'
COMMIT_WORK = 'X'
TABLES
PACKING_LIST = DT_OBJPACK
OBJECT_HEADER = IT_OBJHEAD
CONTENTS_BIN = DT_OBJBIN
CONTENTS_TXT = DT_OBJTXT
RECEIVERS = DT_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 NE 0 .
WRITE:/ SY-SUBRC , 'Mail document not sent'(004).
ELSE.
MESSAGE S000 WITH 'Mail sent successfully'(012).
ENDIF.
Thanks,
Keerthi. -
Sending mail with excel attachment-improper format
Dear experts,
I am sending a mail to outlook with an excel attachment. The mail is sent with attachment and the data, but all in one cell.
I am using SO_NEW_DOCUMENT_ATT_SEND_API1. What parameters do i need to manipulate to have data in different columns of excel? I am using "packing_list" table of FM. But dont know the exact parameters to be passed. Can anyone help with the same please?
Best regards and thanks!
Sumit Nene.Hello Sumit,
I am using same function module to send mail with excel attachment.
Below I am attaching my own code for your reference.
Data which u want to add in excel file is maintain in IT_OBJBIN i.e. document information.
CLEAR :IMESSAGE,IT_OBJBIN,IT_OBJPACK,IT_RECLIST.
REFRESH: IMESSAGE[ ] , IT_OBJBIN[ ] , IT_OBJPACK[ ] , IT_RECLIST[ ].
" populate the text for body of the mail
CLEAR WA_IMESSAGE.
CONCATENATE 'Board : ' P_BOARD ':' 'Please find the excel attached for the list of Material whose routing is created' INTO WA_IMESSAGE-LINE.
APPEND WA_IMESSAGE TO IMESSAGE.
"document information
W_DOC_CHNG-OBJ_NAME = 'Excel'.
IF NOT P_BOARD IS INITIAL.
CONCATENATE 'Board : ' P_BOARD ':' 'List Of Routing Materials' INTO W_DOC_CHNG-OBJ_DESCR.
ELSE.
CONCATENATE 'List Of' ' Routing Materials' INTO W_DOC_CHNG-OBJ_DESCR.
ENDIF.
W_DOC_CHNG-SENSITIVTY = 'F'. " ->Functional object
" displaying material , plant in the excel
CONCATENATE 'BOARD NO : ' P_BOARD INTO WA_OBJBIN.
APPEND WA_OBJBIN TO IT_OBJBIN.
CONCATENATE 'MATERIAL' 'PLANT' 'DESCRIPTION' INTO WA_OBJBIN SEPARATED BY C_TAB.
CONCATENATE C_RET WA_OBJBIN INTO WA_OBJBIN.
APPEND WA_OBJBIN TO IT_OBJBIN.
CLEAR : WA_OBJBIN.
LOOP AT IT_DOWNLOAD INTO WA_DOWNLOAD. "It_orders is the internal table to be transferred to excel
CONCATENATE WA_DOWNLOAD-MATNR WA_DOWNLOAD-WERKS WA_DOWNLOAD-DESC INTO WA_OBJBIN SEPARATED BY C_TAB.
CONCATENATE C_RET WA_OBJBIN INTO WA_OBJBIN.
APPEND WA_OBJBIN TO IT_OBJBIN.
ENDLOOP.
DESCRIBE TABLE IT_OBJBIN LINES V_LINES_BIN. " no of lines for excel data
" pack the data as RAW
CLEAR WA_IT_OBJPACK-TRANSF_BIN. "Obj. to be transported not in binary form
WA_IT_OBJPACK-HEAD_START = 1. "Start line of object header in transport packet
WA_IT_OBJPACK-HEAD_NUM = 0. "Number of lines of an object header in object packet
WA_IT_OBJPACK-BODY_START = 1. "Start line of object contents in an object packet
WA_IT_OBJPACK-BODY_NUM = MESSAGE_LINES. "Number of lines of the mail body
WA_IT_OBJPACK-DOC_TYPE = 'RAW'.
APPEND WA_IT_OBJPACK TO IT_OBJPACK.
" pack the data as excel
WA_IT_OBJPACK-TRANSF_BIN = 'X'.
WA_IT_OBJPACK-HEAD_START = 1.
WA_IT_OBJPACK-HEAD_NUM = 1.
WA_IT_OBJPACK-BODY_START = 1.
WA_IT_OBJPACK-BODY_NUM = V_LINES_BIN. "no of lines of it_orders to give no of unprocessed orders
WA_IT_OBJPACK-DOC_TYPE = 'XLS'. " -> excel fomat
WA_IT_OBJPACK-OBJ_NAME = 'EXCEL ATTACHMENT'.
" attachment name
IF NOT P_BOARD IS INITIAL.
CONCATENATE P_BOARD '.XLS' INTO WA_IT_OBJPACK-OBJ_DESCR.
ELSE.
CONCATENATE 'LIST' '.XLS' INTO WA_IT_OBJPACK-OBJ_DESCR.
ENDIF.
WA_IT_OBJPACK-DOC_SIZE = V_LINES_BIN * 255.
APPEND WA_IT_OBJPACK TO IT_OBJPACK.
" creating email id
DATA: STR1 TYPE STRING,
STR2 TYPE STRING,
STR3 TYPE STRING,
ITAB TYPE TABLE OF STRING.
DATA : WA_I LIKE LINE OF ITAB.
SPLIT P_EMAIL AT ',' INTO: TABLE ITAB.
e-mail receivers.
CLEAR WA_IT_RECLIST.
LOOP AT ITAB INTO WA_I.
WA_IT_RECLIST-RECEIVER = WA_I.
WA_IT_RECLIST-RECEIVER = V_MAILADDR.
WA_IT_RECLIST-EXPRESS = 'X'.
WA_IT_RECLIST-REC_TYPE = 'U'. "-> Internet address
APPEND WA_IT_RECLIST TO IT_RECLIST.
CLEAR WA_IT_RECLIST.
ENDLOOP.
" sending mail
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
DOCUMENT_DATA = W_DOC_CHNG
PUT_IN_OUTBOX = 'X'
COMMIT_WORK = 'X'
IMPORTING
SENT_TO_ALL =
NEW_OBJECT_ID =
TABLES
PACKING_LIST = IT_OBJPACK
OBJECT_HEADER =
CONTENTS_BIN = IT_OBJBIN
CONTENTS_TXT = IMESSAGE
CONTENTS_HEX =
OBJECT_PARA =
OBJECT_PARB =
RECEIVERS = IT_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
COMMIT WORK.
IF SY-SUBRC = 0.
MESSAGE I001 WITH 'Routing is Created for Board' P_BOARD 'and Mail send on e-mail id :' P_EMAIL.
ENDIF. -
How to convert sap script to pdf and send it as email attachment
hi,
my requirement is to convert a standard sales order form to pdf and send it as email attachment. get me some sample code for the same
thanks in advanceHi
See this sample code and after that use the fun module to send the mail
SO_NEW_DOCUMENT_ATT_SEND_API1
REPORT zzz_jaytest .
Types Declaration
TYPES : BEGIN OF ty_pa0001,
pernr TYPE pa0001-pernr,
bukrs TYPE pa0001-bukrs,
werks TYPE pa0001-werks,
END OF ty_pa0001.
Internal Table Declaration
DATA : i_pa0001 TYPE STANDARD TABLE OF ty_pa0001, "For pa0001 Details
i_otf TYPE STANDARD TABLE OF itcoo, "For OTF data
i_content_txt TYPE soli_tab, "Content
i_content_bin TYPE solix_tab, "Content
i_objhead TYPE soli_tab,
Work Area Declaration
w_pa0001 TYPE ty_pa0001, "For pa0001 Details
w_res TYPE itcpp, "SAPscript output
"parameters
w_otf TYPE itcoo, "For OTF
w_pdf TYPE solisti1, "For PDF
w_transfer_bin TYPE sx_boolean, "Content
w_options TYPE itcpo, "SAPscript output
"interface
Variable Declaration
v_len_in TYPE so_obj_len,
v_size TYPE i.
Constants Declaration
CONSTANTS : c_x TYPE c VALUE 'X', "X
c_locl(4) TYPE c VALUE 'LOCL', "Local Printer
c_otf TYPE sx_format VALUE 'OTF', "OTF
c_pdf TYPE sx_format VALUE 'PDF', "PDF
c_printer TYPE sx_devtype VALUE 'PRINTER', "PRINTER
c_bin TYPE char10 VALUE 'BIN', "BIN
c_name TYPE string VALUE 'C:\ZZZ_JAYTEST.PDF',"Downloading
"File Name
c_form(11) TYPE c VALUE 'ZZZ_JAYTEST'. "Form Name
START-OF-SELECTION.
Selecting the records from pa0001
SELECT pernr bukrs werks FROM pa0001
INTO TABLE i_pa0001 UP TO 10 ROWS.
Setting the options
w_options-tdcopies = 1 ."Number of copies
w_options-tdnoprev = c_x."No print preview
w_options-tdgetotf = c_x."Return of OTF table
w_options-tddest = c_locl."Spool: Output device
Opening the form
CALL FUNCTION 'OPEN_FORM'
EXPORTING
form = c_form
device = c_printer
language = sy-langu
OPTIONS = w_options
IMPORTING
RESULT = w_res.
LOOP AT i_pa0001 INTO w_pa0001.
Writting into the form
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'MAIN'
window = 'MAIN'.
ENDLOOP.
Closing the form
CALL FUNCTION 'CLOSE_FORM'
IMPORTING
RESULT = w_res
TABLES
otfdata = i_otf
EXCEPTIONS
unopened = 1
bad_pageformat_for_print = 2
send_error = 3
spool_error = 4
codepage = 5
OTHERS = 6.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Converting OTF data to single line
LOOP AT i_otf INTO w_otf.
CONCATENATE w_otf-tdprintcom w_otf-tdprintpar
INTO w_pdf.
APPEND w_pdf TO i_content_txt.
ENDLOOP.
Converting to PDF Format
CALL FUNCTION 'SX_OBJECT_CONVERT_OTF_PDF'
EXPORTING
format_src = c_otf
format_dst = c_pdf
devtype = c_printer
CHANGING
transfer_bin = w_transfer_bin
content_txt = i_content_txt
content_bin = i_content_bin
objhead = i_objhead
len = v_len_in
EXCEPTIONS
err_conv_failed = 1
OTHERS = 2.
v_size = v_len_in.
Downloading the PDF File
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
bin_filesize = v_size
filename = c_name
filetype = c_bin
TABLES
data_tab = i_content_bin.
If you r using this function module check it once....
call function 'CONVERT_OTF'
EXPORTING
format = 'PDF'
max_linewidth = 132
IMPORTING
bin_filesize = v_len_in
TABLES
otf = i_otf
lines = i_tline
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
others = 4.
Fehlerhandling
if sy-subrc <> 0.
endif.
or u can use the standard program RSTXPDFT4 to download the script into PDF format onto a particular location
follow this link for sample program.
http://searchsap.techtarget.com/tip/0,289483,sid21_gci1121833,00.html
check...
How to send smart form via email
/people/pavan.bayyapu/blog/2005/08/30/sending-html-email-from-sap-crmerp
Regards
Anji -
Sending PO in mail attachment with pdf format
Hello,
We are sending PO to vendor in a pdf attachment. The configuration is in place and as soon as the PO(ME22N) is saved the pdf mail is sent to vendor external mail address.
The requirement however is to add some text to this mail body ( in addition to the existing PDF attachment ).
The NACE config is using SAPFM06P program with entry_neu form and a custom sap script.
can somebody help as where is this mail functionality added in this standard program so that I may try to customize the same for the above requirement.
All I can see is 2 FM used in this ENTRY_NEU Form. Of which I guess ME_PRINT_PO is sending the mail ( I may be wrong here ) but where ?
I will be thankful for any kind of hint to help solve this issue.In general you will have to do the following:
1) Set NAST-NACHA = 8 (Special function)
2) Before OPEN_FORM (maybe in In enhancement spot) if NAST-NACHA = 8, then set itcpo-tdgetotf = 'X' (to get OTF back from CLOSE_FORM!)
3) During CLOSE_FORM, if NAST-NACHA = '8', get OTF output from TABLES parameter OTFDATA
4) Convert this OTF output to PDF using following sample code:
data: I_PDF STRUCTURE TLINE occurs 0,
I_OTF i_otf LIKE itcoo OCCURS 0.
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
max_linewidth = 134
IMPORTING
bin_filesize = w_bytes
TABLES
otf = i_otf
lines = i_pdf
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
OTHERS = 4.
5) Send email with PDF attachment using the method(s) mentioned in one of these excellent blogs:
/people/thomas.jung3/blog/2004/09/07/sending-e-mail-from-abap--version-46d-and-lower--api-interface
/people/thomas.jung3/blog/2004/09/08/sending-e-mail-from-abap--version-610-and-higher--bcs-interface
or you can follow below procedure as well:
I suggest you make yourself very familiar with the SAP code that does this automatically. Once you understand the processing sequence SAP uses, it is much easier to add your customization and insert your enhancements. To debug it and step through the code, but a breakpoint in ENTRY_NEU, and process a PO. If you're sending your messages using a scheduled job, you'll hit the breakpoint when you process the message using RSNAST00. That's how I did it. I can tell you what I did to meet my requirements. You can change to meet your needs. It required a custom program, to use instead if ENTRY_NEU, and 3 enhancements to SAP code using the Enhancement Framework. You need to know how to use the framework. 1. configure your output type ZNE2 to to run a new program ZMRP_OUTCTRL, to run form routine ENTRY_ZNE2, to create form Z_PURCHASE_ORDER. 2. In ZMRP_OUTCTRL, call standard function modules, ME_READ_PO_FOR_PRINT and ME_PRINT_PO. 3. Drill down into ME_PRINT_PO to PREPARE_FORMULAR function module. Create new enhancement, and if NAST-KSCHL = ZNE2, then lookup the recipient's email address. Pass it as parameter to ADDR_GET_NEXT_COMM_TYPE. 4. Still in ME_PRINT_PO, PREPARE_FORMULAR, add another enhancement to set the value of itcpo-getotf to u2018Xu2019, to enable CLOSE_FORM to capture OTF data for PDF. Only set this OTF flag when the output is being run by RSNAST00, not when a user is simply previewing the printout. Sy-ucomm will be blank when RSNAST00 is running. 5. In ME_PRINT_PO, drill down to ENDE, and add an enhancement to check for NAST-KSCHL = ZNE2, and if so, call standard SAP function modules to END_FORM, START_FORM, WRITE_FORM, and END_FORM. Next call the function CLOSE_FORM, and set table parameter to capture the OTF_DATA as a table parameter OTF_DATA. 6. If OTF_DATA is found, then: If nast-kschl = 'ZNE2'. if NOT otf_data[] is initial. gs_OTF[] = otf_data[]. CALL FUNCTION 'CONVERT_OTF' EXPORTING format = 'PDF' IMPORTING bin_filesize = v_len_in TABLES otf = gs_otf lines = gt_pdf EXCEPTIONS err_max_linewidth = 1 err_format = 2 err_conv_not_possible = 3 OTHERS = 4. IF SY-SUBRC 0. p_retco = '1'. PERFORM protocol_update USING '303' 'OTF Conversion failed.' 'Output Message Cancelled.' space space. IF 1 = 2. MESSAGE S303(me) with 'OTF Conversion failed.'. ENDIF. EXIT. ENDIF. CALL FUNCTION 'QCE1_CONVERT' TABLES T_SOURCE_TAB = gt_pdf T_TARGET_TAB = outbin. IF SY-SUBRC 0. p_retco = '1'. PERFORM protocol_update USING '303' 'PDF Conversion failed.' 'Output Message Cancelled.' space space. IF 1 = 2. MESSAGE S303(me) with 'PDF Conversion failed.'. ENDIF. EXIT. ENDIF. *get email recipients (this is specific to my requirements) select single banfn ernam zuname1 into (lv_banfn, lv_ernam, lv_zuname ) from eban where ebeln = nast-objky. IF SY-SUBRC 0. p_retco = '1'. PERFORM protocol_update USING '303' 'Requisition Data not found.' 'Output Message Cancelled.' space space. IF 1 = 2. MESSAGE S303(me) with 'Requisition Data not found.'. ENDIF. EXIT. ENDIF. 8. Build your OBJPACK and OBJBIN parameters: describe table mail_content lines lin. read table mail_content index lin. mail_data-doc_size = ( lin - 1 ) * 255 + STRLEN( mail_content ). clear objpack-transf_bin. objpack-head_start = 1. objpack-head_num = 0. objpack-body_start = 1. objpack-body_num = lin. objpack-doc_type = 'TXT'. APPEND objpack. describe table outbin lines lin. read table outbin index lin. objpack-doc_size = ( lin - 1 ) * 255 + strlen( outbin ). objpack-transf_bin = 'X'. objpack-head_start = 1. objpack-head_num = 0. objpack-body_start = 1. objpack-body_num = lin. objpack-doc_type = 'PDF'. objpack-obj_name = 'ATTACHMENT'. objpack-obj_descr = l_descr. APPEND objpack. CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1' EXPORTING DOCUMENT_DATA = mail_data PUT_IN_OUTBOX = 'X' TABLES PACKING_LIST = objpack CONTENTS_BIN = outbin CONTENTS_TXT = mail_content RECEIVERS = receivers 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. p_retco = '1'. PERFORM protocol_update USING '303' 'Send Email function failed.' 'Output Message Cancelled.' space space. IF 1 = 2. MESSAGE S303(me) with 'Send Email function failed.'. ENDIF. EXIT. ENDIF. 9. Call function CLOSE_FORM, and end enhancement
Edited by: Devireddy omkar on Aug 2, 2011 11:15 AM
Edited by: Devireddy omkar on Aug 2, 2011 11:17 AM -
Issue sending picture messages
I have no issue sending or receiving pictures from other people with my S4; however, when I send pictures, I'm regularly told by who I was trying to send it to that it wouldn't come through or wasn't attached. On my end it looks like it when through, though. Some of my AT&T friends receive a message saying the message was deleted. I have the issue with all carriers, including Verizon, and with mulitple different phones. I've checked the Global/LTE mobile data issue and this problem happens when I'm on WiFi and when I'm not. Happens at least half the time. Sometimes, they get it if I resend it, but many times it's a lost cause. Really frustrating...I didn't have this issue with an iPhone, but it's making me want to switch back.
I'm using the original messaging app. I don't have issues using 3rd party applications.
Verizon Wireless Customer Support <[email protected]> wrote:
Verizon Wireless Customer Support created the discussion
"Issue sending picture messages"
To view the discussion, visit: https://community.verizonwireless.com/message/1115855#1115855
> -
Can Not send pictures and documents with my webmail, the link is Not visible on Safari Browser
Hello, i can Not send pictures and documents wit my tele2 webmail, the link to so this is Not visible. I tried Safari, Opera, and Dolphin.
Safari doesn't support the attaching/uploading of files. If you want to send documents or photos that you have stored on the iPad then you can use the Mail app - if you've set up your email account on it, then you should be able to start in the app that contains the document, and then use that app's functionality to select the document and attach it to an email e.g. in the Photos app you can use the icon of the box with the arrow coming out of it to select and email a picture
-
Email with picture as an attachment
hi frnds
is it possible in j2me to send an email with attachment(picture)
if so give me some idea or code regarding the same
and if not help me with some work arround
alpeshhi Mihai
I did this and it's displaying the msg (before converting into bytes)
and also after converting msg into bytes i tried (msg+"\r\n").getBytes() and it displaying bytes means it is not null
also If I am sending mails to gmail or yahoo it gives me the error:
SMTP server response -
220 dnsconsultant (IMail 7.15 2462-1) NT-ESMTP Server X1
250 hello dnsconsultant
250 ok
550 not local host gmail.com, not a gateway
503 No recipient(s).
502 unimplemented command
502 unimplemented command
502 unimplemented command
502 unimplemented command
502 unimplemented command
502 unimplemented command
221 Closing connection. Good bye.
so if I want to send mails to/from any (yahoo, gmail and etc...) e-mail addresses what will be the smtpServerAddress
and is there any other configuraton needed?
alpesh
Maybe you are looking for
-
Email address not showing up in TO box of outlook when a job is run from OBIEE agent
HI Everone, I am running an Agent in OBIEE 11g(11.1.1.5), we are sending report's output as excel/pdf. Jobs are running fine, but we don't see user's email address in TO box of their outlook(inbox). Is there any settings which I can enable, so that a
-
How to set a new session variable?
Hi all, Can anybody say how to set a new session variable in istore?
-
Show description of a material
Hi experts, I am wondering if it's possible to show the description of a material when you introduce the material number and press INTRO. If I change this material number and press INTRO again I would like to refresh the new description. The restrict
-
select * from tablename ------always running,but get nothing select top 1 * from tablename -------get result quickly select top 2 * from tablename -------get result quickly select top 14259 * from tablename ------
-
Will I lose my Itunes Libary? If I delet all authorized computers under my ID?