Convert Script output into PDF and save into Unix Directory
Hi,
I had Sales Order Acknowledgement Output and wants to converted to PDFs and then these PDFs to be placed in Unix Directory
on their way to Docs Library.
I am using the following code
CALL FUNCTION 'CLOSE_FORM'
IMPORTING
RESULT = itcpp
TABLES
otfdata = lt_otf " OTF Data
EXCEPTIONS
unopened = 1
OTHERS = 2.
After this form , table ltf_otf is empty, So i am not converting into PDF .
So i need the logic to convert to PDF , and most importantly logic to save into UNIX Directory.
Thanks
Hi,
If you are using the Function Module "OPEN_FORM" to open the form for printing then in this function module there is an IMPORTING parameter OPTIONS which is of type ITCPO to this parameter "OPTIONS-TDGETOTF" needs to be passed as 'X' which will give you the OTF output in the FM "CLOSE_FORM".
After this call the FM "CONVERT_OTF" and pass the FORMAT as "PDF" which will give you the PDF output in LINES table Parameter. Most important please pass some dummy variable to BIN_FILESIZE variable.
Now by using OPEN DATASET file name FOR OUTPUT IN BINARY MODE and the LOOP the PDF table and use the TRANSFER statement to place the data in the UNIX File and then Finally use the CLOSE DATASET file name.
Hope will help to address your issue.
Regards,
SRinivas
Similar Messages
-
Converting binary data into pdf and placing into application server
Hi Friends,
I am able to get PO details in binary format and then using GUI_DOWNLOAD with file type with 'bin' and file name with 'sample.pdf' extension , got PO in pdf format.
But i need to get with pdf extension in application server without using GUI_DOWNLOAD.
Is there any functional modules for it?
With Warm Regards,
Madhu!!!Hi Madhu,
Check this code.
*& Report ZSPOOLTOPDF *
*& Converts spool request into PDF document and emails it to *
*& recipicant. *
*& Execution *
*& This program must be run as a background job in-order for the write *
*& commands to create a Spool request rather than be displayed on *
*& screen *
REPORT zspooltopdf.
PARAMETER: p_email1 LIKE somlreci1-receiver
DEFAULT '[email protected]',
p_sender LIKE somlreci1-receiver
DEFAULT '[email protected]',
p_delspl AS CHECKBOX.
*DATA DECLARATION
DATA: gd_recsize TYPE i.
Spool IDs
TYPES: BEGIN OF t_tbtcp.
INCLUDE STRUCTURE tbtcp.
TYPES: END OF t_tbtcp.
DATA: it_tbtcp TYPE STANDARD TABLE OF t_tbtcp INITIAL SIZE 0,
wa_tbtcp TYPE t_tbtcp.
Job Runtime Parameters
DATA: gd_eventid LIKE tbtcm-eventid,
gd_eventparm LIKE tbtcm-eventparm,
gd_external_program_active LIKE tbtcm-xpgactive,
gd_jobcount LIKE tbtcm-jobcount,
gd_jobname LIKE tbtcm-jobname,
gd_stepcount LIKE tbtcm-stepcount,
gd_error TYPE sy-subrc,
gd_reciever TYPE sy-subrc.
DATA: w_recsize TYPE i.
DATA: gd_subject LIKE sodocchgi1-obj_descr,
it_mess_bod LIKE solisti1 OCCURS 0 WITH HEADER LINE,
it_mess_att LIKE solisti1 OCCURS 0 WITH HEADER LINE,
gd_sender_type LIKE soextreci1-adr_typ,
gd_attachment_desc TYPE so_obj_nam,
gd_attachment_name TYPE so_obj_des.
Spool to PDF conversions
DATA: gd_spool_nr LIKE tsp01-rqident,
gd_destination LIKE rlgrap-filename,
gd_bytecount LIKE tst01-dsize,
gd_buffer TYPE string.
Binary store for PDF
DATA: BEGIN OF it_pdf_output OCCURS 0.
INCLUDE STRUCTURE tline.
DATA: END OF it_pdf_output.
CONSTANTS: c_dev LIKE sy-sysid VALUE 'DEV',
c_no(1) TYPE c VALUE ' ',
c_device(4) TYPE c VALUE 'LOCL'.
*START-OF-SELECTION.
START-OF-SELECTION.
Write statement to represent report output. Spool request is created
if write statement is executed in background. This could also be an
ALV grid which would be converted to PDF without any extra effort
WRITE 'Hello World'.
new-page.
commit work.
new-page print off.
IF sy-batch EQ 'X'.
PERFORM get_job_details.
PERFORM obtain_spool_id.
Alternative way could be to submit another program and store spool
id into memory, will be stored in sy-spono.
*submit ZSPOOLTOPDF2
to sap-spool
spool parameters %_print
archive parameters %_print
without spool dynpro
and return.
Get spool id from program called above
IMPORT w_spool_nr FROM MEMORY ID 'SPOOLTOPDF'.
PERFORM convert_spool_to_pdf.
PERFORM process_email.
if p_delspl EQ 'X'.
PERFORM delete_spool.
endif.
IF sy-sysid = c_dev.
wait up to 5 seconds.
SUBMIT rsconn01 WITH mode = 'INT'
WITH output = 'X'
AND RETURN.
ENDIF.
ELSE.
SKIP.
WRITE:/ 'Program must be executed in background in-order for spool',
'request to be created.'.
ENDIF.
FORM obtain_spool_id *
FORM obtain_spool_id.
CHECK NOT ( gd_jobname IS INITIAL ).
CHECK NOT ( gd_jobcount IS INITIAL ).
SELECT * FROM tbtcp
INTO TABLE it_tbtcp
WHERE jobname = gd_jobname
AND jobcount = gd_jobcount
AND stepcount = gd_stepcount
AND listident <> '0000000000'
ORDER BY jobname
jobcount
stepcount.
READ TABLE it_tbtcp INTO wa_tbtcp INDEX 1.
IF sy-subrc = 0.
message s004(zdd) with gd_spool_nr.
gd_spool_nr = wa_tbtcp-listident.
MESSAGE s004(zdd) WITH gd_spool_nr.
ELSE.
MESSAGE s005(zdd).
ENDIF.
ENDFORM.
FORM get_job_details *
FORM get_job_details.
Get current job details
CALL FUNCTION 'GET_JOB_RUNTIME_INFO'
IMPORTING
eventid = gd_eventid
eventparm = gd_eventparm
external_program_active = gd_external_program_active
jobcount = gd_jobcount
jobname = gd_jobname
stepcount = gd_stepcount
EXCEPTIONS
no_runtime_info = 1
OTHERS = 2.
ENDFORM.
FORM convert_spool_to_pdf *
FORM convert_spool_to_pdf.
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = gd_spool_nr
no_dialog = c_no
dst_device = c_device
IMPORTING
pdf_bytecount = gd_bytecount
TABLES
pdf = it_pdf_output
EXCEPTIONS
err_no_abap_spooljob = 1
err_no_spooljob = 2
err_no_permission = 3
err_conv_not_possible = 4
err_bad_destdevice = 5
user_cancelled = 6
err_spoolerror = 7
err_temseerror = 8
err_btcjob_open_failed = 9
err_btcjob_submit_failed = 10
err_btcjob_close_failed = 11
OTHERS = 12.
CHECK sy-subrc = 0.
Transfer the 132-long strings to 255-long strings
LOOP AT it_pdf_output.
TRANSLATE it_pdf_output USING ' ~'.
CONCATENATE gd_buffer it_pdf_output INTO gd_buffer.
ENDLOOP.
TRANSLATE gd_buffer USING '~ '.
DO.
it_mess_att = gd_buffer.
APPEND it_mess_att.
SHIFT gd_buffer LEFT BY 255 PLACES.
IF gd_buffer IS INITIAL.
EXIT.
ENDIF.
ENDDO.
ENDFORM.
FORM process_email *
FORM process_email.
DESCRIBE TABLE it_mess_att LINES gd_recsize.
CHECK gd_recsize > 0.
PERFORM send_email USING p_email1.
perform send_email using p_email2.
ENDFORM.
FORM send_email *
--> p_email *
FORM send_email USING p_email.
CHECK NOT ( p_email IS INITIAL ).
REFRESH it_mess_bod.
Default subject matter
gd_subject = 'Subject'.
gd_attachment_desc = 'Attachname'.
CONCATENATE 'attach_name' ' ' INTO gd_attachment_name.
it_mess_bod = 'Message Body text, line 1'.
APPEND it_mess_bod.
it_mess_bod = 'Message Body text, line 2...'.
APPEND it_mess_bod.
If no sender specified - default blank
IF p_sender EQ space.
gd_sender_type = space.
ELSE.
gd_sender_type = 'INT'.
ENDIF.
Send file by email as .xls speadsheet
PERFORM send_file_as_email_attachment
tables it_mess_bod
it_mess_att
using p_email
'Example .xls documnet attachment'
'PDF'
gd_attachment_name
gd_attachment_desc
p_sender
gd_sender_type
changing gd_error
gd_reciever.
ENDFORM.
FORM delete_spool *
FORM delete_spool.
DATA: ld_spool_nr TYPE tsp01_sp0r-rqid_char.
ld_spool_nr = gd_spool_nr.
CHECK p_delspl <> c_no.
CALL FUNCTION 'RSPO_R_RDELETE_SPOOLREQ'
EXPORTING
spoolid = ld_spool_nr.
ENDFORM.
*& Form SEND_FILE_AS_EMAIL_ATTACHMENT
Send email
FORM send_file_as_email_attachment tables it_message
it_attach
using p_email
p_mtitle
p_format
p_filename
p_attdescription
p_sender_address
p_sender_addres_type
changing p_error
p_reciever.
DATA: ld_error TYPE sy-subrc,
ld_reciever TYPE sy-subrc,
ld_mtitle LIKE sodocchgi1-obj_descr,
ld_email LIKE somlreci1-receiver,
ld_format TYPE so_obj_tp ,
ld_attdescription TYPE so_obj_nam ,
ld_attfilename TYPE so_obj_des ,
ld_sender_address LIKE soextreci1-receiver,
ld_sender_address_type LIKE soextreci1-adr_typ,
ld_receiver LIKE sy-subrc.
data: t_packing_list like sopcklsti1 occurs 0 with header line,
t_contents like solisti1 occurs 0 with header line,
t_receivers like somlreci1 occurs 0 with header line,
t_attachment like solisti1 occurs 0 with header line,
t_object_header like solisti1 occurs 0 with header line,
w_cnt type i,
w_sent_all(1) type c,
w_doc_data like sodocchgi1.
ld_email = p_email.
ld_mtitle = p_mtitle.
ld_format = p_format.
ld_attdescription = p_attdescription.
ld_attfilename = p_filename.
ld_sender_address = p_sender_address.
ld_sender_address_type = p_sender_addres_type.
Fill the document data.
w_doc_data-doc_size = 1.
Populate the subject/generic message attributes
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle .
w_doc_data-sensitivty = 'F'.
Fill the document data and get size of attachment
CLEAR w_doc_data.
READ TABLE it_attach INDEX w_cnt.
w_doc_data-doc_size =
( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle.
w_doc_data-sensitivty = 'F'.
CLEAR t_attachment.
REFRESH t_attachment.
t_attachment[] = it_attach[].
Describe the body of the message
CLEAR t_packing_list.
REFRESH t_packing_list.
t_packing_list-transf_bin = space.
t_packing_list-head_start = 1.
t_packing_list-head_num = 0.
t_packing_list-body_start = 1.
DESCRIBE TABLE it_message LINES t_packing_list-body_num.
t_packing_list-doc_type = 'RAW'.
APPEND t_packing_list.
Create attachment notification
t_packing_list-transf_bin = 'X'.
t_packing_list-head_start = 1.
t_packing_list-head_num = 1.
t_packing_list-body_start = 1.
DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
t_packing_list-doc_type = ld_format.
t_packing_list-obj_descr = ld_attdescription.
t_packing_list-obj_name = ld_attfilename.
t_packing_list-doc_size = t_packing_list-body_num * 255.
APPEND t_packing_list.
Add the recipients email address
CLEAR t_receivers.
REFRESH t_receivers.
t_receivers-receiver = ld_email.
t_receivers-rec_type = 'U'.
t_receivers-com_type = 'INT'.
t_receivers-notif_del = 'X'.
t_receivers-notif_ndel = 'X'.
APPEND t_receivers.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = w_doc_data
put_in_outbox = 'X'
sender_address = ld_sender_address
sender_address_type = ld_sender_address_type
commit_work = 'X'
IMPORTING
sent_to_all = w_sent_all
TABLES
packing_list = t_packing_list
contents_bin = t_attachment
contents_txt = it_message
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.
Populate zerror return code
ld_error = sy-subrc.
Populate zreceiver return code
LOOP AT t_receivers.
ld_receiver = t_receivers-retrn_code.
ENDLOOP.
ENDFORM.
Hope this resolves your query.
<b>Reward all the helpful answers.</b>
Regards -
How to convert script output to excel and send through mail in the report
I need a solution for Converting script into EXCEL and sending Excel as a attachment to the mail. In my current Program I am getting OTF data from script and converting into PDF using Function module ' CONVERT_OTF'
And sending PDF as a mail attachment using Function module 'SO_NEW_DOCUMENT_SEND_API1' it is working fine but
My current requirement is I need to send Excel as a mail attachment instead of PDF.
Hope it is clear for you, please give me possible solutions with sample code..hi
good
CONSTANTS: CON_CRET TYPE X VALUE '0D', "OK for non Unicode
CON_TAB TYPE X VALUE '09'. "OK for non Unicode
*If you have Unicode check active in program attributes thnen you will
*need to declare constants as follows
*class cl_abap_char_utilities definition load.
*constants:
con_tab type c value cl_abap_char_utilities=>HORIZONTAL_TAB,
con_cret type c value cl_abap_char_utilities=>CR_LF.
CONCATENATE 'EBELN' 'EBELP' 'AEDAT' 'MATNR'
INTO IT_ATTACH SEPARATED BY CON_TAB.
CONCATENATE CON_CRET IT_ATTACH INTO IT_ATTACH.
APPEND IT_ATTACH.
LOOP AT IT_EKPO INTO WA_CHAREKPO.
CONCATENATE WA_CHAREKPO-EBELN WA_CHAREKPO-EBELP
WA_CHAREKPO-AEDAT WA_CHAREKPO-MATNR
INTO IT_ATTACH SEPARATED BY CON_TAB. " Check here
CONCATENATE CON_CRET IT_ATTACH INTO IT_ATTACH. " Check here
APPEND IT_ATTACH.
ENDLOOP.
thanks
mrutyun^ -
Fax the output type and convert to PDF and then to save in UNIX Directory
Hi,
I wan to Fax the my sales order acknowldement and at the same time I want to convert that output into PDF and save in the UNIX Directory .
I also need the code for faxing the sales order acknowledgement.
Thanks in Advance
Moderator message: please search for available information/documentation before asking, also see Brad's remarks below.
Edited by: Thomas Zloch on Dec 20, 2010 9:51 PMThese are standard processes which are covered in the help files and have been discussed many times here. This is NOT a training forum for newbies where experts just give you the solution for your requirement. Once you have proven that you've actually made an effort to solve the issue yourself and have a SPECIFIC technical question, you'll get some help...
-
To convert Sap Script output to PDF format and send it via email.
Hi Friends,
Could any one please tell me, how to convert the Sap Script output to PDF format and send it via email. If any one have the code, kindly mail me to [email protected]
Thanks & Regards,
JohnPlese check this sample code from other thread.
REPORT zzz_jaytest .
Types Declaration
TYPES : BEGIN OF ty_pa0001,
pernr TYPE pa0001-pernr,
bukrs TYPE pa0001-bukrs,
werks TYPE pa0001-werks,
END OF ty_pa0001.
Internal Table Declaration
DATA : i_pa0001 TYPE STANDARD TABLE OF ty_pa0001, "For pa0001 Details
i_otf TYPE STANDARD TABLE OF itcoo, "For OTF data
i_content_txt TYPE soli_tab, "Content
i_content_bin TYPE solix_tab, "Content
i_objhead TYPE soli_tab,
Work Area Declaration
w_pa0001 TYPE ty_pa0001, "For pa0001 Details
w_res TYPE itcpp, "SAPscript output
"parameters
w_otf TYPE itcoo, "For OTF
w_pdf TYPE solisti1, "For PDF
w_transfer_bin TYPE sx_boolean, "Content
w_options TYPE itcpo, "SAPscript output
"interface
Variable Declaration
v_len_in TYPE so_obj_len,
v_size TYPE i.
Constants Declaration
CONSTANTS : c_x TYPE c VALUE 'X', "X
c_locl(4) TYPE c VALUE 'LOCL', "Local Printer
c_otf TYPE sx_format VALUE 'OTF', "OTF
c_pdf TYPE sx_format VALUE 'PDF', "PDF
c_printer TYPE sx_devtype VALUE 'PRINTER', "PRINTER
c_bin TYPE char10 VALUE 'BIN', "BIN
c_name TYPE string VALUE 'C:\ZZZ_JAYTEST.PDF',"Downloading
"File Name
c_form(11) TYPE c VALUE 'ZZZ_JAYTEST'. "Form Name
START-OF-SELECTION.
Selecting the records from pa0001
SELECT pernr bukrs werks FROM pa0001
INTO TABLE i_pa0001 UP TO 10 ROWS.
Setting the options
w_options-tdcopies = 1 ."Number of copies
w_options-tdnoprev = c_x."No print preview
w_options-tdgetotf = c_x."Return of OTF table
w_options-tddest = c_locl."Spool: Output device
Opening the form
CALL FUNCTION 'OPEN_FORM'
EXPORTING
form = c_form
device = c_printer
language = sy-langu
OPTIONS = w_options
IMPORTING
RESULT = w_res.
LOOP AT i_pa0001 INTO w_pa0001.
Writting into the form
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'MAIN'
window = 'MAIN'.
ENDLOOP.
Closing the form
CALL FUNCTION 'CLOSE_FORM'
IMPORTING
RESULT = w_res
TABLES
otfdata = i_otf
EXCEPTIONS
unopened = 1
bad_pageformat_for_print = 2
send_error = 3
spool_error = 4
codepage = 5
OTHERS = 6.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Converting OTF data to single line
LOOP AT i_otf INTO w_otf.
CONCATENATE w_otf-tdprintcom w_otf-tdprintpar
INTO w_pdf.
APPEND w_pdf TO i_content_txt.
ENDLOOP.
Converting to PDF Format
CALL FUNCTION 'SX_OBJECT_CONVERT_OTF_PDF'
EXPORTING
format_src = c_otf
format_dst = c_pdf
devtype = c_printer
CHANGING
transfer_bin = w_transfer_bin
content_txt = i_content_txt
content_bin = i_content_bin
objhead = i_objhead
len = v_len_in
EXCEPTIONS
err_conv_failed = 1
OTHERS = 2.
v_size = v_len_in.
Downloading the PDF File
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
bin_filesize = v_size
filename = c_name
filetype = c_bin
TABLES
data_tab = i_content_bin.
The extension is put the it_mailpack-obj_name parameter of 'SO_NEW_DOCUMENT_ATT_SEND_API1'. -
Convert a web report into pdf and print (in BW 3.5)
Hello gurus,
i have few web reports ( created using WAD). i am looking for a possibility to convert a web report (viewed in a browser by a user) into pdf and print them and this should be done by pressing a button.
Is it possible in BW 3.5 version?.
could anyone please help me?
Any how to docs. would be really helpful.
thanks and regards
kumarHere it is
<HTML>
<!-- BW data source object tags -->
<object>
<param name="OWNER" value="SAP_BW"/>
<param name="CMD" value="SET_DATA_PROVIDER"/>
<param name="NAME" value="DATAPROVIDER_1"/>
<param name="DATA_PROVIDER_ID" value=""/>
DATA_PROVIDER: DATAPROVIDER_1
</object>
<object>
<param name="OWNER" value="SAP_BW"/>
<param name="CMD" value="SET_PROPERTIES"/>
<param name="TEMPLATE_ID" value="ZPD_ADHOC_PAGE"/>
<param name="MENU_BACK" value=""/>
<param name="MENU_BACK_TO_START" value=""/>
<param name="SUPPRESS_WARNINGS" value="X"/>
<param name="MENU_FILTER" value=""/>
<param name="MENU_FILTER_ON_AXIS" value=""/>
<param name="MENU_SELECT_FILTER" value=""/>
<param name="MENU_FILTER_ON_AXIS_CHART" value=""/>
<param name="MENU_FILTER_CHART" value=""/>
<param name="MENU_FILTER_DRILL_DOWN" value=""/>
<param name="MENU_DRILL_UP_GIS" value=""/>
<param name="MENU_DRILL_DOWN" value=""/>
<param name="MENU_EXCHANGE_OBJECTS" value=""/>
<param name="MENU_REMOVE_DRILL_DOWN" value=""/>
<param name="MENU_SWITCH_AXIS" value=""/>
<param name="MENU_HIERARCHY_NODE_DRILL" value=""/>
<param name="MENU_HIERARCHY_DRILL" value=""/>
<param name="MENU_HIERARCHY_STATE" value=""/>
<param name="MENU_SORT" value=""/>
<param name="MENU_CALCULATE_RESULT" value=""/>
<param name="MENU_CALCULATE_VALUE" value=""/>
<param name="MENU_CUMULATE_VALUE" value=""/>
<param name="MENU_DISPLAY_DOCUMENTS" value=""/>
<param name="MENU_DOCUMENT_CREATE" value=""/>
<param name="MENU_DISPLAY_DOCUMENT_PROP" value=""/>
<param name="MENU_DISPLAY_DOCUMENT_SELEC" value=""/>
<param name="MENU_RRI" value=""/>
<param name="MENU_EXPORT_TO_CSV" value=""/>
<param name="MENU_EXPORT_TO_XLS" value=""/>
<param name="MENU_BOOKMARK" value=""/>
<param name="MENU_CHARACTERISTIC_PROPERTIES" value=""/>
<param name="MENU_VALUE_PROPERTIES" value=""/>
<param name="MENU_QUERY_PROPERTIES" value=""/>
<param name="MENU_VARIABLE_SCREEN" value=""/>
<param name="MENU_CURRENCY_CONVERSION" value=""/>
<param name="MENU_ENHANCED" value=""/>
TEMPLATE PROPERTIES
</object>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft DHTML Editing Control">
<TITLE>SAP BW Reporting Print Page</TITLE>
<link href="/sap/bw/Mime/BEx/StyleSheets/BWReports.css" type="text/css" rel="stylesheet"/>
<script type"text/javascript">
<!--
// Global Variable Definition
var dataTable = "";
var pageRowCnt = 0;
var prevPage = 0;
var ColumnCnt = 0;
var PrintDateTimeStamp = new Date();
var rptWidth = 0;
//DATE STAMP FUNCTION
function datestamp(){
var Today = new Date()
document.write(Today);
function getReportTitle() {
var myQueryString = window.location.search;
var startOfRptTitle = myQueryString.indexOf("QTITLE=");
if (startOfRptTitle != -1)
var endOfRptTitle = myQueryString.indexOf("&", startOfRptTitle + 7);
var myTitle = unescape(myQueryString.substring(startOfRptTitle + 7, endOfRptTitle));
var rpttitle = "";
for(i=0;i<myTitle.length;i++){
if (myTitle.substring(i,i+1) == "+"){
rpttitle = rpttitle + ' ';
else
rpttitle = rpttitle + (myTitle.substring(i,i+1));
else
var rpttitle = "Unspecified Query Title";
return rpttitle;
queryTitle=getReportTitle();
function getHeading2() {
var myQueryString = window.location.search;
var startOfHdr2 = myQueryString.indexOf("HDR2=");
if (startOfHdr2 != -1)
var endOfHdr2 = myQueryString.indexOf("&", startOfHdr2 + 5);
var myHdr2 = unescape(myQueryString.substring(startOfHdr2 + 5, endOfHdr2));
var hdr2 = "";
for(i=0;i<myHdr2.length;i++){
if (myHdr2.substring(i,i+1) == "+"){
hdr2 = hdr2 + ' ';
else
hdr2 = hdr2 + (myHdr2.substring(i,i+1));
else
var hdr2 = "#";
return hdr2;
header2=getHeading2();
function getHeading3() {
var myQueryString = window.location.search;
var startOfHdr3 = myQueryString.indexOf("HDR3=");
if (startOfHdr3 != -1)
var endOfHdr3 = myQueryString.indexOf("&", startOfHdr3 + 5);
var myHdr3 = unescape(myQueryString.substring(startOfHdr3 + 5, endOfHdr3));
var hdr3 = "";
for(i=0;i<myHdr3.length;i++){
if (myHdr3.substring(i,i+1) == "+"){
hdr3 = hdr3 + ' ';
else
hdr3 = hdr3 + (myHdr3.substring(i,i+1));
else
var hdr3 = "#";
return hdr3;
header3=getHeading3();
function getAsOfDate() {
var myQueryString = window.location.search;
var startOfRelevance = myQueryString.indexOf("ASOFDATE=");
if (startOfRelevance != -1)
var endOfRelevance = myQueryString.indexOf("&", startOfRelevance + 9);
var myRelevance = unescape(myQueryString.substring(startOfRelevance + 9, endOfRelevance));
var asof = "";
for(i=0;i<myRelevance.length;i++){
if (myRelevance.substring(i,i+1) == "+"){
asof = asof + ' ';
else
asof = asof + (myRelevance.substring(i,i+1));
else
var asof = "";
return asof;
asofDateTime=getAsOfDate();
function getPaperSize() {
var myQueryString = window.location.search;
var startOfPaperSize = myQueryString.indexOf("PSIZE=");
if (startOfPaperSize != -1)
var endOfPaperSize = myQueryString.indexOf("&", startOfPaperSize + 6);
var myPaperSize = unescape(myQueryString.substring(startOfPaperSize + 6, endOfPaperSize));
var psize = "";
for(i=0;i<myPaperSize.length;i++){
psize = psize + (myPaperSize.substring(i,i+1));
else
var psize = "0"; // default if none supplied (normal 8x11)
return psize;
varPaperSize=getPaperSize();
var PaperSizeParamString='&PSIZE=' + escape(varPaperSize);
switch(varPaperSize){
case "0": // Landscape - Letter
var WidthMax = 910;
var RowsPerPageMax = 38;
break;
case "1": // Landscape - Legal
var WidthMax = 1190;
var RowsPerPageMax = 38;
break;
case "2": // Portrait - Letter
var WidthMax = 660;
var RowsPerPageMax = 54;
break;
function getTotalColumns() {
var myHTML = dataTable.rows[1].innerHTML;
var TotalTDs = 0;
var nextTD = 0;
for (i=0;i<myHTML.length;i++) {
nextTD = myHTML.indexOf("<TD", i);
if (nextTD != -1) {
i=nextTD;
TotalTDs++;
else break;
return TotalTDs;
function GetPageHeadings() {
var headingHTM = "";
var leftspancnt = 0;
var rightspancnt = 0;
var headingspancnt = 2;
if (header2 != '#') headingspancnt = headingspancnt + 1; // adjust for extra headings
if (header3 != '#') headingspancnt = headingspancnt + 1;
if (currPage > 1) {
headingHTM += '<TR style="page-break-before:always; display:none; visibility:hidden; "><TD Colspan="' + ColumnCnt + '"></td></tr>';
else {
headingHTM += '<TABLE id="THEREPORT" name="MYREPORT" cellSpacing=0 cellPadding=0 width=' + WidthMax + ' border=0>';
if (ColumnCnt == 1) {
headingHTM += '<TR><TD vAlign=top align=left nowrap><font Size=3><STRONG>';
headingHTM += queryTitle;
headingHTM += '</STRONG></font></TD><TD Rowspan="' + headingspancnt + '" align="right" vAlign="top"><input type="image" border="0" name="SAPLogo" src="/sap/bw/Mime/Customer/Images/images.jpg" alt="SAP Logo"></TD></TR>';
if (header2 != '#') headingHTM += '<TR><TD vAlign="top" align="left"><FONT Size=1>' + header2 + '</FONT></TD></TR>';
if (header3 != '#') headingHTM += '<TR><TD vAlign="top" align="left"><FONT Size=1>' + header3 + '</FONT></TD></TR>';
headingHTM += '<TR><TD vAlign="top" align="left"><FONT Size=1>' + asofDateTime + '</FONT></TD></TR>';
headingHTM += '<TR><TD vAlign="top" align="left" Colspan="2"><hr size=2 color=black align=left></TD></TR>';
headingHTM += '<tr>' + dataTable.rows[0].innerHTML + '<TD> </TD></TR>';
else {
leftspancnt = Math.floor(ColumnCnt/2);
rightspancnt = ColumnCnt - leftspancnt;
headingHTM += '<TR><TD vAlign=top align=left nowrap Colspan="' + leftspancnt + '"><font Size=3><STRONG>';
headingHTM += queryTitle;
headingHTM += '</STRONG></font></TD><TD Rowspan="' + headingspancnt + '" Colspan="' + rightspancnt + '" align="right" vAlign="top"><input type="image" border="0" name="SAPLogo" src="/sap/bw/Mime/Customer/Images/images.jpg" alt="SAP Logo"></TD></TR>';
if (header2 != '#') headingHTM += '<TR><TD vAlign="top" align="left" Colspan="' + leftspancnt + '"><FONT Size=1>' + header2 + '</FONT></TD></TR>';
if (header3 != '#') headingHTM += '<TR><TD vAlign="top" align="left" Colspan="' + leftspancnt + '"><FONT Size=1>' + header3 + '</FONT></TD></TR>';
headingHTM += '<TR><TD vAlign="top" align="left" Colspan="' + leftspancnt + '"><FONT Size=1>' + asofDateTime + '</FONT></TD></TR>';
headingHTM += '<TR><TD vAlign="top" align="left" Colspan="' + ColumnCnt + '"><hr size=2 color=black align=left></TD></TR>';
headingHTM += '<tr>' + dataTable.rows[0].innerHTML + '</TR>';
return headingHTM;
function GetPageFooting() {
var footingHTM = "";
var leftspancnt = 0;
var rightspancnt = 0;
if (ColumnCnt == 1) {
footingHTM += '<TR><TD vAlign="top" align="left" Colspan="2"><hr size=2 color=black align=left></TD></TR>';
footingHTM += '<TR><TD vAlign="top" align="left" nowrap><FONT Size=1>Prepared: ';
footingHTM += PrintDateTimeStamp;
footingHTM += '</FONT></TD><TD vAlign="top" align="right"><FONT Size=1>';
footingHTM = footingHTM + 'Page ' + currPage.toString() + ' of ' + varPageTotal.toString();
footingHTM += '</FONT></TD></TR>';
else {
leftspancnt = Math.floor(ColumnCnt/2);
rightspancnt = ColumnCnt - leftspancnt;
footingHTM += '<TR><TD vAlign="top" align="left" Colspan="' + ColumnCnt + '"><hr size=2 color=black align=left></TD></TR>';
footingHTM += '<TR><TD vAlign="top" align="left" nowrap Colspan="' + leftspancnt + '"><FONT Size=1>Prepared: ';
footingHTM += PrintDateTimeStamp;
footingHTM += '</FONT></TD><TD vAlign="top" align="right" Colspan="' + rightspancnt + '"><FONT Size=1>';
footingHTM = footingHTM + 'Page ' + currPage.toString() + ' of ' + varPageTotal.toString();
footingHTM += '</FONT></TD></TR>';
return footingHTM;
function GetReportFooting() {
var footingHTM = "";
footingHTM += '</TABLE>';
return footingHTM;
function formatToPrint() {
var PrintHTM = "";
PrintHTM += GetPageHeadings();
if (ColumnCnt != 1) {
for (var i=1;i<dataTable.rows.length;i++) {
(currPage > prevPage)?prevPage=currPage:""; //increment current page count
if ((pageRowCnt + 1)>RowsPerPageMax){
PrintHTM += GetPageFooting();
pageRowCnt = 0;
currPage++;
if (prevPage != currPage) {
PrintHTM += GetPageHeadings();
else
PrintHTM += '<tr>' + dataTable.rows<i>.innerHTML + '</tr>';
pageRowCnt++;
PrintHTM += GetPageFooting();
PrintHTM += GetReportFooting();
return PrintHTM;
function DisplayPrintNotice() {
// Paper Size "0" is Letter with Landscape
// Paper Size "1" is Legal with Landscape
// Paper Size "2" is Letter with Portrait
if (varPaperSize == "0") {var varMessage ="nn From your browser File Menu, select Page Setup and do the following: nn 1) Adjust the Printer Orientation to Landscape n 2) select Print menu, then select the Print button.";}
if (varPaperSize == "1") {var varMessage ="nn From your browser File Menu, select Page Setup and do the following: nn 1) Adjust the Paper Size to Legal n 2) Adjust the Printer Orientation to Landscape n 3) select Print menu, then select the Print button.";}
//if (varPaperSize == "2") {var varMessage ="nn From your browser File Menu, select Page Setup and do the following: nn 1) Adjust the Paper Size to Letter n 2) Adjust the Paper Source (if necessary) n 3) Adjust the Orientation to Portrait (default) n 4) Select the Okay button nn Again select the File Menu, select Print, then select the Print button.";}
alert(varMessage);
//window.print()
/* SAP BW Reporting Stylesheet Revisions */
function writeStyleRevisions() {
function writeDynamicFontRevisions(dynafont) {
//Writes the Dynamic Stylesheet
-->
</script>
</HEAD>
<BODY>
<TABLE id="tp1" cellSpacing=0 cellPadding=0 width=660 border=0 >
<TR>
<TD vAlign=top align=left nowrap>
<object>
<param name="OWNER" value="SAP_BW"/>
<param name="CMD" value="GET_ITEM"/>
<param name="NAME" value="MYQUERY"/>
<param name="ITEM_CLASS" value="CL_RSR_WWW_ITEM_GRID"/>
<param name="DATA_PROVIDER" value="DATAPROVIDER_1"/>
<param name="GENERATE_CAPTION" value=""/>
<param name="GENERATE_LINKS" value=""/>
<param name="WIDTH" value="660"/>
<param name="BORDER_STYLE" value="NO_BORDER"/>
<param name="SUPPRESS_REPETITION_TEXTS" value=""/>
<param name="BLOCK_SIZE" value="3500"/>
<param name="SHOW_PAGING_AREA_TOP" value="X"/>
<param name="TARGET_DATA_PROVIDER_1" value="DATAPROVIDER_1"/>
ITEM: MYQUERY
</object>
</TD>
</TR>
</TABLE>
<SCRIPT type="text/javascript">
<!--
var tbls = document.body.getElementsByTagName("TABLE");
for (var i=0;i<tbls.length;i++) {
if (tbls<i>.name == "MYQUERY"){
var dataTable = tbls<i>;
break;
document.title = queryTitle;
rptWidth = dataTable.clientWidth;
rptHeight = dataTable.clientHeight;
originalRptWidth = rptWidth;
originalRptHeight = rptHeight;
originalRowHeight = Math.floor(rptHeight/(dataTable.rows.length+1));
rptPageHeightMax = 580; //660 less basic header and footer of 80
if (header2 != '#') rptPageHeightMax = rptPageHeightMax - 20; // adjust for extra headings
if (header3 != '#') rptPageHeightMax = rptPageHeightMax - 20;
if (dataTable.rows.length == 1) {
ColumnCnt = 1; //No Applicable Data found message
else {
ColumnCnt = getTotalColumns();
startingFont = 65;
varFontSize = startingFont;
if (rptWidth > WidthMax) {
while ((rptWidth > WidthMax) && (varFontSize > 15))
writeDynamicFontRevisions(varFontSize);
rptWidth = dataTable.clientWidth;
rptHeight = dataTable.clientHeight;
varFontSize = varFontSize - 5;
// calculate max rows per page
rowHeight = Math.floor(rptHeight/(dataTable.rows.length+1)) + 1; // add 1 for 2 row heading, add 1 for padding
RowsPerPageMax = Math.floor(rptPageHeightMax/rowHeight) - 2; // adjust for column headings
if (dataTable.rows.length == 1) {
varPageTotal = 1; //No Applicable Data found message
else {
totalRows = dataTable.rows.length-1; // total rows less headings
varPageTotal = Math.floor(totalRows/RowsPerPageMax); // compute total pages
if (totalRows != (varPageTotal * RowsPerPageMax)) {
varPageTotal = varPageTotal + 1; // if not a complete last page, add 1 for partial page
currPage = 1;
document.write(formatToPrint());
document.all.tp1.style.display = "none";
document.all.tp1.style.visibility = "hidden";
// DisplayPrintNotice();
-->
</SCRIPT>
<STYLE>
input.ie55 { display: none }
</STYLE>
<!-- special style sheet for printing -->
<STYLE media=print>
.noprint { display: none }
</STYLE>
<script defer>
function window.onload() {
if (!factory.object) {
return
else {
// factory.printing.header = "SAP"
// factory.printing.footer = "SAP"
if ( varPaperSize == "2" ) { factory.printing.portrait = true; }
else { factory.printing.portrait = false; }
factory.printing.Print(true);
// enable control buttons
/* var templateSupported = factory.printing.IsTemplateSupported();
var controls = idControls.all.tags("input");
for ( i = 0; i < controls.length; i++ ) {
controls<i>.disabled = false;
if ( templateSupported && controls<i>.className == "ie55" )
controls<i>.style.display = "inline";
</script>
<P>
<div id=idControls class="noprint" style="VISIBILITY: hidden">
<input disabled type="button" value="Print this page"
onclick="factory.printing.Print(true)">
<input disabled type="button" value="Page Setup..."
onclick="factory.printing.PageSetup()">
<input class=ie55 disabled type="button" value="Print Preview..."
onclick="factory.printing.Preview()">
<input class=ie55 disabled type="button" value="Landscape"
onclick="factory.printing.portrait=false">
<input class=ie55 disabled type="button" value="Portrait"
onclick="factory.printing.portrait=true">
</div>
</BODY>
</HTML> -
When I have a PDF that I want to open and save into iBooks - it will attempt to open it and the shelf flips around to make room for it. But it doesn't save it. I have to end up opening it in Adobe or Kindle app to view & save it. This has been doing this awhile, what's wrong. Should
I take it and have it looked at?is there any important stuff saved to your emails? if so you could log on to your emails from a seperate device and back them up. im not sure what else you could do :/
-
I have a pdf file which contains text if i copy all text and paste them into notpad and save file as .txt Is it change the ascii value of text ?
How to know character's encoding is ASCII?
-
Converting to PDF and Inserting into another PDF?
Is there a way to convert a file to PDF and then insert that file into another pdf using JavaScript?
Thanks,
ToddHi Paul,
Thanks for the response, this is actually an adobe form that has been saved as an adobe dynamic XML pdf. Is there a way to do this in a form via code?
What I would like to do is attach a supporting document to the form and Print both the form and the supporting document with a simple click, is this possible?
Any help or a point in the right direction would be appreciated.
Thanks,
Todd -
Convert xml file into .pdf and .html
hi all,
can any one let me know how can i show xml file values into pdf and html by using java
thanks in advancesreeks27 wrote:
hi all,
can any one let me know how can i show xml file values into pdf and html by using java
thanks in advanceTake a look at Apache FOP:
http://xmlgraphics.apache.org/fop/ -
To store PDF into BLOB and retrieve into OLE/OCX
We would like to:
1. Store a PDF file (output of a report saved in file server) into a BLOB
column.
2. Retrieve previously stored PDF in the BLOB column and display using either
OLE automation or ActiveX (OCX) control.
I read all related documents in metalink that addresses this issue however cant
get this to work. We have Acrobat Reader 4.0. Here are some issues from the
tests that I did:
1. To load the PDF file the program code that uses BFILE and LOADFROMFILE does
not work since the database is on a remote server and the PDF file is on a
local file server. The DIRECTORY created on the database is unable to find the
PDF file.
2. Though I want the loading of the file to be programmatic, I tried
right-click on the OLE container and inserted object from file. This loaded the
file into the container (Icon on the container appeared) however I was not able
to view the document by double-clicking. An error in Adobe occured: 'There was
an error opening this document. A file read error occured'. My guess is the
'Insert Object' did not insert the file properly into the BLOB.
3. When trying to display the PDF file stored in file server (in case storing
into BLOB does not work), I used an OCX control, right-clicked and Insert
Object and select Adobe Control for ActiveX. The problem here is when I run the
form, the OCX control shows up empty and I have to 'Insert Object' again in
runtime. Once I manually insert object from runtime the GET_INTERFACE POINTER &
SET_PROPERTY works fine is displaying the document. Is there any way to
maintain the control property of the OCX when the form is run?
4. Are there any workarounds and better solution to store PDFs into BLOBs and
retrieve and display in OLE/OCX controls? Using temporary file into local drive
is not an issue.
5. Would I be able to make use of 'PDF.PdfCtrl.1' OLE class?
6. Does OLE automation work for Acrobat Reader 4.0.?
I would appreciate all the help.
ShyamIm facing a similar kind of problem. I want to store and retrieve Office files, PDF and Jpegs into/from the database to view them on web in disconnected mode. Please reply as I cant find any help/documentation regarding saving BLOB data into files. I was able to store file data into BLOB, using DBMS_LOB package.
Shahzad -
XML document convert into String and Insert into Database
Hello all,
In the FIle to File Scenario I want to send the data to the Reciever System in xml Document and convert into String and insert into Database.
Please can you tell me exact way how to send it.
Thanks & Regards,
RajHI,
As per my understanding your scenario is File to file where you will get output fiel in XML format.
Now that XMl payload need to be passed as single string in the database via XI.
You cauld do this but you need to imply some manipulations such as
With the help of standard API you need to concatenate the XML tags and create the structre along with the data.
For e.g. in your outpuf file the XML structre contain data as
<field1>ABCD</field1>
Then in mapping
The source field will be mappeda s concat(<field1>) + value of Source field "ABCD" + concat(</field1>) to the target field.
This is the way that you could achive the requirments else there is no direct way avaialble for it.
thanks
Swarup -
Smartform into PDF and store in folder of application server
Hi Gurus,
I have to solve this issue please help meu2026
1.Convert Smartform into PDF and store in folder of application server
2.print the PDF stored in folder(Application Server) automatically
Please give suggestion for the above..
Moderator message: "spec dumping", please work yourself first on your requirement.
Edited by: Thomas Zloch on Oct 7, 2011 10:39 AMhi uma,
http://www.kodyaz.com/articles/sap-smartforms-download-as-smartform-pdf-using-ws_download-and-cl_gui_frontend_services.aspx
check this out...
thanks,
ram -
Script to encode jpg and mp3 into video for youtube?
Hi!
Sometimes I upload music and stand-up to youtube. Till now I used wine + avisynth + virtualdubmod to achieve this. Lately I realized that there is another smipler way to carry out things: ffmpeg
I was looking for some script or one-liner which makes the encoding task, but unfortunately none of those mentioned scripts worked. They are all obsolate that are mentioned by others. Some of them works, but the resulting video are denied by youtube. Do anybody know a simple one-liner or script (or maybe a handy application) which can do the transcoding the right way?You don't say if you want 1 or multiple .jpg images in the video.
http://www.ffmpeg.org/trac/ffmpeg/wiki/ … m%20images
Script to encode jpg and mp3 into video for youtube?
With x264/mp3 into a mp4 container? Any number of ways. Here are some examples.
ffmpeg -r 1 -i file.jpg -i file13.mp3 -c:a copy -c:v libx264 -b:v 500k ouput.mp4
ffmpeg -loop 1 -i file.jpg -c:v libx264 -t 30 -i file.mp3 -c:a copy out.mp4
ffmpeg -f image2 -i file.jpg -i audio.mp3 -c:a copy -c:v libx264 -b:v 500k output.mp4
Find out how you want to do, then if you want a script to automate it, something like
#! /usr/bin/env bash
echo "What image file?"
read image
echo "What audio file?"
read audio
echo "what video size?"
echo "Example: 640x480"
read size
echo "Output file name?"
read name
ffmpeg -f image2 -i "$image" -i "$audio" -c:a copy -c:v libx264 -b:v 500k -s "$size" "$name".mp4
exit
If you want to use multiple images, look at ffmpeg docs.
Last edited by teckk (2013-08-18 22:49:36) -
Can I convert 100 Tiffs to PDF and auto save them simultaneously?
Can I convert 100 Tiffs to PDF and auto save them simultaneously? I prefer to not have to use "Save As" for every single one.
Thank you for your time.http://answers.acrobatusers.com/I-convert-800-000-tiff-document-images-pdf-OCR-images-What -efficient-method-q42554.aspx
Maybe you are looking for
-
How to change keyboard map fmrweb.res for different forms
I'm using Oracle Forms 10g with Oracle Forms and Reports Application server 10g. I know how to change fmrweb.res to change how keys function on web forms. The problem I'm having is I only know how to assign the fmrweb.res file when connecting to the
-
Empty Weblogic Server 8.1 SP1 Repeating Stack Trace
Thanks in advance for any help and attention! An instance of Weblogic 8.1 SP1 on our UAT environment keeps on spitting out stack traces even though the only user accessing WL is via the admin console. There are no applications deployed on t
-
How to generate columnar PDM for HANA?
Hi Folks, I'm quite new to PowerDesigner and have been working on generating a HANA database from MS SQLServer. Currently I've been able to import a source SQLServer system as a Physical Data Model in PowerDesigner. I was then able to generate SQL DD
-
Iphone restore from iCloud on sat still not working properly
Most of phone functions are working but still waiting for apps to download and can't get imusic app to work well won't play any videos.
-
The photo library needs to be upgraded but it doesn't and won't open
When I go into IPhoto a message pops up that the photo library needs to be upgraded to work with this version of iPhoto, but when I hit upgrade it search's for an upgrade than another box pops up that say "you can't open your current photo library us