SNOTE pdf Attachment
HI Experts,
Can anyone send me the attachment present in the website,as i am unable to open this to [email protected]
http://www.sappoint.com/basis/snote.pdf.
Thanks in advance.
This link is not available so you can not download / open file.
Here are details about SNOTE -
Use
Note Assistant (transaction SNOTE) helps you when working with SAP Notes.
After you have loaded the SAP Notes you need into your system, you can automatically implement the corrections (correction instructions) contained in them.
Features
Note Assistant has the following functions:
Reporting
You can display an overview of all existing SAP Notes and their processing status, as well as all implemented corrections.
Project Administration
You can assign SAP Notes to users, who then specify them a processing status. The system informs you if an SAP Note has an inconsistent status.
Logging
The system logs all processing steps.
Correcting Errors
You can automatically implement the corrections (correction instructions) contained in SAP Notes into your system.
Integration
When you import a Support Package or perform out an upgrade, the system automatically recognizes which Notes have been implemented by an imported Support Package or upgrade, and which correction instructions still need to be implemented.
Activities
Your worklist contains SAP Notes in the following categories:
1. SAP Notes that are assigned to you as a user.
2. All SAP Notes that are inconsistent, even if they are assigned to another user.
3. New SAP Notes that are not yet being processed.
Choose Download SAP Note to download Notes using an RFC connection. You can also load SAP Notes from the SAP Service Marketplace and then perform an Upload.
You can use the Note Browser to find any SAP Note in the system.
The note display enables you to read the Note carefully and view changes made to the source code in ABAP programs and other repository objects.
By choosing Check Note, you can check the implementation status.
You can classify the SAP Note and specify the processing status.
You can implement the correction instructions that are contained in the Note and then remove them if necessary.
In the Log, you can display the processing steps and add your own comments.
By choosing Corrected Objects, you can switch to the modification browser, where you can see all the objects that have been corrected by an SAP Note.
After importing a Support Package, you can use Modification Assistant to perform follow-up activities.
To ensure that the SAP Notes in your system are the latest available in the SAP system, choose Download Current Version of SAP Notes. If a newer version of a Note is available, the system downloads it for you.
Loading an SAP Note
Use
You can load SAP Notes in your system. You can do this directly using an RFC connection (SAP Note download) or with the file transfer method (SAP Note upload).
The download method has the following advantages:
● When you download an SAP Note, you can use Note Assistant to load it directly into your system by establishing an RFC connection to SAP.
● If other SAP Notes are entered as prerequisites in an SAP Note, Note Assistant automatically downloads the prerequisite SAP Notes during implementation (Implementing Correction Instructions).
● You can download updated versions of SAP Notes at the press of a button (Updating an SAP Note).
To download an SAP Note, you need to establish an RFC connection to SAP.
You do not require a permanent RFC connection to SAP in order to upload an SAP Note. To upload the note, you first download the required SAP Note from the SAP Service Marketplace and save it locally on your PC. You then upload it using Note Assistant.
Prerequisites
● Note download: You have established an RFC connection. (See Activating Note Assistant)
● Note upload: You have installed the SAP Download Manager, which enables you to load SAP Notes from the SAP Service Marketplace. You can find the SAP Download Manager in SAP Service Marketplace, under service.sap.com/download-basket ® Get Download Manager.
Procedure
SAP Note Download
1. In Note Assistant, choose SAP Note Download.
2. Specify the numbers of the SAP Notes that you want to download.
Use the selection function to load one SAP Note or a list of SAP Notes.
3. Confirm your selection.
The system loads the SAP Notes to your database via the RFC connection.
SAP Note Upload
1. Select the correct SAP Note in the SAP Service Marketplace under service.sap.com/notes.
2. Choose Download.
The SAP Note is added to your download basket. You can repeat this action for as many SAP Notes as you require.
3. To save the SAP Notes locally on your PC, start the SAP Download Manager. Choose Download.
The SAP Notes are loaded as files into the directory you have specified.
4. Use the upload function in Note Assistant (Goto ® Upload SAP Note) to load the SAP Note files into your system.
Result
After you have successfully downloaded or uploaded an SAP Note that did not previously exist in your system, the processing status of this SAP Note in the SAP Note overview is set as new.
Activating Note Assistant
Use
Before you can start using Note Assistant, you need to make some settings in your system.
There are different ways in which you can load SAP Notes into your system. You can download SAP Notes directly using an RFC connection to SAP, or you can use Note Assistant to upload SAP Notes that you have already loaded from SAP Service Marketplace. For information regarding the pros and cons of these different procedures, see Loading an SAP Note.
If you want to download an SAP Note with RFC, you first need to activate an RFC connection.
Procedure
1. Define the system change option (transaction SE03). Set the following:
1. a. For the software components in which you want to implement the SAP Notes, set the status to Restricted modifiability or Modifiable.
2. b. For the general SAP namespace, set the status to Modifiable.
2. If you want to download SAP Notes using an RFC connection, create the RFC connection SAPSNOTE. To do this, first create the RFC connection SAPOSS and then create the RFC connection SAPSNOTE from this.
Procedure:
3. a. Call transaction OSS1. In the standard system, this creates connection SAPOSS.
4. b. Call the configuration screen for RFC connections (transaction SM59).
5. c. Expand the ABAP Connections node and select the connection SAPOSS by double clicking it.
6. d. On the Technical Settings tab page, change the client to OO1. Now select the Logon & Security tab page and enter CPIC as the password for connection SAPOSS. Save your data.
7. e. Choose Connection ® Copy and enter SAPSNOTE as the name of the new destination.
8. f. Change the following parameters in the new RFC connection:
Tab page: Technical Settings
■ Load Distribution: Choose Yes.
■ Target System ID: Enter OSS.
■ Group: Enter 1_PUBLIC.
Tab page: Logon & Security
■ Client: Enter 001.
■ User: Enter OSS_SNOTE.
■ Password: Enter CPIC.
If you want to load SAP Notes from SAP Service Marketplace and then upload them into your system by note upload, then you do not need an RFC connection.
3. If you have already implemented SAP Notes in your system but you did not use Note Assistant, you have to inform the system of the SAP Notes that you implemented manually.
To do this, execute the SCWN_REGISTER_NOTES program with the ABAP Editor (transaction SE38). (See Registering Manually Implemented SAP Notes)
4. To view the note text correctly in Note Assistant, install Adobe Reader Version 7.0.1 or higher on your computer.
Hope this helps.
ashish
Similar Messages
-
Clicking on a pdf attachment in AT&T/Yahoo Mail results in "a file was downloaded". Used to open the file in Firefox 25.0 and prior. Switching to IE I can click on the attachment and it opens. Seems it could be something in 25.0.1. I cleared my history (cache, cookies) but this did not fix the problem. I disabled the pdf viewed and that didn't help either.
i'm not sure as to what exactly is going on, but it looks like yahoo has changed something on their server that makes certain old url formats dysfunctional - at least quite a number of other users have reported that... so if you have a bookmark for yahoo mail, change its address to the generic https://mail.yahoo.com/, which should redirect you to the current & working url
-
Facing problem with logo in the PDF attachment when sending mail...
hi friends,
i'm facing problem with logo in the PDF attachment to the mail.
my requirement:
1. enter spool number and mail id in the selection screen.
process:
1. now the program will fetch the spool data and converts it to PDF.
2. but when i'm trying to send mail with this PDF as attachment.
when i open the PDF file from the mail, logo is not coming properly (looks disturbed).
can anyone help me how to resolve this issue...
thanks in advance, murashali.hi dinakar, thanks for your mail...
logo looks good in spool/script/smartform.
even it look good when i download this spool to pdf and to the presentation server as pdf file.
i'm using CONVERT_OTFSPOOLJOB_2_PDF.
when i used CONVERT_ABAPSPOOLJOB_2_PDF, is gives a msg - 'spool number not found'.
here i'm using folloing code to pass pdf to the function module: SO_NEW_DOCUMENT_ATT_SEND_API1.
code:
Transfer the 132-long strings to 255-long strings
lt_mtab_pdf[] = pdf[].
LOOP AT lt_mtab_pdf INTO lwa_mtab_pdf.
TRANSLATE lwa_mtab_pdf USING ' ~'.
CONCATENATE lv_gd_buffer lwa_mtab_pdf INTO lv_gd_buffer.
CLEAR lwa_mtab_pdf.
ENDLOOP.
TRANSLATE lv_gd_buffer USING '~ '.
DO.
lwa_mess_att = lv_gd_buffer.
APPEND lwa_mess_att TO lt_mess_att.
CLEAR lwa_mess_att.
SHIFT lv_gd_buffer LEFT BY 255 PLACES.
IF lv_gd_buffer IS INITIAL.
EXIT.
ENDIF.
ENDDO.
NOTE: problem i believe is with ''. i'm getting this tilt symbol () in my pdf internal table. here in the above code the line TRANSLATE lv_gd_buffer USING '~ ' is changing the existing tilt to space. so my logo is getting disturbed.
even i tried with REPLACE this tilt with other char, but it doent work.
can you give any idea... -
How can I open a pdf attachment in Mozilla Thunderbird?
In my Thunderbird email account, I checked a box for MSWord to open all attachments, but I would like to reverse that decision since I got a pdf attachment, and MSWord doesn't open that. How do I change it back to the way it was so the pdf attachment can be opened with adobe?
Tools > Options > Attachments > Incoming tab
* in the 'Content Type' column:
* look for: Microsoft Office Word document
* then look at the 'Action' for it
* click on the current Action and select 'use Microsoft Office Word'
If this is already setup ok then leave alone and do the next step.
Is there a 'Content type' for Adobe Acrobat Document' ?
If yes,
* click on the Action and select 'Use Adobe Acrobat' or 'Adobe Reader'
* click on OK
If there is no 'Content type' for Adobe Acrobat Document'
then click on OK and do the next step below.
* Locate email with pdf attachment
* right click on attachment and choose Open
* select 'Open with' and choose 'Adobe Reader'
* select 'do this automatically for files like this from now on.'
* click on OK -
Want to Send smartform as pdf attachment with a Email to some mail id
Hi ,
I want to send a smartform as a PDF attachment with a mail to a mail id. And I can send a mail with the PDF attachment.
But I am not able to open the PDF. It is throwing some error (Adobe reader could not open u2018fileu2019 because it is either not a supported file type or because the file has been damaged (for example , it was sent as an email attachment and was not correctly decoded)).
By debugging I come to know that the file which is generating is in some encoding format.
Please help me regard this. This is very urgent.
here is the code,
Main Program :
REPORT Ztest_report.
*--Top Include for Global Data Declarations.
INCLUDE ztest_report_top.
*--Form Include for Form Routines.
INCLUDE ztest_report_form.
START-OF-SELECTION.
START-OF-SELECTION.
*--Display data
Perform display_data.
END-OF-SELECTION.
Top declaration :
Internal table
DATA : i_otfdata TYPE tsfotf, " Smart Forms: Table OTF
i_tline TYPE TABLE OF tline WITH HEADER LINE,
i_receivers TYPE TABLE OF somlreci1 WITH HEADER LINE,
i_record LIKE solisti1 OCCURS 0 WITH HEADER LINE,
Objects to send mail.
i_objpack LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
i_objtxt LIKE solisti1 OCCURS 0 WITH HEADER LINE,
i_objbin LIKE solisti1 OCCURS 0 WITH HEADER LINE,
i_reclist LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
Work Area declarations
w_mailaddr TYPE ppfdmailad,
w_mailtype TYPE so_escape,
w_mailrecipient TYPE swotobjid,
w_control TYPE ssfctrlop,
w_compop TYPE ssfcompop,
w_return TYPE ssfcrescl,
wa_doc_chng TYPE sodocchgi1,
w_data TYPE sodocchgi1,
wa_buffer TYPE string, "To convert from 132 to 255
wa_objhead TYPE soli_tab,
Variables declarations
v_form_name TYPE rs38l_fnam,
v_len_in LIKE sood-objlen,
v_len_out LIKE sood-objlen,
v_len_outn TYPE i,
v_lines_txt TYPE i,
v_lines_bin TYPE i.
Selection Screen
SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-009.
PARAMETER: p_bukrs TYPE bukrs OBLIGATORY, "Company Code
p_belnr TYPE belnr_d OBLIGATORY, "Document No
p_gjahr TYPE gjahr OBLIGATORY, "document type
p_mailid(50) TYPE c OBLIGATORY.
"Mail Id
SELECTION-SCREEN END OF BLOCK blk1.
Form Logic :
FORM display_data.
*Local Variable declaration
DATA: lc_fm TYPE rs38l_fnam, "local variable to store the
l_i_document_output_info TYPE ssfcrespd,
l_i_struc_job_output_info TYPE ssfcrescl,
l_i_struc_job_output_options TYPE ssfcrescl,
i_lines TYPE TABLE OF tline WITH HEADER LINE,
lv_job_output_info TYPE ssfcrescl,
lv_document_output_info TYPE ssfcrespd,
lv_job_output_options TYPE ssfcresop,
lv_bin_filesize LIKE sood-objlen.
Determine the smartform name
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZTEST_SMARTFORM'
IMPORTING
fm_name = lc_fm
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
w_control-getotf = 'X'.
w_control-no_dialog = 'X'.
w_control-preview = space.
w_control-device = 'MAIL'.
Call the smartform and pass the selection screen parameter
CALL FUNCTION lc_fm
EXPORTING
control_parameters = w_control
output_options = w_compop
user_settings = 'X'
t_bukrs = p_bukrs
t_belnr = p_belnr
t_gjahr = p_gjahr
IMPORTING
job_output_info = l_i_struc_job_output_info
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Moving the Smart Forms: Table OTF into an internal table
i_otfdata[] = l_i_struc_job_output_info-otfdata[].
CONVERT TO OTF TO PDF.
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
max_linewidth = 132
IMPORTING
bin_filesize = lv_bin_filesize
TABLES
otf = i_otfdata
lines = i_lines
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
err_bad_otf = 4
OTHERS = 5.
IF sy-batch EQ l_c_no.
To directly view the print-preview in PDF format
CALL FUNCTION 'SSFCOMP_PDF_PREVIEW'
EXPORTING
i_otf = i_otfdata
EXCEPTIONS
convert_otf_to_pdf_error = 1
cntl_error = 2
OTHERS = 3.
For Sending the PDF file to a Mail ID.
LOOP AT i_lines.
TRANSLATE i_lines USING '~'.
CONCATENATE wa_buffer i_lines INTO wa_buffer.
ENDLOOP.
TRANSLATE wa_buffer USING '~'.
DO.
i_record = wa_buffer.
APPEND i_record.
SHIFT wa_buffer LEFT BY 255 PLACES.
IF wa_buffer IS INITIAL.
EXIT.
ENDIF.
ENDDO.
DATA: BEGIN OF zlines OCCURS 0,
tline TYPE char255,
END OF zlines.
*Change the PDF format from 132 to 255.
CALL FUNCTION 'SX_TABLE_LINE_WIDTH_CHANGE'
EXPORTING
transfer_bin = 'X'
TABLES
content_in = i_lines
content_out = zlines
EXCEPTIONS
err_line_width_src_too_long = 1
err_line_width_dst_too_long = 2
err_conv_failed = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Attachment
REFRESH: i_reclist,
i_objtxt,
i_objbin,
i_objpack.
CLEAR wa_objhead.
i_objbin[] = zlines[].
Create Message Body Title and Description
i_objtxt = 'test with pdf-Attachment!'.
APPEND i_objtxt.
DESCRIBE TABLE i_objtxt LINES v_lines_txt.
READ TABLE i_objtxt INDEX v_lines_txt.
wa_doc_chng-obj_name = 'smartform'.
wa_doc_chng-expiry_dat = sy-datum + 10.
wa_doc_chng-obj_descr = 'smartform'.
wa_doc_chng-sensitivty = 'F'.
wa_doc_chng-doc_size = v_lines_txt * 255.
Main Text
CLEAR i_objpack-transf_bin.
i_objpack-head_start = 1.
i_objpack-head_num = 1.
i_objpack-body_start = 2.
i_objpack-body_num = v_lines_txt.
i_objpack-doc_type = 'RAW'.
APPEND i_objpack.
Attachment (pdf-Attachment)
i_objpack-transf_bin = 'X'.
i_objpack-head_start = 1.
i_objpack-head_num = 1.
i_objpack-body_start = 2.
I_OBJPACK-DOC_TYPE = 'RAW'.
DESCRIBE TABLE i_objbin LINES v_lines_bin.
READ TABLE i_objbin INDEX v_lines_bin.
i_objpack-doc_size = v_lines_bin * 255 .
i_objpack-body_num = v_lines_bin.
i_objpack-doc_type = 'PDF'.
i_objpack-obj_name = 'smart'.
i_objpack-obj_descr = 'test'.
APPEND i_objpack.
CLEAR i_reclist.
i_reclist-receiver = p_mailid.
i_reclist-rec_type = 'U'.
APPEND i_reclist.
Send new document with attachments via RFC
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = wa_doc_chng
put_in_outbox = 'X'
commit_work = 'X'
TABLES
packing_list = i_objpack
object_header = wa_objhead
contents_bin = i_objbin
contents_txt = i_objtxt
receivers = i_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.
WRITE:/ 'Error When Sending the File', sy-subrc.
ELSE.
WRITE:/ 'Mail sent'.
ENDIF.
ENDFORM. " display_datahi,
i wrote a programm.for me it is working.i think it will help for u.
DATA: t_otfdata TYPE ssfcrescl,
t_lines LIKE tline OCCURS 0 WITH HEADER LINE,
t_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,
t_RECORD LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE.
Objects to send mail.
DATA:T_OBJPACK LIKE SOPCKLSTI1 OCCURS 0 WITH HEADER LINE,
T_OBJTXT LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
T_OBJBIN LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
T_RECLIST LIKE SOMLRECI1 OCCURS 0 WITH HEADER LINE.
DATA: w_filesize TYPE i,
w_bin_filesize TYPE i,
wa_ctrlop TYPE ssfctrlop,
wa_outopt TYPE ssfcompop,
WA_BUFFER TYPE STRING, "To convert from 132 to 255
WA_OBJHEAD TYPE SOLI_TAB,
WA_DOC_CHNG TYPE SODOCCHGI1,
W_DATA TYPE SODOCCHGI1.
DATA: form_name TYPE rs38l_fnam,
V_LINES_TXT TYPE I,
V_LINES_BIN TYPE I,
nast-spras type sy-langu value 'DE'.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'ZSR_DEMO1'
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
FM_NAME = form_name
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
wa_ctrlop-LANGU = nast-spras.
wa_ctrlop-getotf = 'X'.
wa_ctrlop-no_dialog = 'X'.
wa_outopt-tdnoprev = 'X'.
CALL FUNCTION form_name
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS = wa_ctrlop
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS = wa_outopt
USER_SETTINGS = 'X'
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO = t_otfdata
JOB_OUTPUT_OPTIONS =
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
t_otf[] = t_otfdata-otfdata[].
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
FORMAT = 'PDF'
MAX_LINEWIDTH = 132
ARCHIVE_INDEX = ' '
COPYNUMBER = 0
ASCII_BIDI_VIS2LOG = ' '
PDF_DELETE_OTFTAB = ' '
IMPORTING
BIN_FILESIZE = w_bin_filesize
BIN_FILE =
TABLES
OTF = t_otf
LINES = t_lines
EXCEPTIONS
ERR_MAX_LINEWIDTH = 1
ERR_FORMAT = 2
ERR_CONV_NOT_POSSIBLE = 3
ERR_BAD_OTF = 4
OTHERS = 5
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
loop at t_lines.
TRANSLATE t_lines USING '~'.
CONCATENATE WA_BUFFER T_LINES INTO WA_BUFFER.
ENDLOOP.
TRANSLATE WA_BUFFER USING '~'.
DO.
t_RECORD = WA_BUFFER.
APPEND t_RECORD.
SHIFT WA_BUFFER LEFT BY 255 PLACES.
IF WA_BUFFER IS INITIAL.
EXIT.
ENDIF.
ENDDO.
Attachment
REFRESH: T_RECLIST,
T_OBJTXT,
T_OBJBIN,
T_OBJPACK.
CLEAR WA_OBJHEAD.
T_OBJBIN[] = T_RECORD[].
Create Message Body Title and Description
T_OBJTXT = 'test with pdf-Attachment!'.
APPEND T_OBJTXT.
DESCRIBE TABLE T_OBJTXT LINES V_LINES_TXT.
READ TABLE T_OBJTXT INDEX V_LINES_TXT.
WA_DOC_CHNG-OBJ_NAME = 'smartform'.
WA_DOC_CHNG-EXPIRY_DAT = SY-DATUM + 10.
WA_DOC_CHNG-OBJ_DESCR = 'smartform'.
WA_DOC_CHNG-SENSITIVTY = 'F'.
WA_DOC_CHNG-DOC_SIZE = V_LINES_TXT * 255.
Main Text
CLEAR T_OBJPACK-TRANSF_BIN.
T_OBJPACK-HEAD_START = 1.
T_OBJPACK-HEAD_NUM = 0.
T_OBJPACK-BODY_START = 1.
T_OBJPACK-BODY_NUM = V_LINES_TXT.
T_OBJPACK-DOC_TYPE = 'RAW'.
APPEND T_OBJPACK.
Attachment (pdf-Attachment)
T_OBJPACK-TRANSF_BIN = 'X'.
T_OBJPACK-HEAD_START = 1.
T_OBJPACK-HEAD_NUM = 0.
T_OBJPACK-BODY_START = 1.
DESCRIBE TABLE T_OBJBIN LINES V_LINES_BIN.
READ TABLE T_OBJBIN INDEX V_LINES_BIN.
T_OBJPACK-DOC_SIZE = V_LINES_BIN * 255 .
T_OBJPACK-BODY_NUM = V_LINES_BIN.
T_OBJPACK-DOC_TYPE = 'PDF'.
T_OBJPACK-OBJ_NAME = 'smart'.
T_OBJPACK-OBJ_DESCR = 'test'.
APPEND T_OBJPACK.
CLEAR T_RECLIST.
T_RECLIST-RECEIVER = 'mail id'.
T_RECLIST-REC_TYPE = 'U'.
APPEND T_RECLIST.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
DOCUMENT_DATA = WA_DOC_CHNG
PUT_IN_OUTBOX = 'X'
COMMIT_WORK = 'X'
TABLES
PACKING_LIST = T_OBJPACK
OBJECT_HEADER = WA_OBJHEAD
CONTENTS_BIN = T_OBJBIN
CONTENTS_TXT = T_OBJTXT
RECEIVERS = T_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.
WRITE:/ 'Error When Sending the File', SY-SUBRC.
ELSE.
WRITE:/ 'Mail sent'.
ENDIF.
please reward me if helpful. -
Email PDF attachment not opening error
Hi All,
I am sending the PDF attachment through email when i get the mail and opening the attachment the PDF says "A drawing error occurred'. Can any one tell me how to solve this problem.
i am doing otf to pdf conversion and the populate all the field related to the email.
Is there any specific solution for this error.
Regards,
LakshmikanthHi All,
I am sending the PDF attachment through email when i get the mail and opening the attachment the PDF says "A drawing error occurred'. Can any one tell me how to solve this problem.
i am doing otf to pdf conversion and the populate all the field related to the email.
Is there any specific solution for this error.
Regards,
Lakshmikanth -
Dunning letter (email) PDF attachment or body of email
Hi experts,
What is the industry practice for dunning letters when sent via email? Attach them as a pdf to the email, or add all the content of the dunning letter to the body of the email to make it easier for the customer to receive the message?
Thanks,
MarioHi Mario,
It all depends on the functionality that and payment option that are provided.
If the dunning letters contains and payment/remittance slip(through which customer can make payment in bank, outlet or post office) than the letter should go as PDF attached to mail with body saying that its the reminder for payment being missed,
But if the payment option is not like as described above than you can send the the letter in html body mail.
Regards -
Email Invoices to customer as a PDF attachment
Hi,
I have a requirement as follows:-
SAP will get multiple invoice numbers from an external system. I need to send all the invoices(for a given customer) in one pdf and email it to the customer as an attachment.
Please provide your expert and detailed advice.
Thanks,
AniHi Ani,
Go through this u definetly got ur solution.
Here is the code to send the Smartform to mail as PDF attachment.
*& Report ZTEST_NREDDY_PDF_MAIL
REPORT ZTEST_NREDDY_PDF_MAIL.
Internal Table declarations
DATA: I_OTF TYPE ITCOO OCCURS 0 WITH HEADER LINE,
I_TLINE TYPE TABLE OF TLINE WITH HEADER LINE,
I_RECEIVERS TYPE TABLE OF SOMLRECI1 WITH HEADER LINE,
I_RECORD LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
Objects to send mail.
I_OBJPACK LIKE SOPCKLSTI1 OCCURS 0 WITH HEADER LINE,
I_OBJTXT LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
I_OBJBIN LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
I_RECLIST LIKE SOMLRECI1 OCCURS 0 WITH HEADER LINE,
Work Area declarations
WA_OBJHEAD TYPE SOLI_TAB,
W_CTRLOP TYPE SSFCTRLOP,
W_COMPOP TYPE SSFCOMPOP,
W_RETURN TYPE SSFCRESCL,
WA_DOC_CHNG TYPE SODOCCHGI1,
W_DATA TYPE SODOCCHGI1,
WA_BUFFER TYPE STRING, "To convert from 132 to 255
Variables declarations
V_FORM_NAME TYPE RS38L_FNAM,
V_LEN_IN LIKE SOOD-OBJLEN,
V_LEN_OUT LIKE SOOD-OBJLEN,
V_LEN_OUTN TYPE I,
V_LINES_TXT TYPE I,
V_LINES_BIN TYPE I.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'ZTEST'
IMPORTING
FM_NAME = V_FORM_NAME
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
W_CTRLOP-GETOTF = 'X'.
W_CTRLOP-NO_DIALOG = 'X'.
W_COMPOP-TDNOPREV = 'X'.
CALL FUNCTION V_FORM_NAME
EXPORTING
CONTROL_PARAMETERS = W_CTRLOP
OUTPUT_OPTIONS = W_COMPOP
USER_SETTINGS = 'X'
IMPORTING
JOB_OUTPUT_INFO = W_RETURN
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
I_OTF[] = W_RETURN-OTFDATA[].
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.
IF SY-SUBRC <> 0.
ENDIF.
LOOP AT I_TLINE.
TRANSLATE I_TLINE USING '~'.
CONCATENATE WA_BUFFER I_TLINE INTO WA_BUFFER.
ENDLOOP.
TRANSLATE WA_BUFFER USING '~'.
DO.
I_RECORD = WA_BUFFER.
APPEND I_RECORD.
SHIFT WA_BUFFER LEFT BY 255 PLACES.
IF WA_BUFFER IS INITIAL.
EXIT.
ENDIF.
ENDDO.
Attachment
REFRESH: I_RECLIST,
I_OBJTXT,
I_OBJBIN,
I_OBJPACK.
CLEAR WA_OBJHEAD.
I_OBJBIN[] = I_RECORD[].
Create Message Body Title and Description
I_OBJTXT = 'test with pdf-Attachment!'.
APPEND I_OBJTXT.
DESCRIBE TABLE I_OBJTXT LINES V_LINES_TXT.
READ TABLE I_OBJTXT INDEX V_LINES_TXT.
WA_DOC_CHNG-OBJ_NAME = 'smartform'.
WA_DOC_CHNG-EXPIRY_DAT = SY-DATUM + 10.
WA_DOC_CHNG-OBJ_DESCR = 'smartform'.
WA_DOC_CHNG-SENSITIVTY = 'F'.
WA_DOC_CHNG-DOC_SIZE = V_LINES_TXT * 255.
Main Text
CLEAR I_OBJPACK-TRANSF_BIN.
I_OBJPACK-HEAD_START = 1.
I_OBJPACK-HEAD_NUM = 0.
I_OBJPACK-BODY_START = 1.
I_OBJPACK-BODY_NUM = V_LINES_TXT.
I_OBJPACK-DOC_TYPE = 'RAW'.
APPEND I_OBJPACK.
Attachment (pdf-Attachment)
I_OBJPACK-TRANSF_BIN = 'X'.
I_OBJPACK-HEAD_START = 1.
I_OBJPACK-HEAD_NUM = 0.
I_OBJPACK-BODY_START = 1.
DESCRIBE TABLE I_OBJBIN LINES V_LINES_BIN.
READ TABLE I_OBJBIN INDEX V_LINES_BIN.
I_OBJPACK-DOC_SIZE = V_LINES_BIN * 255 .
I_OBJPACK-BODY_NUM = V_LINES_BIN.
I_OBJPACK-DOC_TYPE = 'PDF'.
I_OBJPACK-OBJ_NAME = 'smart'.
I_OBJPACK-OBJ_DESCR = 'test'.
APPEND I_OBJPACK.
CLEAR I_RECLIST.
I_RECLIST-RECEIVER = '[email protected]'.
I_RECLIST-REC_TYPE = 'U'.
APPEND I_RECLIST.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
DOCUMENT_DATA = WA_DOC_CHNG
PUT_IN_OUTBOX = 'X'
COMMIT_WORK = 'X'
TABLES
PACKING_LIST = I_OBJPACK
OBJECT_HEADER = WA_OBJHEAD
CONTENTS_BIN = I_OBJBIN
CONTENTS_TXT = I_OBJTXT
RECEIVERS = I_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.
WRITE:/ 'Error When Sending the File', SY-SUBRC.
ELSE.
WRITE:/ 'Mail sent'.
ENDIF.
If you want to send some text as Body of the Mail then follow this once
when u r callin the FM'SO_NEW_DOCUMENT_ATT_SEND_API1'.. points to remember
1.u have to pass the body of content in table CONTENTS_TXT(ia m using I_OBJBIN) (each line a record) then. suppose i have appended 11 records to the table CONTENTS_TXT .
2.PACKING_LIST(iam usign I_OBJPACK) table u ahve to append a redord as follows
I_OBJPACK-TRANSF_BIN = ' '.
I_OBJPACK-HEAD_START = 000000000000001.
I_OBJPACK-HEAD_NUM = 000000000000001.
I_OBJPACK-BODY_START = 000000000000002
I_OBJPACK-BODY_NUM = 000000000000010.
I_OBJPACK-DOC_TYPE = 'RAW'.
append I_OBJPACK-.
by the above code system treat the first line in table I_OBJBIN as header and the 2nd line to 10 lines tread as body.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
DOCUMENT_DATA = WA_DOC_CHNG
PUT_IN_OUTBOX = 'X'
TABLES
PACKING_LIST = I_OBJPACK
OBJECT_HEADER = WA_OBJHEAD
CONTENTS_BIN = I_OBJBIN
CONTENTS_TXT = I_OBJTXT
RECEIVERS = I_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.
Reward points if helpful.
Thanks
Naveen khan -
Sending an email of the layout in PDF attachement
Hello All,
I have written a program to send the layout in PDF format to send in a mail to the customer.
The email is going fne with the PDF attachement in the development box, but it is not working in Quality box.
In the Quality box the email is going but the attachement is not opening.
I have used CONVERT_OTF function module for converting OTF format to PDF format. As per my analysis it is returning the PDF format properly in Developement box but not the same in Quality. In Quality the the data returning in PDF format is not in proper manner. It is giving some junk data with symbols like traingle, rectange..etc..
I am using FM SO_OBJECT_SEND for sending an email.
Can you please suggest me what may be problem?
Valuable answers will be rewarded.
Thanks & Regards,
Satish.Hi,
you need to save the File in PDF format not in the text format.
check whether the file is saved in pdf format or not.
Regards,
Raj. -
STO mail : pdf attachment has an error 'file damage' when try to open it
Dear expert,
I need to send an e-mail to the vendor with the sto list as attachment at the email.
I managed to send email to external addresee and made the pdf attachment, BUT somehow when I open the attachment it has an error says "Adobe Reader could not open xx.pdf because it is either not a supported file type or because the file has been damaged(for axample, it was sent as an email attachment and wasn't corectly decoded)."
Really need your experties to help me. Here is my abap coding to send email and do the pdf attachment at the new ouptput type to send email.
TYPES: BEGIN OF lty_drad,
doknr TYPE drad-doknr,
END OF lty_drad,
BEGIN OF lty_recpt,
smtp_addr TYPE ad_smtpadr,
END OF lty_recpt.
DATA: lt_doc TYPE STANDARD TABLE OF docs,
lt_recpt TYPE STANDARD TABLE OF lty_recpt,
lt_tline LIKE tline OCCURS 0 WITH HEADER LINE,
lt_data TYPE solix_tab,
lt_docu TYPE STANDARD TABLE OF lty_drad,
lt_docfiles TYPE STANDARD TABLE OF bapi_doc_files2,
lw_tline LIKE LINE OF lt_tline,
lw_docu LIKE LINE OF lt_docu,
lw_docfiles LIKE LINE OF lt_docfiles,
lw_objdes TYPE tnati-objdes,
lt_text TYPE bcsy_text,
lw_recpt TYPE adr6-smtp_addr,
lw_adrnr TYPE lfa1-adrnr,
lw_object TYPE drad-objky,
lw_doknr TYPE drad-doknr,
lw_return TYPE bapiret2,
lw_xcontent TYPE xstring,
client TYPE REF TO if_http_client,
url TYPE string,
lw_subrc TYPE sysubrc,
response TYPE REF TO if_http_response,
lw_message1 TYPE string,
sent_to_all TYPE os_boolean,
bin_filesize type i.
CONSTANTS: lc_dokar_srm TYPE drad-dokar VALUE 'SRM',
lc_type TYPE so_obj_tp VALUE 'RAW'.
CLASS-DEFINITIONS
DATA: send_request TYPE REF TO cl_bcs.
DATA: document TYPE REF TO cl_document_bcs.
DATA: sender TYPE REF TO cl_sapuser_bcs.
DATA: recipient TYPE REF TO if_recipient_bcs.
DATA: exception_info TYPE REF TO if_os_exception_info,
bcs_exception TYPE REF TO cx_bcs.
RANGES: lr_po_pr FOR drad-objky.
DATA: lw_banfn TYPE ekpo-banfn,
lw_bnfpo TYPE ekpo-bnfpo.
IF nast-nacha = '5'. "8
Create recipient and check if exist
Get email ID
start commented by sapnislina 21.12.06
SELECT SINGLE adrnr FROM lfa1 INTO lw_adrnr
WHERE lifnr = p_ekko-lifnr.
IF sy-subrc NE 0.
PERFORM protocol_update
USING '303' 'Address of Vendor:' ekko-lifnr 'not found' space
p_retco = sy-subrc.
EXIT.
ENDIF.
end commented by sapnislina 21.12.06
SELECT smtp_addr INTO CORRESPONDING FIELDS OF TABLE lt_recpt
FROM adr6
WHERE addrnumber = p_ekko-adrnr. "lw_adrnr.
IF lt_recpt[] IS INITIAL.
PERFORM protocol_update
USING '303' 'Email address(es) does not exist for vendor'
p_ekko-lifnr space space.
p_retco = sy-subrc.
EXIT.
ENDIF.
CALL FUNCTION 'CONVERT_OTF_2_PDF'
EXPORTING
use_otf_mc_cmd = 'X'
IMPORTING
bin_filesize = bin_filesize
TABLES
otf = otfdata[]
doctab_archive = lt_doc
lines = lt_tline
EXCEPTIONS
err_conv_not_possible = 1
err_otf_mc_noendmarker = 2
OTHERS = 3.
IF sy-subrc <> 0.
PERFORM protocol_update
USING '303' 'PO Convertion from OTF to PDF failed'
space space space.
p_retco = sy-subrc.
EXIT.
ENDIF.
Get object description from mail title of output types
SELECT SINGLE objdes INTO lw_objdes
FROM tnati
WHERE spras = sy-langu
AND kappl = nast-kappl
AND kschl = nast-kschl.
CONCATENATE lw_objdes ekko-ebeln INTO lw_objdes SEPARATED BY
space
DATA L_TXT(255) TYPE C.
DATA L_TXT2(255) TYPE C.
CONCATENATE 'STO' EKPO-EBELN 'Created for' EKPO-WERKS '/'
EKPO-LGORT
'Supply Plant' EKKO-RESWK into l_txt separated by space.
lw_objdes = l_txt.
CONCATENATE 'STO' EKKO-EBELN INTO L_TXT2 SEPARATED BY SPACE.
APPEND L_TXT2 TO LT_TEXT.
APPEND lw_objdes TO lt_text.
Instantiate
CLASS cl_cam_address_bcs DEFINITION LOAD.
CLASS cl_abap_char_utilities DEFINITION LOAD.
insert by sapnislina 22.12.06
DATA : CONTENT_OUT TYPE SOLIX,
LINE_WIDTH_SRC TYPE I,
POS_OUT TYPE I,
POS_IN TYPE I,
LEN_OUT TYPE I.
DATA OBJBIN LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE.
DATA : BEGIN OF CONTENT_IN,
LINE TYPE TLINE,
DUMMY TYPE TLINE,
END OF CONTENT_IN.
TYPES PDF_RAW TYPE X LENGTH 268.
FIELD-SYMBOLS <PDF_BIN> TYPE PDF_RAW.
DESCRIBE FIELD CONTENT_IN-LINE LENGTH LINE_WIDTH_SRC IN BYTE MODE.
REFRESH lt_data.
CLEAR CONTENT_OUT.
POS_OUT = 0.
LOOP AT OTFDATA INTO CONTENT_IN-LINE.
ASSIGN CONTENT_IN TO <PDF_BIN> CASTING.
MOVE <PDF_BIN> TO CONTENT_OUT-LINE+POS_OUT.
ADD LINE_WIDTH_SRC TO POS_OUT.
WHILE POS_OUT >= 255.
APPEND CONTENT_OUT TO lt_data.
CLEAR CONTENT_OUT.
SUBTRACT 255 FROM POS_OUT.
IF POS_OUT > 0.
POS_IN = LINE_WIDTH_SRC - POS_OUT.
MOVE <PDF_BIN>+POS_IN TO CONTENT_OUT-LINE.
ENDIF.
ENDWHILE.
ENDLOOP.
IF POS_OUT > 0.
APPEND CONTENT_OUT TO lt_data.
ENDIF.
end inserted by sapnislina 22.12.06
starting to create attachment to mail
TRY.
CLEAR send_request .
Create persistent send request
send_request = cl_bcs=>create_persistent( ).
Build the document
document = cl_document_bcs=>create_document(
i_type = lc_type "RAW
i_text = lt_text "def of output type
i_length = '12'
i_subject = lw_objdes ).
Attached the document object
CALL METHOD document->add_attachment
EXPORTING
i_attachment_type = 'PDF'
i_attachment_subject = lw_objdes "definition of output
type
i_attachment_size = '12'
i_att_content_hex = lt_data.
completed first part to attached PO (pdf format) as attachment
Now attach the PO related attachments to the mail..
.... need to read from table DRAD and get all the attachment per PO
at run time
REFRESH: lr_po_pr."lt_return.
CLEAR: lr_po_pr,lw_return.
MOVE 'ICP' TO lr_po_pr.
CLEAR: lw_object.
completed second part for PO related attachments
Now prepare to send mail
Add document to send request
CALL METHOD send_request->set_document( document ).
Get sender object
sender = cl_sapuser_bcs=>create( sy-uname ).
Add sender
CALL METHOD send_request->set_sender
EXPORTING
i_sender = sender.
LOOP AT lt_recpt INTO lw_recpt
WHERE NOT smtp_addr IS INITIAL.
recipient = cl_cam_address_bcs=>create_internet_address(
lw_recpt ).
Add recipient with its respective attributes to send request
CALL METHOD send_request->add_recipient
EXPORTING
i_recipient = recipient
i_express = 'X'.
CLEAR recipient.
ENDLOOP.
Send the document
CALL METHOD send_request->send
RECEIVING
result = sent_to_all.
Catch any exception
CATCH cx_bcs INTO bcs_exception.
CALL FUNCTION 'NAST_PROTOCOL_UPDATE'
EXPORTING
msg_arbgb = bcs_exception->msgid
msg_nr = bcs_exception->msgno
msg_ty = bcs_exception->msgty
msg_v1 = bcs_exception->msgv1
msg_v2 = bcs_exception->msgv2
msg_v3 = bcs_exception->msgv3
msg_v4 = bcs_exception->msgv4
EXCEPTIONS
OTHERS = 1.
p_retco = sy-subrc.
ENDTRY.
ENDIF.
IF NOT result-tdfaxid IS INITIAL OR " 422131
NOT result-tdmailid IS INITIAL. " 422131
CLEAR syst-msgv1. " 422131
IF NOT result-tdfaxid IS INITIAL. " 422131
syst-msgv1 = result-tdfaxid. " 422131
ELSEIF result-tdmailid IS INITIAL. " 422131
syst-msgv1 = result-tdmailid. " 422131
ENDIF. " 422131
CALL FUNCTION 'NAST_PROTOCOL_UPDATE' " 422131
EXPORTING " 422131
msg_arbgb = 'VN' " 422131
msg_nr = '095' " 422131
msg_ty = 'I' " 422131
msg_v1 = syst-msgv1 " 422131
EXCEPTIONS " 422131
OTHERS = 1. " 422131
ENDIF. " 422131
IF result-userexit EQ 'C' OR
result-userexit EQ 'E'.
p_retco = '9'.
ENDIF.
ENDFORM. " ENDE
end inserted
Regards
NislinaHi Nislina,
Could you please let me know how do you solve this issue.
Code:
if lt_binary[] is not initial.
* add attachment to document
call method document->add_attachment
exporting
i_attachment_type = 'PDF'
i_attachment_subject = 'My Attachment'
i_att_content_hex = lt_binary.
endif.
Thanks & Regard's
Sateesh -
Problem in sending online interactive form in email as PDF attachment
Hi,
I am trying to send online intercative forms as PDF attachment once user fills it and click on send button. But this mail i am trying to send from SAP workflow. For this am using one function module which is accepting the pdfsource context attribute of binary type as Xstring. Once i run the webdynpro application i am getting mail in out look but when i open the attachment i am getting error file is damaged.
Can you pls help me in solving this, Or any other way for doing the same.
Here is the code i am using for triggering the RFC from WD
Zsend_Mail_Attachment_Sev_Input mail = new Zsend_Mail_Attachment_Sev_Input();
//to capture the outplacement level entered in the form
mail.setI_Out_Place_Level(wdContext.currentVn_severancedetailsElement().getVa_outplacement_level().getBytes());
mail.setI_Bin_Data(wdContext.currentContextElement().getPdfSource());
wdContext.nodeZsend_Mail_Attachment_Sev_Input().bind(mail);
try
wdContext.currentZsend_Mail_Attachment_Sev_InputElement().modelObject().execute();
wdComponentAPI.getMessageManager().reportSuccess("Notification Sent Successfully.");
catch (WDDynamicRFCExecuteException e)
// TODO Auto-generated catch block
wdComponentAPI.getMessageManager().reportSuccess(" This is inside the mail exception!!"+e);
e.printStackTrace();
Here is the function module code
FUNCTION ZSEND_MAIL_ATTACHMENT_SEV.
""Local Interface:
*" IMPORTING
*" VALUE(I_OUT_PLACE_LEVEL) TYPE XSTRING OPTIONAL
*" VALUE(I_BIN_DATA) TYPE XSTRING OPTIONAL
*" TABLES
*" T_V_BIN_DATA STRUCTURE SOLISTI1
*" IT_MESSAGE STRUCTURE SOLISTI1
Data Declaration
DATA: gd_cnt TYPE i,
gd_sent_all(1) TYPE c,
gd_error TYPE sy-subrc,
tab_lines LIKE sy-tabix,
v_subject(255) VALUE 'HI'.
Structure Declaration
DATA : BEGIN OF it_file OCCURS 0,
row(255),
END OF it_file.
DATA : BEGIN OF i_split OCCURS 0,
row(50),
END OF i_split.
DESCRIBE TABLE it_message LINES tab_lines.
READ TABLE it_message INDEX tab_lines.
Internal Table Declaration
data : it_receivers like table of SOMLRECI1 with header line."occurs 0.
DATA : objbin LIKE SOLIX OCCURS 0 WITH HEADER LINE.
DATA : it_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE.
data : wa_receiver like table of SOMLRECI1 with header line.
data : it_receiver like table of SOMLRECI1 with header line.
DATA : gd_doc_data LIKE sodocchgi1 OCCURS 0 WITH HEADER LINE.
REFRESH : objbin, it_packing_list, it_receivers, wa_receiver.
CLEAR : objbin, it_packing_list, wa_receiver, it_receivers.
gd_doc_data-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( it_message ).
gd_doc_data-obj_langu = sy-langu.
gd_doc_data-obj_name = 'SENDFILE'.
gd_doc_data-obj_descr = v_subject.
gd_doc_data-sensitivty = 'O'.
APPEND GD_DOC_DATA.
Appending The Internal Table it_packing_list
it_packing_list-head_start = 1.
it_packing_list-head_num = 0.
it_packing_list-body_start = 1.
it_packing_list-doc_type = 'RAW'.
it_packing_list-body_num = tab_lines.
APPEND it_packing_list.
move i_bin_data to t_v_bin_data.
********Add By Anuj
APPEND t_v_bin_data.
********End Add By Anuj
LOOP AT t_v_bin_data.
MOVE t_v_bin_data TO objbin-line.
APPEND objbin.
ENDLOOP.
CLEAR it_packing_list.
DESCRIBE TABLE objbin LINES tab_lines.
it_packing_list-transf_bin = 'X'.
it_packing_list-head_start = 1.
it_packing_list-head_num = 1.
it_packing_list-body_start = 1.
it_packing_list-doc_type = 'PDF'.
it_packing_list-body_num = tab_lines.
it_packing_list-doc_size = tab_lines * 255.
APPEND it_packing_list.
wa_receiver-receiver = '[email protected]'.
wa_receiver-rec_type = 'U'.
wa_receiver-com_type = 'INT'.
APPEND wa_receiver.
move wa_receiver[] to it_receiver[].
append it_receiver.
*Appending The Internal Table it_receivers
wa_receiver-receiver = '[email protected]'.
wa_receiver-rec_type = 'U'.
wa_receiver-com_type = 'INT'.
APPEND wa_receiver.
move wa_receiver[] to it_receiver[].
append it_receiver.
wa_receiver-receiver = '[email protected]'.
wa_receiver-rec_type = 'U'.
wa_receiver-com_type = 'INT'.
APPEND wa_receiver.
move wa_receiver[] to it_receiver[].
append it_receiver.
wa_receiver-receiver = '[email protected]'.
wa_receiver-rec_type = 'U'.
wa_receiver-com_type = 'INT'.
APPEND wa_receiver.
move wa_receiver[] to it_receiver[].
append it_receiver.
wa_receiver-receiver = '[email protected]'.
wa_receiver-rec_type = 'U'.
wa_receiver-com_type = 'INT'.
APPEND wa_receiver.
wa_receiver-receiver = '[email protected]'.
wa_receiver-rec_type = 'U'.
wa_receiver-com_type = 'INT'.
APPEND wa_receiver.
move wa_receiver to it_receiver.
append it_receiver.
Move wa_receiver[] to it_receivers[].
Clear it_receivers.
if i_OUT_PLACE_LEVEL NE 0.
loop at it_receivers into wa_receiver.
loop at it_receivers into wa_receiver.
*Function Module To Post The Message To Externa Mail
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = gd_doc_data
put_in_outbox = 'X'
commit_work = 'X'
TABLES
packing_list = it_packing_list
contents_hex = objbin
receivers = it_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.
clear wa_receiver.
endloop.
elseif i_OUT_PLACE_LEVEL eq 0.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = gd_doc_data
put_in_outbox = 'X'
commit_work = 'X'
TABLES
packing_list = it_packing_list
contents_hex = objbin
receivers = it_receiver
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.
clear wa_receiver.
endif.
ENDFUNCTION.
Regards
RavindraHi,
I am trying to send online intercative forms as PDF attachment once user fills it and click on send button. But this mail i am trying to send from SAP workflow. For this am using one function module which is accepting the pdfsource context attribute of binary type as Xstring. Once i run the webdynpro application i am getting mail in out look but when i open the attachment i am getting error file is damaged.
Can you pls help me in solving this, Or any other way for doing the same.
Here is the code i am using for triggering the RFC from WD
Zsend_Mail_Attachment_Sev_Input mail = new Zsend_Mail_Attachment_Sev_Input();
//to capture the outplacement level entered in the form
mail.setI_Out_Place_Level(wdContext.currentVn_severancedetailsElement().getVa_outplacement_level().getBytes());
mail.setI_Bin_Data(wdContext.currentContextElement().getPdfSource());
wdContext.nodeZsend_Mail_Attachment_Sev_Input().bind(mail);
try
wdContext.currentZsend_Mail_Attachment_Sev_InputElement().modelObject().execute();
wdComponentAPI.getMessageManager().reportSuccess("Notification Sent Successfully.");
catch (WDDynamicRFCExecuteException e)
// TODO Auto-generated catch block
wdComponentAPI.getMessageManager().reportSuccess(" This is inside the mail exception!!"+e);
e.printStackTrace();
Here is the function module code
FUNCTION ZSEND_MAIL_ATTACHMENT_SEV.
""Local Interface:
*" IMPORTING
*" VALUE(I_OUT_PLACE_LEVEL) TYPE XSTRING OPTIONAL
*" VALUE(I_BIN_DATA) TYPE XSTRING OPTIONAL
*" TABLES
*" T_V_BIN_DATA STRUCTURE SOLISTI1
*" IT_MESSAGE STRUCTURE SOLISTI1
Data Declaration
DATA: gd_cnt TYPE i,
gd_sent_all(1) TYPE c,
gd_error TYPE sy-subrc,
tab_lines LIKE sy-tabix,
v_subject(255) VALUE 'HI'.
Structure Declaration
DATA : BEGIN OF it_file OCCURS 0,
row(255),
END OF it_file.
DATA : BEGIN OF i_split OCCURS 0,
row(50),
END OF i_split.
DESCRIBE TABLE it_message LINES tab_lines.
READ TABLE it_message INDEX tab_lines.
Internal Table Declaration
data : it_receivers like table of SOMLRECI1 with header line."occurs 0.
DATA : objbin LIKE SOLIX OCCURS 0 WITH HEADER LINE.
DATA : it_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE.
data : wa_receiver like table of SOMLRECI1 with header line.
data : it_receiver like table of SOMLRECI1 with header line.
DATA : gd_doc_data LIKE sodocchgi1 OCCURS 0 WITH HEADER LINE.
REFRESH : objbin, it_packing_list, it_receivers, wa_receiver.
CLEAR : objbin, it_packing_list, wa_receiver, it_receivers.
gd_doc_data-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( it_message ).
gd_doc_data-obj_langu = sy-langu.
gd_doc_data-obj_name = 'SENDFILE'.
gd_doc_data-obj_descr = v_subject.
gd_doc_data-sensitivty = 'O'.
APPEND GD_DOC_DATA.
Appending The Internal Table it_packing_list
it_packing_list-head_start = 1.
it_packing_list-head_num = 0.
it_packing_list-body_start = 1.
it_packing_list-doc_type = 'RAW'.
it_packing_list-body_num = tab_lines.
APPEND it_packing_list.
move i_bin_data to t_v_bin_data.
********Add By Anuj
APPEND t_v_bin_data.
********End Add By Anuj
LOOP AT t_v_bin_data.
MOVE t_v_bin_data TO objbin-line.
APPEND objbin.
ENDLOOP.
CLEAR it_packing_list.
DESCRIBE TABLE objbin LINES tab_lines.
it_packing_list-transf_bin = 'X'.
it_packing_list-head_start = 1.
it_packing_list-head_num = 1.
it_packing_list-body_start = 1.
it_packing_list-doc_type = 'PDF'.
it_packing_list-body_num = tab_lines.
it_packing_list-doc_size = tab_lines * 255.
APPEND it_packing_list.
wa_receiver-receiver = '[email protected]'.
wa_receiver-rec_type = 'U'.
wa_receiver-com_type = 'INT'.
APPEND wa_receiver.
move wa_receiver[] to it_receiver[].
append it_receiver.
*Appending The Internal Table it_receivers
wa_receiver-receiver = '[email protected]'.
wa_receiver-rec_type = 'U'.
wa_receiver-com_type = 'INT'.
APPEND wa_receiver.
move wa_receiver[] to it_receiver[].
append it_receiver.
wa_receiver-receiver = '[email protected]'.
wa_receiver-rec_type = 'U'.
wa_receiver-com_type = 'INT'.
APPEND wa_receiver.
move wa_receiver[] to it_receiver[].
append it_receiver.
wa_receiver-receiver = '[email protected]'.
wa_receiver-rec_type = 'U'.
wa_receiver-com_type = 'INT'.
APPEND wa_receiver.
move wa_receiver[] to it_receiver[].
append it_receiver.
wa_receiver-receiver = '[email protected]'.
wa_receiver-rec_type = 'U'.
wa_receiver-com_type = 'INT'.
APPEND wa_receiver.
wa_receiver-receiver = '[email protected]'.
wa_receiver-rec_type = 'U'.
wa_receiver-com_type = 'INT'.
APPEND wa_receiver.
move wa_receiver to it_receiver.
append it_receiver.
Move wa_receiver[] to it_receivers[].
Clear it_receivers.
if i_OUT_PLACE_LEVEL NE 0.
loop at it_receivers into wa_receiver.
loop at it_receivers into wa_receiver.
*Function Module To Post The Message To Externa Mail
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = gd_doc_data
put_in_outbox = 'X'
commit_work = 'X'
TABLES
packing_list = it_packing_list
contents_hex = objbin
receivers = it_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.
clear wa_receiver.
endloop.
elseif i_OUT_PLACE_LEVEL eq 0.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = gd_doc_data
put_in_outbox = 'X'
commit_work = 'X'
TABLES
packing_list = it_packing_list
contents_hex = objbin
receivers = it_receiver
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.
clear wa_receiver.
endif.
ENDFUNCTION.
Regards
Ravindra -
Smartform to OTF to PDF attached to an email ERROR
Hi everyone... I have this problem... I need to send a smartform attached to an email... I'm doing the following:
- Create the OTF using the smartform function importing job_output_info.
- Convert the OTF (job_output_info-otfdata) to PDF using CONVERT_OTF_2_PDF.
- Change the table line's width using SX_TABLE_LINE_WIDTH_CHANGE.
- Send the email using SO_NEW_DOCUMENT_ATT_SEND_API1.
Everything seems to be OK. But When I check the PDF file attached in the email and open it, everything there is a mess. The letters are superimposed over each other and the grills are not painted (instead it shows a black block).
Any ideas how to solve this???
Thanks a lot!!!Try this out..!
<removed by moderator>
To convert the script out put to PDF.
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF' u201C FOR out put format
max_linewidth = 132 u201CFor ASCII format: Number of lines in LINES-TDLINE
IMPORTING
bin_filesize = gv_bin_filesize u201CFile size reference
TABLES
otf = gt_otf u201CInput table with OTF format
lines = gt_pdf_tab " Output table with target format
To mail Order in PDF format:
Data declaration part :
DATA: gt_reclist TYPE TABLE OF somlreci1, " SAPoffice: Structure of the API Recipient List
gt_pdf_tab TYPE TABLE OF tline, " SAPscript: Text Lines
gt_otf TYPE TABLE OF itcoo, " OTF Structure
gt_objbin TYPE TABLE OF solisti1, " SAPoffice: Single List with Column Length 255
gt_objpack TYPE TABLE OF sopcklsti1. " SAPoffice: Description of Imported Object Components
DATA: gv_form_name TYPE rs38l_fnam, " Used to store the function module generated by Smartform
gv_bin_filesize TYPE i, " Store the file size
gv_pos TYPE i,
gv_len TYPE i,
gv_tab_lines TYPE i.
DATA : gc_text(11) TYPE c VALUE 'Form Output',
gc_tst(3) TYPE c VALUE 'TST',
gc_testing(30) TYPE c VALUE 'Zellar Sales Document'.
1. Assigning the Description of the object sent in the mail
CLEAR gs_docdata.
gs_docdata-obj_name = gc_tst.
gs_docdata-obj_descr = gc_testing.
Assigning the email id to Structure of the API Recipient List table
CLEAR : gt_reclist, gs_reclist. u201C variables used
gs_reclist-receiver = mail address'. u201CTo whom this mail should go
GS_RECLIST-REC_TYPE = 'U'.
APPEND gs_reclist TO gt_reclist. u201C Internal table for storing mail address
2.Passing the Smart form text lines to SAP office: Single List with Column Length 255 table ,this logic is used to get all the data into PDF file while you send an attachment through mail..
CLEAR: gs_objbin, gs_pdf_tab.
LOOP AT gt_pdf_tab INTO gs_pdf_tab. u201CLoop the content of PDF table
gv_pos = 255 - gv_len.
IF gv_pos > 134. "length of pdf_table
gv_pos = 134.
ENDIF.
gs_objbin+gv_len = gs_pdf_tab(gv_pos).
gv_len = gv_len + gv_pos.
IF gv_len = 255. "length of out (contents_bin)
APPEND gs_objbin TO gt_objbin.
CLEAR: gs_objbin, gv_len.
IF gv_pos < 134.
gs_objbin = gs_pdf_tab+gv_pos.
gv_len = 134 - gv_pos.
ENDIF.
ENDIF.
ENDLOOP.
IF gv_len > 0.
APPEND gs_objbin TO gt_objbin. u201CTable contains Single List with Column Length 255 table
ENDIF.
3. Filling the details in SAPoffice: Description of Imported Object Components table
DESCRIBE TABLE gt_objbin LINES gv_tab_lines.
CLEAR gs_objbin.
READ TABLE gt_objbin INTO gs_objbin INDEX gv_tab_lines.
IF sy-subrc = 0.
gs_objpack-doc_size = ( gv_tab_lines - 1 ) * 255 + STRLEN( gs_objbin ).
gs_objpack-transf_bin = 'X'.
gs_objpack-head_start = 1.
gs_objpack-head_num = 0.
gs_objpack-body_start = 1.
gs_objpack-body_num = gv_tab_lines.
gs_objpack-doc_type = 'PDF'.
gs_objpack-obj_name = 'ATTACHMENT'.
gs_objpack-obj_descr = 'test'.
APPEND gs_objpack TO gt_objpack.
ENDIF.
4. Sending the Form Output in the PDF format to email
data: WK_OBJHEAD TYPE SOLI_TAB.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1' u201Cfunction module used for sending mail
EXPORTING
document_data = gs_docdata u201CAttributes of new document
put_in_outbox = 'X'
commit_work = 'X'
TABLES
packing_list = gt_objpack u201CInformation about structure of data tables
OBJECT_HEADER = WK_OBJHEAD u201CHeader data for document (spec.header)
contents_bin = gt_objbin u201CData which is to be sent as pdf attachment
receivers = gt_reclist u201Cmailing list
EXCEPTIONS u201CException Handling
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
WRITE 'Sent Successfully'.
ENDIF.
Edited by: Thomas Zloch on Jul 16, 2010 10:38 PM -
Naming of the PDF attachment when mailing from Bursting engine
Hi,
We have a xml publisher report for which we have implemented Bursting Engine to archive the and burst the PDF output.
We have a requirement now to send the PDF output as attachment to external email ids(to suppliers).I am trying to test using e the below control file to send the PDFs as attachments but the name of the PDF attachment in the mail is numeric '3','6','9' etc...
I would like to know how do we name the PDF output attachment of the bursting engine.
-------------------------Burst Control File------------------------------------------
<xapi:requestset xmlns:xapi="http://xmlns.oracle.com/oxp/xapi" type="bursting">
<xapi:globalData location="stream">
</xapi:globalData >
<xapi:request select="/XXX_XMLPUB_ARINV/LIST_G_INVOICES/G_INVOICES">
<xapi:delivery>
<xapi:email server="127.0.0.1"
port="25"
from="[email protected]"
reply-to="[email protected]"
>
<xapi:message id="123"
to="${PURCHASE_ORDER_NUM}"
bcc=""[email protected]""
attachment="true"
subject="${TRX_NUMBER}"
>
<html><body>test</body></html>
</xapi:message>
</xapi:email>
</xapi:delivery>
<xapi:document output-type="pdf" delivery="123">
<xapi:template type="rtf" location="${XMLPUB_RTF_TEMPLATE}" filter=".//G_INVOICES[PRINTING_COUNT='0']">
</xapi:template>
</xapi:document>
</xapi:request>
</xapi:requestset>
Thanks,
Krishnan
Edited by: Krishnan-Apps on Dec 23, 2009 2:30 AMHi,
I seriously doubt your control file is a working one. Can you upload your working/correctly formatted file?
Or check this working sample below. Hope this helps.
<?xml version="1.0" encoding="UTF-8"?>
<xapi:requestset xmlns:xapi="http://xmlns.oracle.com/oxp/xapi">
<xapi:request select="/">
<xapi:delivery>
<xapi:email server="xxmail.mail.com" port="25" from="[email protected]" reply-to ="[email protected]">
<xapi:message id="${TRX_NUMBER}" to="[email protected]" cc="" bcc=""
attachment="true" content-type="text/html" subject="${TRX_TYPE_NAME} Number ${TRX_NUMBER}">
</xapi:message>
</xapi:email>
</xapi:delivery>
<xapi:document output="Invoice_Number_${TRX_NUMBER}" output-type="pdf" delivery="${TRX_NUMBER}">
<xapi:template type="rtf" location="xdo://AR.XXRAXINV_SEL.en.US/?getSource=true" filter="">
</xapi:template>
</xapi:document>
</xapi:request>
</xapi:requestset>regards,
Rownald -
Outlook 2013 will not Quick Print a PDF attachment on a Windows 8.1 computer
LS,
One of my customers has a Windows 8.1 Computer, Internet Explorer, Office 2013 and Acrobat reader XI (all updated, latest version, etc.).
Whenever my customer gets a email in his outlook with a PDF attachment, he cannot use Quick Print in the menu to print the attachment.
When he does this, simply nothing happens, no error, no nothing and the printer doesn't print. Any other type of attachment appears not to be a problem.
If I use a different program to open the PDF than with a little work around I can open the PDF and than print it.
Of course my customer would prefer to use Adobe reader.
Do you have a solution for this problem??
Kind regards,
Clemens LindersI read somewhere that disabling hardware rendering in Internet Explorer could help with a problem like I had with this customer. And also I read somewhere that you can disable some protection security in PDF.
So I did these two things and I thought.... Yes, this is it. I could now print emails that have a PDF attachment.
Unfortunately, my customer called me yesterday and sys he has still got the same problem when trying to print emails that have multiple PDF attachments.
I am running out of ideas, does anybody have an idea how to fix this??
Kind regards,
Clemens Linders -
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
Maybe you are looking for
-
Menu problem in ALV.....have ur ponts...
Hi all, I copied standard SAP menu in Se41 then i used that in my ALV grid, Now i want to put my own function code on the exit button(red one), and in user command i m trapping that function code, but no action is going to be done...evern break-point
-
Moving Song folder to external Hard drive
I'm new to Logic Express, and just starting my initial setup. What's the smartest way to move all my song folders to an external hard drive. I tried just dragging and dropping it which moved the folder, but when I try to save any new work it doesn't
-
Thanks in advance for your help!
-
I bought an Ibook by mistake when I thought I was buying an audiobook. I only have an Ipod - can't read a big book like that on an Ipod. Is it possible to transfer it to a Kobo Vox? If not, how do I get hold of Itunes to exchange them (I will pay the
-
Does apple TV let you stream videos from safari using your iPad 2x?
I'm considering on buying an apple tv but if it only has those 10 apps it can stream from my Xbox is capable of doing so as well. If apple tv doesn't stream using safari how can I have that option available so I can watch online videos on the iPad 2x