How to send BIP report link by mail not the attachment.
Hi,
I have a requiment to send the BI Publisher report link by mail.But not to send the report as an attachment.
can any one have solution for this requirement.
hi,
Alternatively, u can do this Send a report with all the report names on one side and another side link to that particular report.If any one click on that link means it will open the report(pdf/html/excel) format by referring to the url.we will get this by using RTF Template.
Thanks,
Saichand
Similar Messages
-
How to send inline HTML page in mail(not as attachment)
Hi,
I am using JavaMail to send details to users using text mail. Its working successfully. But now i have to send the details on mails that will contain HTML page (not as attachment but as inline HTML page containing text) and details in it. Plz help me. Its urgent.
Thanks in advance,
DevomSet the contentType to "text/html" and send away.
(If you need both text and html you will need to make a multi-part message), this is covered in the FAQ.
http://java.sun.com/products/javamail/FAQ.html
travis (at) overwrittenstack.com -
How to send a report via e-mail
Hello All,
I want to send a report via e-mail.
What should I do for that?
Please help me out...
Regards,
Ravi Khattar.Hi,
Please check the below code....
data: t_objpack like sopcklsti1 occurs 1 with header line,
t_objhead like solisti1 occurs 1 with header line,
t_objtxt like solisti1 occurs 0 with header line,
t_objbin like solisti1 occurs 1 with header line,
t_reclist like somlreci1 occurs 1 with header line,
t_lobj like abaplist occurs 0 with header line,
t_listobj like abaplist occurs 1 with header line.
data: v_tab_line1 type i,
v_tab_line2 type i,
v_docsize type i,
v_len type i,
v_line(1250) type c,
v_subj(132) type c,
v_cr(1) type x value '0D',
v_linefd(2) type x value '0D0A',
v_docdata like sodocchgi1.
clear: t_objpack[], t_objhead[], t_objtxt[], t_reclist[], t_listobj[].
concatenate 'This email is generated from a SAP' sy-sysid '-'
sy-mandt '- batch environment.' into t_objtxt separated by ' '.
append t_objtxt.
t_objtxt = 'Please do not respond to this email.'. append t_objtxt.
v_docdata-obj_name = 'SAMPLE_TEST'.
concatenate 'Sales Order Status Attachment -' sy-datum '-' sy-uzeit
into v_subj separated by ' '.
v_docdata-obj_descr = v_subj.
describe table t_objtxt lines v_tab_line1.
read table t_objtxt index v_tab_line1.
v_docdata-doc_size = ( v_tab_line1 - 1 ) * 255 + strlen( t_objtxt ).
t_objpack-head_start = 1.
t_objpack-head_num = 1.
t_objpack-body_start = 1.
t_objpack-body_num = v_tab_line1.
t_objpack-doc_type = 'RAW'.
append t_objpack.
clear v_line.
if p_type = '1'.
loop at t_list.
concatenate v_line t_list v_linefd into v_line.
v_len = strlen( v_line ).
do 4 times.
if v_len ge 255.
if v_line+254(1) = v_cr.
v_line255 = v_line254.
v_line+254(1) = ' '.
endif.
t_objtxt = v_line(255).
v_line = v_line+255.
v_len = v_len - 255.
append t_objtxt.
else.
exit.
endif.
enddo.
endloop.
if v_line ne ' '.
t_objtxt = v_line(255).
append t_objtxt.
endif.
describe table t_objtxt lines v_tab_line2.
t_objpack-doc_size = ( v_tab_line2 - v_tab_line1 ) * 255.
t_objpack-body_start = v_tab_line1 + 1.
t_objpack-transf_bin = ' '.
t_objpack-doc_type = 'TXT'.
else.
t_objbin[] = html[].
describe table t_objbin lines v_tab_line2.
t_objpack-doc_size = v_tab_line2 * 255.
t_objpack-body_start = 1.
t_objpack-transf_bin = 'X'.
t_objpack-doc_type = 'HTM'.
endif.
t_objpack-head_start = 1.
t_objpack-head_num = 1.
t_objpack-body_num = v_tab_line2.
t_objpack-obj_name = 'SAMPLE_TEST'.
t_objpack-obj_descr = 'Test'.
append t_objpack.
loop at s_email.
t_reclist-receiver = s_email-low.
t_reclist-rec_type = 'U'.
append t_reclist.
endloop.
t_reclist-receiver = sy-uname.
t_reclist-rec_type = 'B'.
append t_reclist.
call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = v_docdata
put_in_outbox = ' '
TABLES
packing_list = t_objpack
object_header = t_objhead
contents_bin = t_objbin
contents_txt = t_objtxt
receivers = t_reclist.
if sy-subrc = 0.
endif.
Cheers,
Bujji -
How to send ALV report Output through mail in background !
Hi ,
I had an ALV Report. I want to send this report output to patricular email id every day ! Presenty i do this manually. I run the report and send the output to the particular email address. Now i want to schecule the report daily in background and the out put of the report should be mailed to particular email ids in background itself. How can i do this ?
Is there and method or setting through which we can do this ?
RegardsHi Nau,
For this requirement you will have to write another program.
This program will convert the spool requests into PDF document and sends an email to the recipients that you specify.
These are the threads which are already posted in The SDN.
*http://wiki.sdn.sap.com/wiki/display/Snippets/Converts+spool+request+into+PDF+document+and+emails*
*<a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="353650"></a>*
*<a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="902985"></a>*
You need to use the Function module :
-- Sending the document
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
I will provide you with the code to get this functionality.
*& Form SEND_EMAIL
form SEND_EMAIL .
DATA: t_mailpack TYPE sopcklsti1 OCCURS 0 WITH HEADER LINE,
t_mailhead TYPE solisti1 OCCURS 0 WITH HEADER LINE,
t_mailbin TYPE solisti1 OCCURS 0 WITH HEADER LINE,
t_mailtxt TYPE solisti1 OCCURS 0 WITH HEADER LINE,
t_mailrec TYPE somlreci1 OCCURS 0 WITH HEADER LINE.
DATA: wa_maildata TYPE sodocchgi1,
l_filename(50) TYPE c,
l_fldname(30) TYPE c,
l_fldval(100) TYPE c,
l_lines TYPE i,
l_text TYPE text128 .
DATA: w_email_subrc TYPE i.
DATA: w_ship like vbfa-vbeln.
CLEAR: wa_maildata,
t_mailtxt,
t_mailbin,
t_mailpack,
t_mailhead,
t_mailrec.
REFRESH: t_mailtxt,
t_mailbin,
t_mailpack,
t_mailhead,
t_mailrec.
*-- Fill output file
*- Fill header
CLEAR: t_mailbin.
* t_mailbin[] = pdf_tab[].
t_mailbin[] = it_att[]. "Uthaman
*This line is added to get the shipment no in Subject Line
SELECT SINGLE * FROM vbfa WHERE vbelv EQ nast-objky
AND vbtyp_v EQ c_vbtyp_v_j
AND vbtyp_n EQ c_vbtyp_n_8.
w_ship = vbfa-vbeln.
shift w_ship left deleting leading '0'.
*-- File name
if nast-kschl EQ 'ZFPL'.
CLEAR l_filename.
CONCATENATE 'Packing List -'
sy-datum+4(2) sy-datum+6(2) sy-datum(4) '.PDF' INTO l_filename.
*-- Creation of the document to be sent File Name
wa_maildata-obj_name = 'Packing List'.
*-- Mail Subject
CONCATENATE l_filename '-' 'Shipment No -' w_ship INTO wa_maildata-obj_descr SEPARATED BY space.
*-- Mail Contents
t_mailtxt-line = 'Packing List'.
APPEND t_mailtxt.
ENDIF.
if nast-kschl EQ 'ZFBA'.
CLEAR l_filename.
CONCATENATE 'Booking Advice -'
sy-datum+4(2) sy-datum+6(2) sy-datum(4) '.PDF'
INTO l_filename.
*-- Creation of the document to be sent File Name
wa_maildata-obj_name = 'Booking Advice'.
*-- Mail Subject
CONCATENATE l_filename '-' 'Shipment No -' w_ship INTO wa_maildata-obj_descr SEPARATED BY space.
*-- Mail Contents
t_mailtxt-line = 'Packing List'.
APPEND t_mailtxt.
ENDIF.
*-- Prepare Packing List
*-- Write Packing List (Main Subject)
CLEAR: l_lines, t_mailpack.
DESCRIBE TABLE t_mailtxt LINES l_lines.
* READ TABLE t_mailtxt INDEX l_lines.
t_mailpack-doc_size = ( l_lines - 1 ) * 255 + STRLEN( t_mailtxt ).
* CLEAR t_mailpack-transf_bin.
t_mailpack-transf_bin = ' '.
t_mailpack-head_start = 1.
t_mailpack-head_num = 0.
t_mailpack-body_start = 1.
t_mailpack-body_num = l_lines.
t_mailpack-doc_type = 'RAW'.
APPEND t_mailpack.
t_mailhead = l_filename.
APPEND t_mailhead.
*-- Write Packing List (Attachment)
CLEAR: l_lines, t_mailpack.
DESCRIBE TABLE pdf_tab[] LINES l_lines.
* READ TABLE pdf_tab INDEX l_lines.
t_mailpack-doc_size = ( l_lines - 1 ) * 255 + STRLEN( t_mailbin ).
t_mailpack-transf_bin = 'X'.
t_mailpack-head_start = 1.
t_mailpack-head_num = 1.
t_mailpack-body_start = 1.
t_mailpack-body_num = l_lines.
t_mailpack-doc_type = 'PDF'.
t_mailpack-obj_name = l_filename.
t_mailpack-obj_descr = l_filename.
t_mailpack-obj_langu = 'E'.
APPEND t_mailpack.
*-- Set recipients
tables : ztotcemail.
SELECT SINGLE * FROM vbfa WHERE vbelv EQ nast-objky
AND vbtyp_v EQ c_vbtyp_v_j
AND vbtyp_n EQ c_vbtyp_n_8.
CLEAR vttk.
SELECT SINGLE * FROM vttk WHERE tknum EQ vbfa-vbeln.
SELECT SINGLE * FROM ztotcemail WHERE tplst = vttk-tplst
AND lifnr = vttk-tdlnr.
IF SY-SUBRC EQ 0.
t_mailrec-receiver = ztotcemail-smtp_addr. "'Here you will give the email address'.
t_mailrec-rec_type = 'U'.
APPEND t_mailrec.
ENDIF.
**-- Sending the document
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = wa_maildata
put_in_outbox = 'X'
* commit_work = 'X' " N-16
TABLES
packing_list = t_mailpack
object_header = t_mailhead
contents_bin = t_mailbin[]
contents_txt = t_mailtxt[]
receivers = t_mailrec
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
operation_no_authorization = 4
OTHERS = 99.
w_email_subrc = sy-subrc.
IF sy-subrc EQ 0.
MESSAGE s000(zotc) WITH 'Email output sent successfully'.
ELSE.
MESSAGE s000(zotc) WITH 'Can not send email output'.
ENDIF.
endform. " SEND_EMAIL
Hope the above information will be helpful.
Regards,
Kittu -
How to send a report to corresponding client from the SSRS Report
Hi Friends,
I have one requirement, I have multiple clients information in the report based on the Input client parameter it will show in the report.
I want to schedule the report. I need to send a report only with the corresponding client information to relevant mail id.
Example:
Client Name : Ajay
I need to send a report only about Ajay information to his mail id.
How we can achieve this ?? Please help..
Thanks in Advance..
Regards,
LuckyAbdulHi LuckyAbdul,
If we want to send a report only with the corresponding client information to relevant mail id, we should add a parameter in the report to filter the relevant customer information. And we also need to add the recipient email id in the report, so that we
can delivery the report to all the customers.
I find there is another thread with the same issue posted by you, and I have already post a detail reply about this issue, you can refer to it with the link below:
http://social.technet.microsoft.com/Forums/en-US/91e9a516-48a0-4a67-83fc-70228ca10367/how-to-pass-parameters-in-data-driven-subscription-in-ssrs?forum
Hope this helps.
Thanks,
Katherine Xiong
Katherine Xiong
TechNet Community Support -
How to send my report through e-mail
Hello to All
i am generating a report in report 2.5 what i want in place of sending report to printer or screen i want to send reports output through email either in html or pdf format.
please send me the solution for the same.
thanks.
nullHello to All
i am generating a report in report 2.5 what i want in place of sending report to printer or screen i want to send reports output through email either in html or pdf format.
please send me the solution for the same.
thanks.
null -
How to send adobe form output in mail as a attachment
i am get the adobe form output
how to attach in a mail ....
Regards
Anbu Bmy program is like this.............
CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
EXPORTING
i_name = 'YHRIN_WELCOME'
IMPORTING
e_funcname = lv_funcname
gs_output-nodialog = 'X'.
gs_output-preview = 'X'.
gs_output-getpdl = 'X'.
gs_output-getpdf = 'X'.
gs_output-dest = 'LP01'.
CALL FUNCTION 'FP_JOB_OPEN'
CHANGING
ie_outputparams = gs_output
EXCEPTIONS
CANCEL = 1
USAGE_ERROR = 2
SYSTEM_ERROR = 3
INTERNAL_ERROR = 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.
DATA : gs_outputpara TYPE sfpdocparams.
DATA : ls_return TYPE fpformoutput .
gs_outputpara-langu = 'E'.
gs_outputpara-country = 'IN'.
CALL FUNCTION lv_funcname
EXPORTING
/1bcdwb/docparams = gs_outputpara
wa_data = wa_mail
IMPORTING
/1bcdwb/formoutput = ls_return
EXCEPTIONS
OTHERS = 1.
DATA lv_output TYPE sdokcntbins WITH HEADER LINE.
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
buffer = ls_return-pdf "PDF file from function module
TABLES
binary_tab = lv_output .
*DATA : result TYPE sfpjoboutput WITH HEADER LINE .
CALL FUNCTION 'FP_JOB_CLOSE'
IMPORTING
e_result = result
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
DATA : iv_len_in LIKE sood-objlen,
it_tline TYPE TABLE OF tline WITH HEADER LINE.
PERFORM pdf_file.
DATA: lt_imessage TYPE STANDARD TABLE OF solisti1 WITH HEADER LINE,
lt_iattach TYPE STANDARD TABLE OF solisti1 WITH HEADER LINE,
lt_ipacking_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
lt_ireceivers LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
lt_iattachment LIKE solisti1 OCCURS 0 WITH HEADER LINE.
DATA : lt_record LIKE solisti1 OCCURS 0 WITH HEADER LINE.
DATA : it_otf TYPE itcoo OCCURS 0 WITH HEADER LINE.
DATA: lv_email TYPE somlreci1-receiver
VALUE 'anbu.'.
PERFORM build_xls_data .
APPEND lt_iattach.
Populate message body text
CLEAR lt_imessage. REFRESH lt_imessage.
lt_imessage = 'Please find attached PDF file'.
APPEND lt_imessage.
Send file by email as .xls speadsheet
PERFORM send_email_with_xls TABLES lt_imessage
lt_iattach
USING lv_email
'PDF Attachment of an Employee'
'PDF'
'TestFileName'
'Employee Detail'.
Form BUILD_XLS_DATA
FORM build_xls_data .
DATA :lv_buffer TYPE string.
Convert PDF from 132 to 255.
LOOP AT it_tline.
Replacing space by ~
TRANSLATE it_tline USING ' ~'.
CONCATENATE lv_buffer it_tline INTO lv_buffer.
ENDLOOP.
replacing ~ by space
TRANSLATE lv_buffer USING '~'.
DO.
lt_record = lv_buffer.
Appending 255 characters as a record
APPEND lt_record.
SHIFT lv_buffer LEFT BY 255 PLACES.
IF lv_buffer IS INITIAL.
EXIT.
ENDIF.
ENDDO.
lt_iattach[] = lt_record[].
ENDFORM.
Form SEND_EMAIL_WITH_XLS
FORM send_email_with_xls TABLES pit_message
pit_attach
USING p_email
p_mtitle
p_format
p_filename
p_attdescription.
DATA: es_xdocdata LIKE sodocchgi1,
lv_xcnt TYPE i.
Fill the document data.
es_xdocdata-doc_size = 1.
Populate the subject/generic message attributes
es_xdocdata-obj_langu = sy-langu .
es_xdocdata-obj_name = 'SAPRPT' .
es_xdocdata-obj_descr = p_mtitle .
Fill the document data and get size of attachment
CLEAR es_xdocdata.
READ TABLE lt_iattach INDEX lv_xcnt.
es_xdocdata-doc_size =
( lv_xcnt - 1 ) * 255 + STRLEN( lt_iattach ).
es_xdocdata-obj_langu = sy-langu.
es_xdocdata-obj_name = 'SAPRPT'.
es_xdocdata-obj_descr = p_mtitle.
CLEAR lt_iattachment. REFRESH lt_iattachment.
lt_iattachment[] = pit_attach[].
Describe the body of the message
CLEAR lt_ipacking_list. REFRESH lt_ipacking_list.
lt_ipacking_list-transf_bin = space.
lt_ipacking_list-head_start = 1.
lt_ipacking_list-head_num = 0.
lt_ipacking_list-body_start = 1.
DESCRIBE TABLE lt_imessage LINES lt_ipacking_list-body_num.
lt_ipacking_list-doc_type = 'RAW'.
APPEND lt_ipacking_list.
Create attachment notification
lt_ipacking_list-transf_bin = 'X'.
lt_ipacking_list-head_start = 1.
lt_ipacking_list-head_num = 1.
lt_ipacking_list-body_start = 1.
DESCRIBE TABLE lt_iattachment LINES lt_ipacking_list-body_num.
lt_ipacking_list-doc_type = p_format.
lt_ipacking_list-obj_descr = p_attdescription.
lt_ipacking_list-obj_name = p_filename.
lt_ipacking_list-doc_size = lt_ipacking_list-body_num * 255.
APPEND lt_ipacking_list.
Add the recipients email address
CLEAR lt_ireceivers. REFRESH lt_ireceivers.
lt_ireceivers-receiver = p_email.
lt_ireceivers-rec_type = 'U'.
lt_ireceivers-com_type = 'INT'.
lt_ireceivers-notif_del = 'X'.
lt_ireceivers-notif_ndel = 'X'.
APPEND lt_ireceivers.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = es_xdocdata
put_in_outbox = 'X'
commit_work = 'X'
TABLES
packing_list = lt_ipacking_list
contents_bin = lt_iattachment
CONTENTS_HEX = lv_output
contents_txt = lt_imessage
receivers = lt_ireceivers
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.
SUBMIT rsconn01 WITH mode = 'INT'
WITH output = '' AND RETURN.
ENDFORM. -
How to send error message via a mail to the customers email id
HI experts ,
i have a requirement,In idoc where i have to send the error message via email to a perticular emailid?
please help me n tell also which fm is used for that?
Thanks
RAhul SisodiaHi ,
Check this Link..
[sending an email with multiple attachments;
Regards,
Sachin M M -
How to send a smartform result through mail?
How to send a smartform result through mail?
HI,
YOu can convert the output of Smartform into a attachment say PDF file & then send it across through mail.
Refer following program:
<a href="http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm">http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm</a>
Best regards,
Prashant -
How can send a script as a mail.
Hi
this is fazil.
Please tell me any body How can send a script as a mail.
Thanks & Regards
Fazil
[email protected]Hi Fazil,
First convert your script to Smartform and then use this type of coding to mail it.
Check this code.
REPORT zptpfrm202p_pogr_pr_instr MESSAGE-ID zmm.
TABLES *
Database table made for getting information about PRINTPREVIEW and
PRINT command more than one times
TABLES: zgr_table.
TYPE-POOLS:syscr.
GLOBAL TYPE DECLARATION *
DATA: zdoc_output_info TYPE ssfcrespd, "SF:Return Document Inf.
zjob_output_info TYPE ssfcrescl, "SF:Return value at end of
form printing
i_control TYPE ssfctrlop ,
i_output_options TYPE ssfcompop,
zjob_output_opts TYPE ssfcresop. "SF:Return value at start
of form printing
*This internal table is used for storing Document Segment: Material
DATA: BEGIN OF i_mseg.
INCLUDE STRUCTURE mseg.
DATA: END OF i_mseg.
This internal table is used for storing Header: Material Document
DATA: BEGIN OF i_mkpf.
INCLUDE STRUCTURE mkpf.
DATA: END OF i_mkpf.
*Variables
DATA flag(1) TYPE c.
DATA: vfile TYPE string.
SELECTION-SCREEN *
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-000.
PARAMETERS:p_mblnr TYPE mkpf-mblnr OBLIGATORY MATCHCODE OBJECT zganesh,
p_mjahr TYPE mkpf-mjahr OBLIGATORY MATCHCODE OBJECT zganesh1,
p_zeile TYPE mseg-zeile OBLIGATORY MATCHCODE OBJECT zganesh2.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-001.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN POSITION 10.
PARAMETER:r_disp RADIOBUTTON GROUP g1 USER-COMMAND u1 DEFAULT 'X'.
SELECTION-SCREEN:COMMENT 15(10) text-002 .
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN POSITION 10.
PARAMETERS: r_down RADIOBUTTON GROUP g1.
SELECTION-SCREEN:COMMENT 15(10) text-003.
*PARAMETERS: v_file LIKE rlgrap-filename .
*SELECTION-SCREEN:COMMENT 70(50) text-005.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN POSITION 10.
PARAMETERS: r_print RADIOBUTTON GROUP g1 .
SELECTION-SCREEN:COMMENT 15(10) text-004.
SELECTION-SCREEN END OF LINE.
PARAMETERS: v_file LIKE rlgrap-filename MODIF ID g12.
SELECTION-SCREEN END OF BLOCK b2.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR v_file.
DATA : wlv_field_name LIKE dynpread-fieldname,
wlv_file_name LIKE ibipparms-path.
wlv_field_name = v_file.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
field_name = wlv_field_name
IMPORTING
file_name = wlv_file_name.
IF sy-subrc EQ 0.
vfile = wlv_file_name.
v_file = wlv_file_name.
ENDIF.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-name = 'V_FILE'.
IF r_disp EQ 'X' OR r_print EQ 'X'.
screen-input = 0.
ELSE.
screen-input = '1'.
ENDIF.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
START-OF-SELECTION EVENT *
START-OF-SELECTION.
CALLING CONVERSION FUNCTION MODULE 'CONVERSION_EXIT_ALPHA_INPUT' *
*Conversion function module for appending 00 befor MBLNR FIELD
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = p_mblnr
IMPORTING
output = p_mblnr.
Call subroutine for fetching data from database
PERFORM get_data.
END-OF-SELECTION EVENT *
END-OF-SELECTION.
Call subroutine for calling and processing smartform
PERFORM call_smartform.
*& Form get_data
Subroutine for fetching data from database
FORM get_data .
Fetching data from MKPF table with using parameters MBLNR and MJAHR
SELECT SINGLE * FROM mkpf
INTO i_mkpf
WHERE mblnr = p_mblnr
AND mjahr = p_mjahr.
IF sy-subrc EQ 0.
Fetching data from MSEG with using parameters MBLNR,ZEILE and MJAHR
SELECT SINGLE * FROM mseg
INTO i_mseg
WHERE mblnr = i_mkpf-mblnr
AND mjahr = i_mkpf-mjahr
AND zeile = p_zeile.
IF sy-subrc NE 0.
CLEAR i_mseg.
ENDIF.
ELSE.
MESSAGE i000.
EXIT.
ENDIF.
ENDFORM. " get_data
*& Form call_smartform
Subroutine for calling smartform
FORM call_smartform .
Local template used in the processing output of smartform
TYPES: BEGIN OF lt_ztable,
mandt TYPE sy-mandt,
mblnr TYPE mseg-mblnr,
flag(1) TYPE c,
END OF lt_ztable.
CONSTANTS: c_x(1) TYPE c VALUE 'X'.
Workarea
DATA: lw_ztable TYPE lt_ztable.
*Variable used in the smartform
DATA: lv_form(30) TYPE c,
lv_fm_name(30) TYPE c.
lv_form = 'ZPTPFRM202L_POGR'.
*Calling function module SSF_FUNCTION_MODULE_NAME which gives new name
*to the function module that will generated by smartform.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = lv_form
IMPORTING
fm_name = lv_fm_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.
*Calling function module that will be generated by smartform
IF r_disp = c_x.
i_output_options-tdimmed = space.
i_output_options-tdnewid = c_x.
i_output_options-tddest = 'LOCL'.
i_control-no_dialog = 'X'.
i_control-preview = 'X'.
ELSEIF r_print = c_x.
i_output_options-tdimmed = c_x.
i_output_options-tddest = 'LOCL'.
i_control-no_dialog = c_x.
ELSE.
i_output_options-tdimmed = space.
i_output_options-tdnewid = c_x.
i_output_options-tddest = 'LOCL'.
i_control-getotf = 'X'.
i_control-preview = space.
i_control-no_dialog = c_x.
flag = c_x.
ENDIF.
CALL FUNCTION lv_fm_name
EXPORTING
control_parameters = i_control
output_options = i_output_options
user_settings = space
zmkpf = i_mkpf
zmseg = i_mseg
IMPORTING
document_output_info = zdoc_output_info
job_output_info = zjob_output_info
job_output_options = zjob_output_opts
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.
Modify the database table if it found the print command
IF zjob_output_opts-tdpreview NE c_x.
lw_ztable-mandt = sy-mandt.
lw_ztable-mblnr = p_mblnr.
lw_ztable-flag = c_x.
MODIFY zgr_table FROM lw_ztable.
CLEAR lw_ztable.
ENDIF.
IF flag EQ c_x.
DATA: li_lines LIKE tline OCCURS 100 WITH HEADER LINE.
DATA: lv_file TYPE string,
lbin_fsiz TYPE i.
lv_file = v_file.
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
IMPORTING
bin_filesize = lbin_fsiz
TABLES
otf = zjob_output_info-otfdata
lines = li_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.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
bin_filesize = lbin_fsiz
filename = lv_file
filetype = 'BIN'
TABLES
data_tab = li_lines
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
OTHERS = 22.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDIF.
ENDFORM. " call_smartform
Hope this resolves your query.
Reward all the helpful answers.
Regards -
How to send purchase order via e-mail.
Please could someone let me know how to send purchase order via e-mail.
I am an BC.
e-mailing is functionning however I am not very familiar in settings for MMNo, you do not need to touch ME_PRINT_PO. You need to put code before and after ME_PRINT_PO in the print program.
Step 1 - Copy the standard print program SAPFM06P to make a Z version, lets call it ZSAPFM06P
Step 2 - Copy include FM06PE02 to make a Z version, lets call that ZFM06PE02.
Step 3 - ZSAPFM06P change the statement "Include FM06PE02" to read "Include ZFM06PE02".
Step 4 - In include ZFM06PE02 you will find a subroutine called "ENTRY_NEU". In this subroutine you will see it first calls ME_READ_PO_FOR_PRINTING then calls ME_PRINT_PO. Before it calls ME_PRINT_PO just put:
l_nast-nacha = 1.
CLEAR l_nast-dimme.
This means that ME_PRINT_PO will not e-mail, it will create a spool request.
Step 5 - Still in ZFM06PE02, after ME_PRINT_PO has been called, add new code. First check that ent_retco EQ 0. If it does not then exit.
Step 6 - Get the spool ID created by ME_PRINT_PO by either moving sy-msgv1 to a variable or select from NAST.
Step 7 - Call function CONVERT_OTFSPOOLJOB_2_PDF using the spool ID from step 6, and put the result from table PDF into an internal table you can use later. ALso store the export variable pdf_bytecount, you will need it later.
Step 8 - Call function SX_TABLE_LINE_WIDTH_CHANGE using the table from step 7 as content_in and put the results from content_out into a new internal table.
Step 9 - Add some text into a internal table of type solisti1, this will be the body text of the e-mail.
Step 10 - Add whatever receivers you want into an internal table of type somlreci1. If you just want it to go to the address that the PO would have gone to anyway, select the e-mail address from ADR6 where the address number = l_doc-xekko-adrnr, that is the data from the PO.
Step 11 - Populate an internal table of type sopcklsti1 with data relevant to your PDF table from step 8 and the text table from step 9. You will have to put the size of the PDF from step 7 (pdf_bytecount) on the PDF line and the size of the text will be the number of lines of text * 255.
Step 12 - Add info to a structure of type sodocchgi1. You can add the e-mail title in here, field obj_descr. Also add the size of the PDF and the size of the text from step 12 into doc_size, and give the doc a name in field obj_name. This can be anything, ZPDFPO for example.
Step 13 - Call SO_DOCUMENT_SEND_API1 using the tables from steps 8, 9, 10 and 11 and the structure from step 12. You can amend the sending e-mail also. Set commit_work to space.
Step 14 - That is all you need, but I actually call function RSPO_R_RDELETE_SPOOLREQ to delete the spool request created in step 4, then call NAST_PROTOCOL_UPDATE to add some more messages to the processing log of the PO.
That is all. -
How to send a report output as a FAX ?
Hallo Experts,
How to send a report output as a FAX ?
Suppose if I have all the data in an internal table, I will show it as a normal list OR ALV list output.
In the application tool bar I should have a button, and by clicking it the output should go to the customer as FAX. How can I send it to a FAX ? Any Function modules ?
Please help me with an example program.
Regards,
Matt.Hi,
Hope the code given below helps you.
FORM SEND_FAX
TABLES DOC2FAX STRUCTURE TEST_DOC
USING COUNTRY
NUMBER.
DATA: SID(5) TYPE N.
DATA BEGIN OF POPT.
INCLUDE STRUCTURE ITCPO.
DATA END OF POPT.
DATA BEGIN OF PRES.
INCLUDE STRUCTURE ITCPP.
DATA END OF PRES.
CLEAR POPT.
POPT-TDCOPIES = 1. " one copy
* POPT-TDDEST = " done internaly by script,
* POPT-TDPRINTER = " do not fill !!!
POPT-TDNEWID = 'X'. " do not reuse old spool request
POPT-TDDATASET = 'TEST'(022). " fill as you want
POPT-TDSUFFIX1 = 'FAX'(023). " fill as you want
POPT-TDSUFFIX2 = SY-UNAME. " fill as you want
POPT-TDIMMED = 'X'. " send now
POPT-TDLIFETIME = 8. " keep 8 days in spool
POPT-TDTELENUM = NUMBER. " number without country code
POPT-TDTELELAND = COUNTRY. " country of recipient
POPT-TDCOVER = 'test fax'(024).
POPT-TDCOVTITLE = 'test fax'(024).
* POPT-TDIEXIT = 'X'.
CALL FUNCTION 'PRINT_TEXT'
EXPORTING
APPLICATION = 'TX'
ARCHIVE_INDEX = ' '
ARCHIVE_PARAMS = ' '
DEVICE = 'TELEFAX' "<<< here we say: fax it !
DIALOG = 'X'
HEADER = HEADER
OPTIONS = POPT
IMPORTING
RESULT = PRES
TABLES
LINES = DOC2FAX
EXCEPTIONS
OTHERS = 01.
* do not bother with exception in sample code
* CANCELED = 01
* DEVICE = 02
* FORM = 03
* OPTIONS = 04
* UNCLOSED = 05
* UNKNOWN = 06
* FORMAT = 07
* TEXTFORMAT = 08
* EXTERNAL = 09.
IF SY-SUBRC = 0.
* arriving here means we could send:
SID = PRES-TDSPOOLID.
IF SID > '00000'.
MESSAGE S433 WITH SID.
ENDIF.
LEAVE .
ELSE.
* do not bother with exception in sample code
MESSAGE A400 WITH 'PRIN_TEXT'.
ENDIF.
ENDFORM. " SEND_FAX
Regards,
Siddarth -
How to send puchase report in email ?
how to send puchase report in email ?
Search SCN, you will get lot of post for this.
Here is an example.
http://scn.sap.com/thread/321890 -
Schedule Send Execl Report by E-mail to System User
Hello:
I need to schedule send Excel Report by E-mail to system user internet address. If only define the job by Reprot Agent? Do we have other method?
Hope this clear!Can you give some advice?
Regards&Thanks
zagoryHi zagory,
i forgot one tech issue to be setup: The internet Mail gateway needs to be setup if you want to send proper e-mails.
presupposed all tech. issues are solved, I agree with my colleague. Setup is fairly easy to handle, as soon as you know the customers demands like
- who is allowed to send
- who will do it in the future
- who are the recipients
- when should the precalc. take place/when should the Workbook be executed (Timepoints, after dataupdate ...)
for authorisations check out object: s_rs_bcs.
also make sure that the executor has permissions for the backgroud user (serach in TRC SU21, i can not remember.)
if all is known = approx. 2-3 days until go live, depending on the complexity of the existing scheduling and the authorisation concept.
Not to mention the training for all that and the tchnical setup.
hth
cheers
Sven -
Can any one tell me how to send one PO to mutilple mail ids in vendor maste
Hi Experts,
Can any one tell me how to send one PO as a mail to multiple vendors who are all maintained in my vendor master record
Suppose I have 3 mail ids in my Vendor master record and I created a PO with that vendor, will that PO goes to all the three mail ids maintained in the vendor master record or only to one ?
Inorder to send to multiple mail ids, Do we need to do any configure any thing in SPRO settings functionally, if so where we have to maintain?
Or shall an Abaper needs to maintain a code for that.?
Please suggest me, I would appreciate your feed back.
Best Regards,
SairamGo to XK02 enter the vendor code
go to the communication tab
Email will be there press the ---> button
you can add many Emails in the list.
Please ensure that the message output is configured by
the SAP BASIS team
No need of any configuration
G.Ganesh Kumar
Maybe you are looking for
-
Probloms deploying web application in weblogic 8.1
Hi, I've been using weblogic8.1 to host my web applications. The problem that i'm facing is that when i try to upload/deploy the (.war) file through weblogic console it shows the status as success but when i try to access a web resource, it gives me
-
I had to reinstall Itunes and my library and ipods did not reinstall how do i get these back?
-
Imported library includes events called "Originals"
I'm trying to transfer my iPhoto library from an old Mac Mini running 10.4 to a new iMac. I moved the old library to the new computer and chose Import to Library. After the import, I now have events labeled after the day of the month the photos were
-
OT: Problems Embedding Fonts.
Hi all... Sorry for this but.. I am using MS Weft v 3.4.2 to embed the Shusha Tru Type font on a web site in the Hindi language. I have cleaned up all the files and ensured that all font styles are correct and applied. Having run the site files throu
-
Facing problem on imac with photoshop
attached file for more information. please solve this issue as soon as possible regards, mahesh