Idoc to RNIF with pdf attachment
Hi
I am implementing a Idoc to RNIF with pdf attachment. I have to pick the pdf file from an ftp server in PI based on the invoice number in the idoc. I could not find a blog or documentation on how to attach the pdf file. The only viable solution I found is to create a module in this forum [Re: Using attachment with RNIF|Re: Using attachment with RNIF] Has anybody implemented this in any other way? Also, in this solution its not clear how both the messages and pdf file are reaching the rnif adapter together.
Can somebody give a step by step solution?
I am on PI 7.1 Ehp1
Thanks in advance
Asif
Anyone working/worked with RNIF adapter would like to share their experience.
Similar Messages
-
Error occured when sending mail with PDF attachment
Dear Experts
When i trigger email through SMTP server with PDF attachment using application server 10g , i got following error :
REP-50159: Executed successfully but there were some errors when distribute the output
i am using web.show_document utility
str1:='http://erp.ruchi.com:7777/reports/rwservlet?destype=mail'||'&desname='||c1rec.hist_email||'&from=[email protected]'||'&subject=Your Payslip for Month '||to_char(c1rec.tran_month,'Mon-YYYY')||'&desformat=PDF&server=rep_erp_bi&report=/asdeploy/webutil/pay/reports/payslip.rdf&userid=qwqwqw/aasasas@DIAMOND'||'&COMPANY='||:parameter.para_comp_code||'&LOCATION='||:parameter.para_loc_code||'&MONTH='||to_char(:sdate,'MM/YYYY')||'&ECODE='||c1rec.tran_ecode;
WEB.SHOW_DOCUMENT(str1,'_SELF');
previously i had successfully using this utility but now i am facing above error
Pl suggest
regards
shaileshDear Experts
I already configured application server configuration file with specifying SMTP mail server IP in pluginParam parameter
<pluginParam name="mailServer">202.157.161.76</pluginParam>
<property name="enableSSL" value="no"/>
<property name="mailUserName" value="%[email protected]%"/>
<property name="mailPassword" value="%soyacl#123%"/>
what is the issue
Pl clarify
Please reply it's urgent -
Problem in sending mail with PDF attachment
Hi all,
Kindly check this code..
I neeed to send the smartform as a PDF attachment..
PDF generated form of smartform is generated successfully..
<b>but PDF going as attachment is showing errors in opening</b> .
Please help me to solve this issue as soon as possible
DESCRIBE TABLE objtxt LINES tab_lines.
READ TABLE objtxt INDEX tab_lines.
doc_chng-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
doc_chng-doc_size = tab_lines * 255.
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
DESCRIBE TABLE objbin LINES tab_lines.
Creation of the entry for the compressed document
CLEAR objpack-transf_bin.
objpack-transf_bin = 'X'.
objpack-head_start = 1.
objpack-head_num = 0.
objpack-body_start = 1.
READ TABLE objbin INDEX tab_lines.
objpack-doc_size = tab_lines * 255 .
objpack-body_num = tab_lines.
objpack-doc_type = 'PDF'.
objpack-obj_name = 'SMART'.
objpack-obj_descr = 'test'.
APPEND objpack.
Completing the recipient list
target recipent
CLEAR reclist.
reclist-receiver = '[email protected]'.
reclist-express = 'X'.
reclist-rec_type = 'U'.
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
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 99.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Regards,
ajithHello Ajith,
Use this Code.
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 = 'ZZZ_TEST1'
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.
Fehlerhandling
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
wa_doc_chng-doc_size = ( v_lines_txt - 1 ) * 255 + strlen( i_objtxt )
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.
Länge des Attachment ermitteln
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'
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 helped reward points
Vasanth -
Error while sending mail with pdf attachment
Dear All,
I am sending mail to outlook Internet address, with PDF attachment, if i have the some text in the mail along with the attachment,
then the PDF attachment file is not opeining, throws file corrupted error.
If i don't have the text for mail body, and send only attachment then the PDF attachments working fine.
Please help.
regards,
Kumar.Hi Kumar,
If you are using the th FM "SO_NEW_DOCUMENT_ATT_SEND_API1" to send the PDF data(As an attachment) to an internet address, try prepare an internal table with the text you want to mention in your mail. This table needs to be passed to the
'contents_txt' of this function module. You can check your mail in SOST transaction and in DOC Content section.
Ex: wa_objtxt = 'Regards'.
APPEND wa_objtxt TO t_objtxt.
I am sure that you won't get any problem if you follow the procedure mentioned above.
Thank You,
Regards,
Naresh. -
Change Font Size with PDF attachment via e--mail
Hi experts,
I want to send mail with PDF attachment . Now the attachment is ok but only the font size in PDF is a little small.
Is that possible to Change the font size of PDF
Below is my code:
first the data comes from an internal table, then changed to an ABAP Pool.
* Create a new spool from the data in gt_data_pdf
new-page print on
destination c_local "<<== my printer
cover text text-027 "<<== Title or Spool req. name
list name space
list dataset space
immediately space " X means print now
keep in spool c_checked " X means keep spool
new list identification c_checked
line-size 255
line-count 65
no dialog .
loop at gt_data_pdf.
write: / gt_data_pdf-line.
endloop.
new-page print off.
lv_spoolid = lv_spdel-rqident = sy-spono.
lv_spdel-sys = sy-sysid.
*Convert ABAP Spool to PDF
call function 'CONVERT_ABAPSPOOLJOB_2_PDF'
exporting
src_spoolid = lv_spoolid
no_dialog = c_checked
importing
pdf_bytecount = lv_pdf_fsize
tables
pdf = lt_pdf_table
exceptions
others = 0.
call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
exporting
document_data = lv_doc_chng
put_in_outbox = space
commit_work = c_checked
tables
packing_list = lt_objpack
object_header = lt_objhead
contents_bin = lt_objbin
contents_txt = lt_objtxt
receivers = lt_reclist
exceptions
too_many_receivers = 1
document_not_sent = 2
operation_no_authorization = 4
others = 99.
Anyone could help me?
Thanks a lot.
Sincerely
JulieHi,
we don´t have many options for setting the font type and size in an ABAP list. One option is that you print the output using either SmartForms or AdobeForms, where you can control font type as well as size. This one requires additional work.
Another option is to use the instruction Print-Control:
NEW-PAGE PRINT ON.
PRINT-CONTROL FONT 1 SIZE 1 LPI 6 CPI 10.
WRITE: /10 'FONT 1 size 1 LPI 6 cpi 10'.
SKIP.
PRINT-CONTROL FONT 1 SIZE 5 LPI 6 CPI 5.
WRITE: /10 'FONT 1 size 5 LPI 6 cpi 5'.
SKIP.
PRINT-CONTROL FONT 2 SIZE 5 LPI 6 CPI 10.
WRITE: /10 'FONT 2 size 5 LPI 6 cpi 10'.
SKIP.
NEW-PAGE PRINT OFF. -
How to send a mail with PDF attachment
Hello
Good Day!
We have a requirement to send the mail with pdf attachment. Pdf file will be remain same for all mails and it will be placed at server. We are on R12.4 and below is the database information :
BANNER
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
PL/SQL Release 11.2.0.3.0 - Production
CORE 11.2.0.3.0 Production
TNS for Linux: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production
Thanks a ton for your anticipated help!
Thanks
GauravThe word URGENT is considered as rude in this forum.. Nobody here is getting paid for the ansers they are giving..
Just have a look at These threads.Those will help you. -
Send Mail with PDF Attachment in ABAP
Hi Experts,
I have a requirement where I need to convert internal table data into PDF format and send it as an E-Mail with PDF attachment to Outlook mail using ABAP.
How do I achieve this .
Can anyone send me example code for doing this.
Thanks
Kumarhiii
check following code for PDF attachment and mail
** Check for any ATTACHMENTS...
IF d_desired_type = 'RAW'. " Set to RAW?
* PERFORM convert_to_abaplist. " YES - convert it
ENDIF. " end...
IF d_desired_type = 'ALI'. " Set to ALI?
PERFORM convert_to_alilist. " YES - convert it
ENDIF. " end...
* Check for any ATTACHMENTS...
IF NOT t_soli[] IS INITIAL. " attachment?
h_real_type = d_desired_type. " ENABLE
h_transf_type = 'X'. " Transfer type BINARY...
* Write PDF/ALI formatted data to BINARY table...
t_con_bin[] = t_soli[].
* Add Packing List (attachment) for PDF...
DESCRIBE TABLE t_con_bin LINES h_tab_cntr.
READ TABLE t_con_bin INDEX h_tab_cntr.
h_doc_data-doc_size = h_doc_data-doc_size
+ ( ( h_tab_cntr - 1 )
* 255 + STRLEN( t_con_bin ) ).
h_doc_data-obj_descr = mail_subject.
h_body_start = 1.
h_body_num = h_tab_cntr.
* Write RAW data if that's what it is (adds to TEXT)...
IF h_real_type = 'RAW'.
DESCRIBE TABLE t_con_text LINES h_body_start.
h_body_start = h_body_start + 1.
h_transf_type = space. " Transfer type TEXT...
LOOP AT t_con_bin. " Zip thru TEXT stuff
t_con_text = t_con_bin. " set TEXT table header..
APPEND t_con_text. " add to what's there!
ENDLOOP.
CLEAR: t_con_bin. " clear BINARY header..
REFRESH: t_con_bin. " reset BINARY table...
ENDIF.
CLEAR t_pak_list.
IF h_transf_type = 'X'. " Binary=PDF/ALI?
t_pak_list-transf_bin = 'X'.
t_pak_list-head_start = 1.
t_pak_list-head_num = 0.
t_pak_list-body_start = 1.
t_pak_list-body_num = h_tab_cntr.
t_pak_list-doc_type = h_real_type.
t_pak_list-obj_name = 'ATTACHMENT'.
t_pak_list-obj_descr = 'Document'(001).
t_pak_list-doc_size = ( h_tab_cntr - 1 )
* 255 + STRLEN( t_con_bin ).
ELSE.
DESCRIBE TABLE t_con_text LINES h_tab_cntr.
READ TABLE t_con_text INDEX h_tab_cntr.
t_pak_list-transf_bin = ' '. " Binary=RAW
t_pak_list-head_start = 1.
t_pak_list-head_num = 0.
t_pak_list-body_start = h_body_start.
t_pak_list-body_num = h_tab_cntr.
t_pak_list-doc_type = h_real_type.
t_pak_list-obj_name = 'ATTACHMENT'(002).
t_pak_list-obj_descr = 'Report'(003).
t_pak_list-doc_size = ( h_body_num - 1 )
* 255 + STRLEN( t_con_text ).
ENDIF.
APPEND t_pak_list.
ENDIF.
* Send the EMAIL out with SAP function...
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = h_doc_data
put_in_outbox = 'X'
* commit_work = 'X'
TABLES
packing_list = t_pak_list
contents_bin = t_con_bin
contents_txt = t_con_text
receivers = t_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 syst-subrc NE 0.
* RAISE send_failed.
CALL FUNCTION 'NAST_PROTOCOL_UPDATE'
EXPORTING
msg_arbgb = '00'
msg_nr = '001'
msg_ty = 'E'
msg_v1 = 'O/P Could not be issued '(001)
msg_v2 = ' Due to No Mail ID'(002)
msg_v3 = syst-msgv3
msg_v4 = syst-msgv4
EXCEPTIONS
OTHERS = 1.
* Check General incompletion status of the header
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'.
ENDIF.
ELSE.
* commit work.
ENDIF.
ENDFORM. " SEND_MAIL_FAX
*& Form convert_otf_2_pdf
* text
* --> p1 text
* <-- p2 text
FORM convert_otf_2_pdf .
DATA: "t_line LIKE tline OCCURS 0 WITH HEADER LINE,
t_objcont LIKE soli OCCURS 0 WITH HEADER LINE,
d_doc_size(12) TYPE c,
d_fle1(2) TYPE p,
d_fle2(2) TYPE p,
d_off1 TYPE p,
d_hltlines TYPE i,
d_hfeld(500) TYPE c,
w_indx LIKE sy-tabix.
CLEAR: t_line, t_objcont, d_off1.
REFRESH: t_line, t_objcont.
* Check/set DEFAULT Desired-type attachment...
IF d_desired_type IS INITIAL. " Entered Desired type?
d_desired_type = 'PDF'. " NO - default to PDF
ENDIF. "
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = d_desired_type
IMPORTING
bin_filesize = d_doc_size
TABLES
otf = t_itcoo
lines = t_line
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
OTHERS = 4.
IF sy-subrc > 0.
RAISE otf_convert_failed.
ENDIF.
ENDFORM. " convert_otf_2_pdf
*& Form convert_otf_2_pdf_sx
* text
* --> p1 text
* <-- p2 text
FORM convert_otf_2_pdf_sx .
DATA:
t_otf LIKE solisti1 OCCURS 0 WITH HEADER LINE,"ENABLE
t_pdf LIKE tline OCCURS 0 WITH HEADER LINE,"ENABLE
doc_size(12) TYPE n,
len_out TYPE i,
x_real LIKE soodk-objtp,
x_idx_b LIKE sy-tabix,
x_idx_e LIKE sy-tabix.
IF d_desired_type = 'PDF'.
d_desired_type = 'OTF'.
ENDIF.
CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'
EXPORTING
rqident = d_spool_id
desired_type = d_desired_type
IMPORTING
real_type = x_real
TABLES
buffer = t_otf
buffer_pdf = t_pdf
EXCEPTIONS
no_such_job = 1
job_contains_no_data = 2
selection_empty = 3
no_permission = 4
can_not_access = 5
read_error = 6
type_no_match = 7
OTHERS = 8.
IF sy-subrc <> 0.
IF sy-subrc = 1.
RAISE invalid_spool_id.
ELSE.
RAISE otf_convert_failed.
ENDIF.
ENDIF.
* Check Desired-Type vs. Real-Type (if any)...
IF d_desired_type IS INITIAL.
IF x_real = 'OTF'.
d_desired_type = 'PDF'.
ELSE.
d_desired_type = x_real.
ENDIF.
ELSE.
IF ( d_desired_type = 'PDF' OR
d_desired_type = 'OTF' ) AND
( x_real = 'OTF' OR
x_real = 'PDF' ).
d_desired_type = 'PDF'.
ELSE.
IF d_desired_type <> x_real.
RAISE type_no_match.
ENDIF.
ENDIF.
IF ( d_desired_type = 'ALI' OR
d_desired_type = 'RAW' ) AND
x_real = 'OTF'.
RAISE type_no_match.
ENDIF.
ENDIF.
* Check if ABAP-LIST and not SapScript...
IF d_desired_type = 'ALI' OR
d_desired_type = 'RAW'.
t_soli[] = t_otf[].
EXIT.
ENDIF.
* Load OTF data gotten from spool...
LOOP AT t_otf.
t_itcoo = t_otf.
APPEND t_itcoo.
* if Vendor P/O (SapScript = Z_MEDRUCK) then
* trap INDEX for "Terms & Conditions" on BACK...
IF t_itcoo-tdprintcom = 'IN' AND
t_itcoo-tdprintpar = '01EZ_MEDRUCK BACK'.
x_idx_b = sy-tabix.
ENDIF.
IF t_itcoo-tdprintcom = 'IN' AND
t_itcoo-tdprintpar = '01EZ_MEDRUCK NEXT'.
x_idx_e = ( sy-tabix - 1 ).
ENDIF.
ENDLOOP.
* Drop from table if INDEX'S are set (see above)...
IF ( x_idx_b > 0 AND
( x_idx_e > x_idx_b ) ) .
DELETE t_itcoo FROM x_idx_b
TO x_idx_e.
ENDIF.
PERFORM convert_otf_2_pdf.
ENDFORM. " convert_otf_2_pdf_sx
*& Form CONVERSION_OF_SIZE *
* *"Converting the file to get a 255 char single line internal table *
* The PDF file that is generated out of the above function module *
* cannot be transported as it needs to be of 255 chars. Hence *
* converting the file to get a 255 char single line,internal table. *
FORM conversion_of_size .
"Declaring Local Constants............................................
CONSTANTS:
cnv_hexconst_zero TYPE x VALUE '00'.
* Internal table to hold 255 Char's Single Line. *
DATA:
lv_big_lines(268) TYPE c
OCCURS 0 WITH HEADER LINE.
*"Local Work Variables.................................................
DATA:
lfl_flag TYPE c,
lv_left_t(268) TYPE c,
lv_left_i TYPE i,
tv_left_i TYPE i,
lv_curr_i TYPE i.
FIELD-SYMBOLS: <f>.
* Get the lines into a table of 268 char as the first step to put it in
* the pdf file of 255 chars
CLEAR lfl_flag.
LOOP AT t_line.
IF lfl_flag EQ ' '.
CLEAR lv_big_lines.
ASSIGN lv_big_lines(134) TO <f>.
<f> = t_line.
lfl_flag = 'X'.
ELSE.
lv_big_lines+134 = t_line.
APPEND lv_big_lines.
CLEAR: lfl_flag.
ENDIF. " If lfl_flag = ''..
ENDLOOP. " Loop at t_pdf
IF lfl_flag EQ 'X'.
APPEND lv_big_lines.
ENDIF. " If lflf_flag eq 'X'..
* Next fill it into a 255 char table
CLEAR: lv_left_t, lv_left_i, tv_left_i.
lv_curr_i = 255.
LOOP AT lv_big_lines.
IF lv_left_i NE 0.
IF lv_curr_i NE 0.
wa_objcont(lv_left_i) = lv_left_t(lv_left_i).
wa_objcont+lv_left_i(lv_curr_i) = lv_big_lines(lv_curr_i).
ELSE.
wa_objcont = lv_left_t(lv_left_i).
ENDIF. " IF lv_curr_i NE 0
ELSE.
wa_objcont = lv_big_lines(lv_curr_i).
ENDIF. " IF lv_left_i NE 0
APPEND wa_objcont TO t_objcont.
tv_left_i = 268 - lv_curr_i.
IF tv_left_i > 255.
wa_objcont = lv_big_lines+lv_curr_i(255).
APPEND wa_objcont TO t_objcont.
lv_left_i = tv_left_i - 255.
tv_left_i = 255 + lv_curr_i.
lv_curr_i = 255 - lv_left_i.
lv_left_t = lv_big_lines+tv_left_i.
ELSE.
lv_left_t = lv_big_lines+lv_curr_i.
lv_left_i = 268 - lv_curr_i.
lv_curr_i = 255 - lv_left_i.
ENDIF. " IF tv_left_i > 255
ENDLOOP. " LOOP AT lv_big_lines.
CLEAR wa_objcont .
ASSIGN wa_objcont(lv_left_i) TO <f>.
<f> = lv_left_t(lv_left_i).
APPEND wa_objcont TO t_objcont.
h_transf_type = 'X'. " Transfer type BINARY...
IF NOT t_objcont[] IS INITIAL.
t_soli[] = t_objcont[]. " SapScript doc to Objects...
ENDIF.
regards
twinkal -
Sending an e-mail with pdf attachment and logo as a signature
Hi,
My task is to send an email with pdf attachement. And an image file need to be added as a signature. Is it possible, if so, can anyone please guide me?
Thanking you.
Kumar.Hi
I'm having the same issue, except my application actually sends the email but the attachment is 0 octet and it doesn't even give me an error... Any chance you found a solution for this and could share it ?
Thanks -
Workflow Step 'In Process'- Send mail with PDF attachment
Hi,
have to send mail with PDF attachment.
I have written a function module with following steps,
1. Convert SPOOL number to PDF using Function Module 'CONVERT_OTFSPOOLJOB_2_PDF'.
2. Send mail with PDF attachment using Function Module 'SO_DOCUMENT_SEND_API1'.
The Function Module is giving required output when tested and called in the report(Background Job).
When I call this Function Module from Method-> Workflow Task the Workflow steps status is 'In Process' and not ending.
Could you please help me on this??Hi shafath,
When you try to send mail, You need to call the function FP_JOB_OPEN before calling the function module to generate the pdf. ( /1B****) . Is it missing in your code? -
Want to create program which will trigger workflow with PDF attachement
Hi Expert,
I m new for work flow.
I want to create abap program which trigger work flow with PDF attachment.
Thanks in advanced.
Regards,
Laxman Sankhla.HI i have written code as per below.
Now if i m running programe i m getting error "Unable to create work item container
(CL_SWF_RUN_WIM_FLOW->_IMPORT_CONTAINER) "
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
BUFFER = FP_FORMOUTPUT-PDF
APPEND_TO_TABLE = ' '
IMPORTING
OUTPUT_LENGTH = ZVAR1
TABLES
BINARY_TAB = IT_SOLIX_TAB.
IF SY-SUBRC = 0 AND NOT IT_SOLIX_TAB[] IS INITIAL .
SWC_SET_TABLE CONTAINER 'IT_SOLIX_TAB' IT_SOLIX_TAB.
SWC_SET_ELEMENT CONTAINER 'ZVAR1' ZVAR1.
SWC_SET_ELEMENT CONTAINER 'YBUS2012' OBJ.
GV_INITIATOR = SY-UNAME.
CALL FUNCTION 'SWW_WI_START_SIMPLE'
EXPORTING
CREATOR = GV_INITIATOR
PRIORITY = SWFCO_NO_PRIO
TASK = 'WS99900241'
CALLED_IN_BACKGROUND = 'X'
TABLES
AGENTS = IT_AGENTS
WI_CONTAINER = CONTAINER.
COMMIT WORK.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Thanks in advanced
Laxman Sankhla. -
Send Invoice email with pdf attachement through DI?
Hi all,
is it possible to send an Invoice email with pdf attachement through DI as it can be done through UI?
Best Regards,
VangelisHi Vangelis,
I Don't think that the DI API has that functionality (but I am not sure).
However with .Net's System.Net.Mail it should be quite easy to build.
Good luck,
Johan -
Is anyone else having a problem sending a mail message with PDF attached?
Is anyone else having a problem sending a mail message with PDF attached? I receive the following message:
Sending the message content to the server failed.
Select a different outgoing mail server from the list below or click Try Later to leave the message in your Outbox until it can be sent.
Is there a fix for this?Anyone? I was hoping my problem would just 'fix itself'... but I still have some clients telling me they're not receiving any email from me. I've since deleted that account on my computers and re-added it. But still having the same issue.
-
Sending an email with pdf attachment in Ecc6
we were in 4.6 c and recentely upgraded to ECC6. we have a program which we are sending email with pdf attachments. now it is breaking, we are able to display the pdf in the screen, but once it became the attachment , it is not going.
we are running the program in forground and not reading the spool and sending it. any ideahttp://www.sap-img.com/abap/sending-email-with-attachment.htm
Sending mail to an external maild with PDF attachment.
Creating a PDF attachment and send it via Email
Sending E-Mail from ABAP - Version 610 and Higher - BCS Interface
How to send a ttachment with email.
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/abap-Sendthespooldatatoanemail+address.
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/convertSpoolrequesttoPDFandsendase-mail
Friend just have a look in the forum itself, there are many posts for ur query, you definetly get exact solution no need to wait for answers/solutions.
All the best -
Sending mails from sap to outlook with pdf attachment
Hi All
I am using the function module 'SO_NEW_DOCUMENT_ATT_SEND_API1' to send
mail with the pdf attachment to a SMTP mail id(outlook). I have done all the configuration settings in SCOT transaction. But still i am not able to get the mail in my outlook mailbox. Following are the details of the steps i have followed.
step1.
Get the OTF data output from the SMARTFORMS function module.
step2,
convert the OTF output data to PDF format.
step3.
populate all the required table to pass data to the function
module 'SO_NEW_DOCUMENT_ATT_SEND_API1' -
packing_list
contents_bin
contents_txt
receivers
and call the function module.
After doing the above steps still i am not able to get the mail in my outlook mailbox. Please Help.
Thanks
Jitendra Kumar Tripathy.hi,
kindly chk the code i wrote for my program.
it will solve ur issue.
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 = 'ZZZ_TEST1'
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.
Fehlerhandling
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
wa_doc_chng-doc_size = ( v_lines_txt - 1 ) * 255 + strlen( i_objtxt )
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.
Länge des Attachment ermitteln
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'
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 helped rwrd points
anver -
External Send PO as email with PDF attachment not working
hi,
we are using ECC6, and in txn NACT, Processing routine we can use Sapscript External send > SAPFM06P > ENTRY_NEU > MEDRUCK > PDF and in MN04/5 i create Output record, and in SCOT my PO is ready for transmission from either ME21N/2 and ME9F - works well - email sent with pdf PO attached.
<b>HOWEVER,</b> we have just created a SMARTFORM PO, and with similar settings, i cannot create External send OUTPUT!!! (Output failed in ME9F/ME23N) NACT settings External Send > /SMB40/FM06P > Z_MMPO_A > PDF
In SCOT > SMTP > Internet X > Sapscript/SmartForm = PDF.
Does special code need to be entered into Smartform to generate PDF email similar to Sapscript? Any code would be appreciated.
regards AdamHi,
You need to build a code to create the Spool OTF output into PDF.
This can be done in Print program, which converts the spool into PDF & sends a mail with PDF attachment.
Please refer this sample program:
http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm
Best regards,
Prashant
Maybe you are looking for
-
Hi all shayan here First of all sory for my last post in which i posted a lot of code...actuallly i want to describe my problem in details because it is really unknown to me...... Now i will desdcrible it in simple.Hope fully all of you can understan
-
Service PO created missing service list, with LSMW BUS2012
Hi experts, After days fighting against the Service PO creation with the service list filled, I decided to insert this post. I hope it should be a simple issue for someones. The problem is, I'm able to create a Service PO, but the service list for th
-
Flash photo broswer in iWeb?
Can I place a photo gallery that I made in lightroom into iWeb? It creates a folder that contains files including a swf and js. I have done this in dreamweaver easily. I just want to make a cool photo browser...some one help me!!!!
-
How to do SUBTOTAL AND TOTAL in Main Window of SAPSCRIPT.
Hello Friends, I am modifying standard SAPSCRIPT of packing slip. My client wants a subtotal and total in Main Window of Script for Eg. (They want Material Number wise Subtotal and finally Grandtotal at bottom in Main Window) Now i got stucked up her
-
OpenTrans 2.1 .xsd import problem into PI 7.1
Hello, While trying to import the latest version 2.1 of openTrans .xsd Files (I downloaded "openTRANS_2.1_german_all-in-one_package.zip") into PI 7.1 we fail. Error message while loading the file "opentrans_2_1.xsd" is: Unable to convert imported doc