Reports output in Excel form fail - Finished successf output is voided
Hi
We have oracle 10g application server on solaris. A few of the reports are configured to have the output in PDF and other reports in excel form.
The reports which are configured to give the output in excel form fail with Finished successfully but output is voided.
I have the below paramters configured
<property name="cacheSize" value="1024"/>
<property name="cacheDir" value="/reports/reportoutput"/>
Are there any other parameters I should set or look out for. So that the reports are which give excel output are successfull.
Thanks
The problem has been solved. The report is successfull. But the OEM status was showing the message like that.
Thanks
Similar Messages
-
Forms sending report output horizantally in excel...
Hi....when I send my group above report output to exel it arranges each group horizantally. For example if there are two master groups 'A' & 'B' each of them having 500 child rows, then in excel fristly appears the Group 'A' with its 500 child records downwards. And group 'B' appears ahead of Group 'A' instead of down to Group 'A'. Is it not possible to arrange output in excel like that of oracle reports previewer???
Is there no one to answer this???
-
Sending report output via E-mail (excel pivoted format)
Hi all,
i have a written a report where i need to send the report output to somebody via
E-mail.i am sending this report output via E-mail successfully.The receiver receives, my output in excel format.but this excel is not <b>pivoted</b>.
i want , the receiver should get my output in pivoted excel format.i.e my output data should be exactly fit in the excel sheet.
now the columns in excel sheet are overlapping.once i double clicked, the columns are getting separated.i do not want to double click.i want all the columns should come properly i.e excel field length should be adjusted as per the output field length.
i am giving my coding below.plz suggest how i can do the above thing .it's urgent.
any idea will be highly appreaciated.
Regards
if not p_email1 is initial.
perform fill_report_csv.
perform f_send_internet_mail.
endif.
FORM fill_report_csv.
data : l_text(232) type c,
v_matnr1(21) type c,
v_matnr(21) type c,
v_matkl(14) type c,
v_maktx(45) type c,
v_ttlstk(14) type c,
v_verpr(14) type c,
v_werks(14) type c,
v_lgort(14) type c,
v_char(10) type c,
v_stks type p ,
v_po(40) type c,
v_qty(13) type c,
v_qty1 type sy-datum,
v_date(15) type c,
v_date1(15) TYPE C,
v_name(35) type c,
v_eknam(18) type c,
v_lifnr(15) type c,
l_po(40) type c,
v_matnr(20) type c,
l_rate(11) type p decimals 5,
l_flag type c.
concatenate c_equal c_colon 'PO no.' c_colon
into v_po.
concatenate c_equal c_colon 'Material no.' c_colon
into v_matnr.
concatenate c_equal c_colon 'Description.' c_colon
into v_maktx.
concatenate c_equal c_colon 'Due Qty.' c_colon
into v_qty.
concatenate c_equal c_colon 'Del Date.' c_colon
into v_date.
concatenate c_equal c_colon 'Vendor.' c_colon
into v_name.
concatenate c_equal c_colon 'Buyer.' c_colon
into v_eknam.
concatenate c_equal c_colon 'Vendor Code.' c_colon
into v_lifnr.
concatenate
v_po v_matnr v_maktx v_qty
v_date v_name v_eknam v_lifnr
into i_download
SEPARATED BY con_tab.
append i_download .
clear : v_po,v_matnr, v_maktx, v_qty, v_date, v_name, v_eknam,v_lifnr .
clear wa_output.
loop at i_output into wa_output.
on change of wa_output-ebeln.
clear v_lines.
loop at i_eket into wa_eket
where ebeln = wa_output-ebeln.
v_lines = v_lines + 1.
clear wa_eket.
endloop.
**-- Checking of page break
v_lines = sy-linno + v_lines .
if 55 < v_lines .
write:/0(161) sy-uline.
new-page.
endif.
clear v_lines.
loop at i_eket into wa_eket
where ebeln = wa_output-ebeln.
v_lines = v_lines + 1.
clear wa_eket.
endloop.
*-- Calculating the due qty.
wa_output-dumng = wa_output-menge - wa_output-wemng.
*-- Writing the Line items of the PO.
read table i_ekpo into wa_ekpo
with key ebeln = wa_output-ebeln
ebelp = wa_output-ebelp.
l_rate = wa_ekpo-netpr / wa_ekpo-peinh.
*-- Writing of PO detail
if wa_output-dumng gt 0 .
v_qty = wa_output-dumng.
v_date1 = wa_output-eindt.
v_maktx = wa_output-maktx.
if wa_output-maktx+0(1) = '"' .
concatenate c_equal wa_output-maktx
into v_maktx .
else .
concatenate c_equal c_colon wa_output-maktx c_colon
into v_maktx .
endif .
if wa_output-name1+0(1) = '"' .
concatenate c_equal wa_output-name1
into v_name .
else .
concatenate c_equal c_colon wa_output-name1 c_colon
into v_name .
endif .
v_name = wa_output-name1.
v_lifnr = wa_output-lifnr.
write wa_output-eindt to v_date1 DD/MM/YYYY.
concatenate '="' wa_output-ebeln '/'
wa_output-ebelp '"' into v_po .
concatenate '="' wa_output-matnr '"' into v_matnr .
concatenate c_equal c_colon wa_output-maktx c_colon
into v_maktx .
concatenate c_equal c_colon wa_output-dumng c_colon
into v_qty1 .
concatenate c_equal c_colon wa_output-eindt c_colon
into v_date1 .
concatenate c_equal c_colon wa_output-name1 c_colon
into v_name .
concatenate c_equal c_colon wa_output-eknam c_colon
into v_eknam .
concatenate c_equal c_colon wa_output-lifnr c_colon
into v_lifnr .
concatenate c_equal c_colon wa_mard-werks '/'
wa_mard-lgort c_colon
into v_lgort .
concatenate '="' wa_output-lifnr '"' into v_lifnr .
condense:v_po,v_matnr, v_maktx, v_qty, v_date, v_name, v_eknam,v_lifnr .
concatenate
v_po v_matnr v_maktx v_qty
v_date1 v_name v_eknam v_lifnr
into i_download
SEPARATED BY con_tab.
concatenate con_cret i_download INTO i_download .
append i_download .
endif.
clear : v_po,v_matnr, v_maktx, v_qty, v_date, v_name, v_eknam,v_lifnr .
endloop.
ENDFORM. " fill_report_csv
*& Form f_send_internet_mail
text
--> p1 text
<-- p2 text
FORM f_send_internet_mail.
Variables
data: it_packing_list like sopcklsti1 occurs 0 with header line,
it_contents like solisti1 occurs 0 with header line,
it_receivers like somlreci1 occurs 0 with header line,
it_attachment like solisti1 occurs 0 with header line,
gd_cnt type i,
gd_sent_all(1) type c,
gd_doc_data like sodocchgi1,
gd_error type sy-subrc.
data: it_message type standard table of SOLISTI1 initial size 0
with header line.
data : found_receiver type c,
v_title(80) type c,
l_text(180) type c.
Fill the document data.
gd_doc_data-doc_size = 1.
Adds text to email text table
append 'Pls see attached open purchase order report.' to it_message.
append '' to it_message.
concatenate 'Note: This is system generated report'
', figures may subject to actual physical count.'
into l_text separated by space.
append l_text to it_message.
Populate the subject/generic message attributes
CLEAR gd_doc_data.
READ TABLE i_download INDEX w_cnt.
gd_doc_data-doc_size =
( w_cnt - 1 ) * 255 + STRLEN( i_download ).
gd_doc_data-obj_langu = sy-langu.
gd_doc_data-obj_name = 'SAPRPT'.
if p_asdate is initial .
concatenate p_title ' '
sy-datum sy-uzeit into v_title separated by space.
else .
concatenate p_title ' '
p_bldat p_cputm into v_title separated by space.
endif .
gd_doc_data-obj_descr = v_title .
gd_doc_data-sensitivty = 'F'.
CLEAR t_attachment.
REFRESH t_attachment.
t_attachment[] = i_download[].
Describe the body of the message
clear it_packing_list.
refresh it_packing_list.
it_packing_list-transf_bin = space.
it_packing_list-head_start = 1.
it_packing_list-head_num = 0.
it_packing_list-body_start = 1.
describe table it_message lines it_packing_list-body_num.
it_packing_list-doc_type = 'RAW'.
append it_packing_list.
Create attachment notification
it_packing_list-transf_bin = 'X'.
it_packing_list-head_start = 1.
it_packing_list-head_num = 1.
it_packing_list-body_start = 1.
DESCRIBE TABLE t_attachment LINES it_packing_list-body_num.
it_packing_list-doc_type = 'XLS'.
it_packing_list-obj_descr = 'OPEN PURCHASE ORDER' .
it_packing_list-obj_name = 'PO.XLS' .
it_packing_list-doc_size = it_packing_list-body_num * 255.
APPEND it_packing_list.
assign SAP user smtp address from successful retrieval.
loop at p_email.
Add the recipients email address
found_receiver = 'X' .
it_receivers-receiver = p_email-low.
it_receivers-rec_type = 'U'.
it_receivers-com_type = 'INT'.
it_receivers-notif_del = ''.
it_receivers-notif_ndel = 'X'.
append it_receivers .
endloop .
Add default recipient email when unable to locate purc group email
if found_receiver is initial .
it_receivers-receiver = p_email.
it_receivers-rec_type = 'U'.
it_receivers-com_type = 'INT'.
it_receivers-notif_del = ''.
it_receivers-notif_ndel = 'X'.
append it_receivers.
endif .
Call the FM to post the message to SAPMAIL
call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
exporting
document_data = gd_doc_data
put_in_outbox = 'X'
commit_work = 'X'
importing
sent_to_all = gd_sent_all
tables
packing_list = it_packing_list
contents_bin = t_attachment
contents_txt = it_message
receivers = it_receivers
exceptions
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
others = 8.
Store function module return code
gd_error = sy-subrc.
Get it_receivers return code
loop at it_receivers.
endloop.
Instructs mail send program for SAPCONNECT to send email.
wait up to 2 seconds.
if gd_error eq 0.
submit rsconn01 with mode = 'INT'
with output = ' '
and return.
endif.
ENDFORM. " f_send_internet_mailHi,
go through this link,
http://www.sapdevelopment.co.uk/reporting/email/emailhome.htm
you have some sample programs.
Regards,
Raghavendra -
Error when sending report output to printer from Forms 10g
Hi,
I have a simple report that I am running from a form using run_report_object built-in. I can successfully send the report output to a file but when I send the report output to a printer my report is
terminated with report status of 'TERMINATED_WITH_ERROR'. I am using the default forms service and reports server that comes with the forms builder. How do I specify the reports server to user my default network printer ?Following is the code that runs my report.
Thanks,
Anna
PROCEDURE SEND_TO_PRINTER IS
repid REPORT_OBJECT;
v_rep VARCHAR2(100);
rep_status VARCHAR2(50);
rep_server system_variables.reports_server%type;
alldone exception;
BEGIN
select reports_server
into rep_server
from system_variables;
if rep_server is null then
msg_alert('Error getting the reports server name', 'I', FALSE);
raise alldone;
end if;
:ctrl.run_report_errors := 'N';
repid := find_report_object('REP_OBJ1');
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_SERVER,rep_server);
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_EXECUTION_MODE,BATCH);
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_COMM_MODE,SYNCHRONOUS);
IF :ctrl.rg_print = 'P' THEN
--Send the output to printer.
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESTYPE,PRINTER);
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESFORMAT,'dflt');
ELSIF :ctrl.rg_print = 'R' THEN
--Rich Text Format
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESTYPE,FILE);
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESFORMAT,'rtf');
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESNAME,:ctrl.filename);
END IF;
v_rep := RUN_REPORT_OBJECT(repid);
rep_status := REPORT_OBJECT_STATUS(v_rep);
WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED')
LOOP
rep_status := report_object_status(v_rep);
END LOOP;
IF rep_status = 'FINISHED' THEN
null;
ELSE
:ctrl.run_report_errors := 'Y';
msg_alert('Error when running report.' || rep_status, 'I', FALSE);
END IF;
EXCEPTION
when no_data_found then
msg_alert('Error getting the reports server name', 'I', FALSE);
when alldone then
null;
END;If you use Windows the user that runs the reports server is usually LocalSystem. Check this in the Windows Services panel.
LocalSystem has no printer access. To be able to print, you have to use a real domain user that has access to the printer. So, change the Log on properties in the Services panel. -
Report painter report in portal - Excel output in SAP GUI for HTML
Dear sirs,
I need your expertize. I would like to let my users display (Excel in place)/ save the result of my report painter reports into MS Excel. I have found notes 499262 a 314568, but didn´t understand the message (or there is no message:)). Does that mean I cannot use Excel in place together with Report painter and SAP GUI for HTML?
Second question: is there a place (user exit in generated code? I don´t even know what I am looking for) to get the data provided by the report painter engine and send the retrieved data to some custom function (to be able to call the Adobe form, to save it as a text file or any option how to manipulate the resulting data...?).
thank you for your time and effort,
regards OttoHi Otto,
You can send print the report to the spool and then use RSTXPDFT4 program to convert this spool to PDF file. Alternatively, you can export the spool to spreadsheet or ASCII file via SP01 transaction.
Additinally, I'm not aware of unability to use Excel output with SAP GUI interface.
Regards,
Eli -
Download the ALV Report output into excel sheet or notepad
Hi,
how to downlaod the alv report out into excel sheet or notepad in a proper manner. program contain large number records....
Thanks in advance!!!!
Regards,
kranthi.Hi
Download a report to excel with format (border, color cell, etc)
Try this program...it may help you to change the font ..etc.
Code:
REPORT ZSIRI NO STANDARD PAGE HEADING.
this report demonstrates how to send some ABAP data to an
EXCEL sheet using OLE automation.
INCLUDE OLE2INCL.
handles for OLE objects
DATA: H_EXCEL TYPE OLE2_OBJECT, " Excel object
H_MAPL TYPE OLE2_OBJECT, " list of workbooks
H_MAP TYPE OLE2_OBJECT, " workbook
H_ZL TYPE OLE2_OBJECT, " cell
H_F TYPE OLE2_OBJECT. " font
TABLES: SPFLI.
DATA H TYPE I.
table of flights
DATA: IT_SPFLI LIKE SPFLI OCCURS 10 WITH HEADER LINE.
*& Event START-OF-SELECTION
START-OF-SELECTION.
read flights
SELECT * FROM SPFLI INTO TABLE IT_SPFLI UP TO 10 ROWS.
display header
ULINE (61).
WRITE: / SY-VLINE NO-GAP,
(3) 'Flg'(001) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
(4) 'Nr'(002) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
(20) 'Von'(003) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
(20) 'Nach'(004) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
(8) 'Zeit'(005) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP.
ULINE /(61).
display flights
LOOP AT IT_SPFLI.
WRITE: / SY-VLINE NO-GAP,
IT_SPFLI-CARRID COLOR COL_KEY NO-GAP, SY-VLINE NO-GAP,
IT_SPFLI-CONNID COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP,
IT_SPFLI-CITYFROM COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP,
IT_SPFLI-CITYTO COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP,
IT_SPFLI-DEPTIME COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP.
ENDLOOP.
ULINE /(61).
tell user what is going on
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
PERCENTAGE = 0
TEXT = TEXT-007
EXCEPTIONS
OTHERS = 1.
start Excel
CREATE OBJECT H_EXCEL 'EXCEL.APPLICATION'.
PERFORM ERR_HDL.
SET PROPERTY OF H_EXCEL 'Visible' = 1.
CALL METHOD OF H_EXCEL 'FILESAVEAS' EXPORTING #1 = 'c:\kis_excel.xls'
PERFORM ERR_HDL.
tell user what is going on
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
PERCENTAGE = 0
TEXT = TEXT-008
EXCEPTIONS
OTHERS = 1.
get list of workbooks, initially empty
CALL METHOD OF H_EXCEL 'Workbooks' = H_MAPL.
PERFORM ERR_HDL.
add a new workbook
CALL METHOD OF H_MAPL 'Add' = H_MAP.
PERFORM ERR_HDL.
tell user what is going on
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
PERCENTAGE = 0
TEXT = TEXT-009
EXCEPTIONS
OTHERS = 1.
output column headings to active Excel sheet
PERFORM FILL_CELL USING 1 1 1 'Flug'(001).
PERFORM FILL_CELL USING 1 2 0 'Nr'(002).
PERFORM FILL_CELL USING 1 3 1 'Von'(003).
PERFORM FILL_CELL USING 1 4 1 'Nach'(004).
PERFORM FILL_CELL USING 1 5 1 'Zeit'(005).
LOOP AT IT_SPFLI.
copy flights to active EXCEL sheet
H = SY-TABIX + 1.
PERFORM FILL_CELL USING H 1 0 IT_SPFLI-CARRID.
PERFORM FILL_CELL USING H 2 0 IT_SPFLI-CONNID.
PERFORM FILL_CELL USING H 3 0 IT_SPFLI-CITYFROM.
PERFORM FILL_CELL USING H 4 0 IT_SPFLI-CITYTO.
PERFORM FILL_CELL USING H 5 0 IT_SPFLI-DEPTIME.
ENDLOOP.
changes by Kishore - start
CALL METHOD OF H_EXCEL 'Workbooks' = H_MAPL.
CALL METHOD OF H_EXCEL 'Worksheets' = H_MAPL." EXPORTING #1 = 2.
PERFORM ERR_HDL.
add a new workbook
CALL METHOD OF H_MAPL 'Add' = H_MAP EXPORTING #1 = 2.
PERFORM ERR_HDL.
tell user what is going on
SET PROPERTY OF H_MAP 'NAME' = 'COPY'.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
PERCENTAGE = 0
TEXT = TEXT-009
EXCEPTIONS
OTHERS = 1.
output column headings to active Excel sheet
PERFORM FILL_CELL USING 1 1 1 'Flug'(001).
PERFORM FILL_CELL USING 1 2 0 'Nr'(002).
PERFORM FILL_CELL USING 1 3 1 'Von'(003).
PERFORM FILL_CELL USING 1 4 1 'Nach'(004).
PERFORM FILL_CELL USING 1 5 1 'Zeit'(005).
LOOP AT IT_SPFLI.
copy flights to active EXCEL sheet
H = SY-TABIX + 1.
PERFORM FILL_CELL USING H 1 0 IT_SPFLI-CARRID.
PERFORM FILL_CELL USING H 2 0 IT_SPFLI-CONNID.
PERFORM FILL_CELL USING H 3 0 IT_SPFLI-CITYFROM.
PERFORM FILL_CELL USING H 4 0 IT_SPFLI-CITYTO.
PERFORM FILL_CELL USING H 5 0 IT_SPFLI-DEPTIME.
ENDLOOP.
changes by Kishore - end
disconnect from Excel
CALL METHOD OF H_EXCEL 'FILESAVEAS' EXPORTING #1 = 'C:\SKV.XLS'.
FREE OBJECT H_EXCEL.
PERFORM ERR_HDL.
FORM FILL_CELL *
sets cell at coordinates i,j to value val boldtype bold *
FORM FILL_CELL USING I J BOLD VAL.
CALL METHOD OF H_EXCEL 'Cells' = H_ZL EXPORTING #1 = I #2 = J.
PERFORM ERR_HDL.
SET PROPERTY OF H_ZL 'Value' = VAL .
PERFORM ERR_HDL.
GET PROPERTY OF H_ZL 'Font' = H_F.
PERFORM ERR_HDL.
SET PROPERTY OF H_F 'Bold' = BOLD .
PERFORM ERR_HDL.
ENDFORM.
*& Form ERR_HDL
outputs OLE error if any *
--> p1 text
<-- p2 text
FORM ERR_HDL.
IF SY-SUBRC <> 0.
WRITE: / 'Fehler bei OLE-Automation:'(010), SY-SUBRC.
STOP.
ENDIF.
ENDFORM. " ERR_HDL
Please note that this example maybe slow at filling the excel table
(perhaps four fields per second on a 900 MHz machine - almost 30 seconds
for a short example).
To get the data on properties and methods - there is a bit of smoke and mirrors
going on here; they are EXCEL properties and methods, not sap ones - so you need
to look at excel help to determine how a particular function is structured. then
build the block in sap, as shown in the example.
If you only want to transfer the data to Excel like when you transfer the data from
ALV to Excel simply use the Function Modules:
XXL_SIMPLE_API
If you want more modifications when you transfer it to Excel use:
XXL_FULL_API -
Hello friends
There is a report which gets generated when an IDOC is recieved, a spool request is generated in which this report is there in a particular output formate, the user wants that as it is generated it should be downloaded in excel sheet in that formate only.
I am unable to get that formate as many FORM are involved in that report output formate because of which I cannot directly download the internal table.
Thanks in advanceAnother way to do that is whenever it is writing something to spool in your various FORMs...add a line next to it to append the same information in an internal table. Finally, download the particular internal table to xls using GUI_DOWNLOAD.
example...
in your form..
write : / itab-xyz, itab-abc.
u can add the following line
concatenate itab-xyz itab-abc into itext-line separated by space.
append itext.
at the end of the report.
call function 'gui_download'
exporting
filename = 'c:\test.xls'
filetype = 'WK1'
tables
data_tab = itext. -
REPORT OUTPUT IN WORD OR EXCEL
Hi,
I need to convert my report output to word document with a customised logo in the word document. Can anyone please help me out by providing the necessary procedure (step by step process or code in abap).
Thanks and Regards
AKHi Ashok ,
You just copy this Abap code and run it. The output is an excel file .
REPORT ZKUN_FILE6 .
TABLES: USR03,DD02L.
DATA: ZX030L LIKE X030L.
DATA BEGIN OF ZDFIES OCCURS 0.
INCLUDE STRUCTURE DFIES.
DATA END OF ZDFIES.
DATA: BEGIN OF FLDITAB OCCURS 0,
FLDNAME(11) TYPE C,
END OF FLDITAB.
DATA ITABUSR03 LIKE USR03 OCCURS 0 WITH HEADER LINE.
DATA TNAME LIKE DD02L-TABNAME.
SELECT * FROM USR03 INTO TABLE ITABUSR03.
TNAME = 'USR03'.
PERFORM GETFIELEDS.
PERFORM SHOW123.
FORM GETFIELEDS.
CALL FUNCTION 'GET_FIELDTAB'
EXPORTING
LANGU = SY-LANGU
ONLY = SPACE
TABNAME = TNAME
WITHTEXT = 'X'
IMPORTING
HEADER = ZX030L
TABLES
FIELDTAB = ZDFIES
EXCEPTIONS
INTERNAL_ERROR = 01
NO_TEXTS_FOUND = 02
TABLE_HAS_NO_FIELDS = 03
TABLE_NOT_ACTIV = 04.
CASE SY-SUBRC.
WHEN 0.
LOOP AT ZDFIES.
FLDITAB-FLDNAME = ZDFIES-FIELDNAME.
APPEND FLDITAB.
ENDLOOP.
WHEN OTHERS.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
with SY-SUBRC.
ENDCASE.
ENDFORM.
FORM SHOW123.
CALL FUNCTION 'EXCEL_OLE_STANDARD_DAT'
EXPORTING
FILE_NAME = 'C:\USR03.XLS'
DATA_SHEET_NAME = 'USER LIST'
TABLES
DATA_TAB = ITABUSR03
FIELDNAMES = FLDITAB
EXCEPTIONS
FILE_NOT_EXIST = 1
FILENAME_EXPECTED = 2
COMMUNICATION_ERROR = 3
OLE_OBJECT_METHOD_ERROR = 4
OLE_OBJECT_PROPERTY_ERROR = 5
INVALID_FILENAME = 6
INVALID_PIVOT_FIELDS = 7
DOWNLOAD_PROBLEM = 8
OTHERS = 9.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM.
Thanks and Regards,
Kunal.
( hope this solves your problem.) -
Saving reports output in PDF or Excel
Hello, I am in the process of developing some oracle reports to run over the web. My question is. When the reports are run over the web how can I save the output in either PDF or Excel. The reports will be called from
a form with parameters passed. I am also having a problem whem the output is shown in htlm it is wrapped. Is there away to stop this data wrapping process from happening?
Thanks,
MorrisHi Ratheesh,
In a previuos posted message I've suggested to Carla close exactly the same you did after. And also did'nt worked.Anyway, just for your info.
Dear Carlangas (as we say in Mexico, with no offense)
Here is a workaround for you...
As I'm not a JSP expert developer in my case I will do next
It seems we are facing a problem with the DESFORMAT=PDF and report out parameter for your jsp report and requiere a jsp/reports experienced developer help or further investigation. I'm not saying it's not possible to generate a PDF output from a jsp report, but for the moment nobody has said how to.
I believe you saved your report in jsp format because you need your users review the report previuosly they may print it.
I also suppose you have a form with a magic button from where you launch your report.
Well I will call your existing button PREVIUOS or will add a nice gif icon and will create another one called PRINT or with a pretty printer .gif icon. This new button will call a RDF version of your report. As you have read is very easy to create PDF format/output report in RDF format.
Also your will need negotiate presentation with your customer. As you must know reports output in a Paper report, PDF, jsp formats are not always exactly the same because they are not simply the same.
Hope this help you. In the meantime you will save time for your investigation for a future release of your report. -
Hi Experts,
My requriement is I have to send a mail with report output in excel format as an attachment.
I wrote the below subroutine for building excel sheet but I am getting output in the single row. I am using version 4.6
Please help me regarding this. ASAP
FORM BUILD_XLS_DATA .
CONSTANTS: CON_CRET TYPE STRING VALUE '0D', "OK for non Unicode
CON_TAB TYPE STRING VALUE '09'. "OK for non Unicode
CONCATENATE 'Vendor' 'Country' 'Name'
INTO IATTACH SEPARATED BY CON_TAB.
CONCATENATE CON_CRET IATTACH INTO IATTACH.
APPEND IATTACH.
LOOP AT IT_lfa1.
CONCATENATE IT_lfa1-lifnr IT_lfa1-land1 IT_lfa1-name1 INTO IATTACH
SEPARATED BY CON_TAB.
CONCATENATE CON_CRET IATTACH INTO IATTACH.
APPEND IATTACH.
ENDLOOP.
ENDFORM. "build_xls_data
Thanx,
SudhaHi Sudha,
I am sending the standard format of sending a mail along with an attachment in .xls format.
Try this code.
form sendmail.
CLEAR GV_DELIMIT.
GV_DELIMIT = CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.
TEMPREAD = LV_LNCNT1.
REFRESH OBJTXT.
CONCATENATE 'The no. of error records are : ' TEMPREAD
INTO OBJTXT-LINE.
APPEND OBJTXT.
CLEAR OBJPACK. REFRESH OBJPACK.
CONCATENATE C_CODE
C_CMMT
C_COMMENT1
INTO OBJTXT-LINE SEPARATED BY GV_DELIMIT.
APPEND OBJTXT.
LOOP AT IT_DATA INTO WA_DATA.
CONCATENATE WA_DATA-ZCODE
WA_DATA-ZCOMMENT
WA_DATA-ZREASON
INTO OBJTXT-LINE SEPARATED BY GV_DELIMIT.
APPEND OBJTXT.
ENDLOOP.
CLEAR GV_DELIMIT.
CLEAR OBJPACK. REFRESH OBJPACK.
CLEAR DOC_CHNG.
TAB_LINES = 0.
OBJHEAD = REJFILE. APPEND OBJHEAD.
DESCRIBE TABLE OBJTXT LINES TAB_LINES.
READ TABLE OBJTXT INDEX TAB_LINES.
DOC_CHNG-OBJ_NAME = REJFILE.
MOVE TEXT-006 TO
DOC_CHNG-OBJ_DESCR.
DOC_CHNG-DOC_SIZE = ( TAB_LINES - 1 ) * 255 + STRLEN( OBJTXT ).
CLEAR OBJPACK-TRANSF_BIN.
OBJPACK-HEAD_START = 1.
OBJPACK-HEAD_NUM = 0.
OBJPACK-BODY_START = 1.
OBJPACK-BODY_NUM = 1. " 3.
OBJPACK-DOC_TYPE = 'RAW'.
APPEND OBJPACK.
FOR ASCII TO BINARY OBJECT FUNCTION
TOTLINEXFER = 0.
TOTXFER = 0.
BINMAXLEN = 255.
REFRESH OBJBIN.
LV_CR = CL_ABAP_CHAR_UTILITIES=>CR_LF.
TGTMAXLEN = BINMAXLEN.
TGTLEN = 0.
LOOP AT OBJTXT FROM 2.
IF NOT OBJTXT-LINE CP 'The no. of records are '." AND
CONCATENATE OBJTXT-LINE LV_CR INTO BUFFER.
SRCOBJLEN = STRLEN( BUFFER ).
SRCOBJPTR = 0.
WHILE SRCOBJLEN > 0 .
XFERLEN = TGTMAXLEN - TGTLEN.
IF XFERLEN > SRCOBJLEN.
XFERLEN = SRCOBJLEN.
MOVE BUFFERSRCOBJPTR TO OBJBIN-LINETGTLEN.
TGTLEN = TGTLEN + SRCOBJLEN.
SRCOBJLEN = 0.
CLEAR BUFFER.
ELSE.
MOVE BUFFER+SRCOBJPTR(XFERLEN) TO
OBJBIN-LINE+TGTLEN(XFERLEN).
APPEND OBJBIN.
CLEAR OBJBIN-LINE.
TGTLEN = 0.
SRCOBJLEN = SRCOBJLEN - XFERLEN.
SRCOBJPTR = SRCOBJPTR + XFERLEN.
TOTLINEXFER = TOTLINEXFER + 1.
ENDIF.
TOTXFER = TOTXFER + XFERLEN.
ENDWHILE.
ENDIF.
ENDLOOP.
IF TGTLEN > 0.
APPEND OBJBIN.
TOTLINEXFER = TOTLINEXFER + 1.
ENDIF.
CLEAR OBJPACK-TRANSF_BIN.
OBJPACK-TRANSF_BIN = 'X'.
OBJPACK-HEAD_START = 1.
OBJPACK-HEAD_NUM = 0.
OBJPACK-BODY_START = 1.
OBJPACK-BODY_NUM = TOTLINEXFER.
OBJPACK-DOC_TYPE = 'XLS'.
OBJPACK-OBJ_NAME = REJFILE.
OBJPACK-OBJ_DESCR = 'Rejected Entries File'.
OBJPACK-DOC_SIZE = TOTXFER.
APPEND OBJPACK.
REFRESH RECLIST.
MAIL1 = Recepient Mail Id
RECLIST-RECEIVER = MAIL1.
RECLIST-REC_TYPE = 'U'.
APPEND RECLIST.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
DOCUMENT_DATA = DOC_CHNG
PUT_IN_OUTBOX = 'X'
COMMIT_WORK = 'X'
TABLES
PACKING_LIST = OBJPACK
OBJECT_HEADER = OBJHEAD
CONTENTS_BIN = OBJBIN
CONTENTS_TXT = OBJTXT
RECEIVERS = RECLIST.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
endform.
Hope this is helpful to you. If you need further information, revert back.
Reward all the helpful answers.
Regards
Nagaraj T -
Can we generate output of a report in an Excel Sheet?
Hi All,
Can anyone tell me how to generate output of a report in an Excel Sheet format?
Thanks in advance,
Jasmine.hi,
try this sample...
data: begin of itab occurs 0,
vbeln like vbak-vbeln,
posnr like vbap-posnr,
end of itab.
select vbeln
posnr
from vbap
up to 20 rows
into table itab.
* EXCEL sheet using OLE automation.
INCLUDE OLE2INCL.
* handles for OLE objects
DATA: H_EXCEL TYPE OLE2_OBJECT, " Excel object
H_WORK TYPE OLE2_OBJECT,
H_SHEET TYPE OLE2_OBJECT,
H_CELL TYPE OLE2_OBJECT,
V_COL LIKE SY-TABIX. " column number of the cell
DATA:
V_STEP(30),
V_FILE LIKE RLGRAP-FILENAME.
* tell user what is going on
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
* PERCENTAGE = 0
TEXT = 'Creating Excel...'
EXCEPTIONS
OTHERS = 1.
* start Excel
V_STEP = 'Starting Excel'.
CREATE OBJECT H_EXCEL 'EXCEL.APPLICATION'.
PERFORM ERR_HDL.
SET PROPERTY OF H_EXCEL 'Visible' = 1.
CALL METHOD OF H_EXCEL 'APPEND'
EXPORTING #1 = 'D:SappdfABAP Trainingsheettr.xls'.
* PERFORM ERR_HDL.
* tell user what is going on
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
* PERCENTAGE = 0
TEXT = 'Adding Data to Excel...'
EXCEPTIONS
OTHERS = 1.
* Get the list of workbooks
V_STEP = 'Preaparing Excel'.
CALL METHOD OF H_EXCEL 'WORKBOOKS' = H_WORK.
PERFORM ERR_HDL.
** Add new workbook (create a file)
CALL METHOD OF H_WORK 'ADD'.
PERFORM ERR_HDL.
* Get the created worksheet
************************Sheet Number
CALL METHOD OF H_EXCEL 'WORKSHEETS' = H_SHEET EXPORTING #1 = 3.
************************Sheet Number
PERFORM ERR_HDL.
* Activate (select) the first sheet
CALL METHOD OF H_SHEET 'ACTIVATE'.
PERFORM ERR_HDL.
* tell user what is going on
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
* PERCENTAGE = 0
TEXT = 'Adding Data to Excel...'
EXCEPTIONS
OTHERS = 1.
* output column headings to active Excel sheet
V_STEP = 'Adding data to Excel'.
LOOP AT ITAB.
V_COL = SY-TABIX.
PERFORM FILL_CELL USING 1 V_COL ITAB-vbeln.
PERFORM FILL_CELL USING 2 V_COL ITAB-posnr.
ENDLOOP.
V_STEP = 'Releasing Excel'.
FREE OBJECT H_EXCEL.
PERFORM ERR_HDL.
H_EXCEL-HANDLE = -1.
*& Form ERR_HDL
* text
* --> p1 text
FORM ERR_HDL.
IF SY-SUBRC <> 0.
WRITE: / 'Error in processing Excel File:', V_STEP.
STOP.
ENDIF.
ENDFORM. " ERR_HDL
*& Form FILL_CELL
* text
* -->P_1 text
* -->P_1 text
* -->P_1 text
FORM FILL_CELL USING ROW COL VAL.
CALL METHOD OF H_EXCEL 'Cells' = H_CELL
EXPORTING #1 = ROW #2 = COL.
PERFORM ERR_HDL.
SET PROPERTY OF H_CELL 'Value' = VAL .
PERFORM ERR_HDL.
ENDFORM. " FILL_CELL
regards
satesh -
Date format in Excel report output
Goodmorning All.
Am using XML publisher for some reports. The current report is in Excel. Everything is fine on this. I want to print the date parameter in 'MON-YY' format.
In the 'Text Form Field' option, I have used the type as 'Regular Text'. In the 'Add Help Text' using the formatting as follows: <?format-Date:P_TO_DATE1;MM/YYYY?>. This seems to send the date parameter '1-Jun-12' as 'Jun-12'. But when it opens in excel, Excel assigns the cell 'Custom' format and type as 'd-mmm-yy' instead of 'mmm-yy'. So the final output still comes in DD-MON-YY format.
I have tried changing the type to 'DATE' and date format to 'MMM-yy' in the 'Text Form Field' option. But still the excel custom format is overriding the final output.
Any suggestions?
Thanks
ZHi Alex,
I used the following code in the 'Form field help Text': <?xdoxslt:format_date(P_FROM_DATE1,'MMM-yy','yyyy-MM-dd', 'en-us', $_XDOTIMEZONE)?>
Then I wrote some letters immediately after that and ran the report. When I opened it in excel, Excel assigned format category as 'General' to the output cell. So the output now comes as desired format as 'Jan-12XYZ'.
So it seems, if there will be some additional characters after the dates, then excel does not auto reformat the XML output to the custom date category.
Now the big question; How to do it without the trailing characters i.e. 'XYZ' in the above output. If I remove them, then Excel will again try to custom format the date. I read soemwhere that blank space can be used to append but am not sure how it will be in the code.
By the way in the 'text Form Field Options' I am using type as 'Regular Text'.
Appreciate any help.
Thanks
Z -
How to send the report output to the application server in a excel file
Hello,
how to send the report output to the application server in a excel file.
and the report runs in background.
Thanks in advance.
SundeepDear Sundeep.
I'm providing you with the following piece of code ... Its working fine for me ... hopefully it suits your requirement ...
D A T A D E C L A R A T I O N *
TYPES: BEGIN OF TY_EXCEL,
CELL_01(80) TYPE C,
CELL_02(80) TYPE C,
CELL_03(80) TYPE C,
CELL_04(80) TYPE C,
CELL_05(80) TYPE C,
CELL_06(80) TYPE C,
CELL_07(80) TYPE C,
CELL_08(80) TYPE C,
CELL_09(80) TYPE C,
CELL_10(80) TYPE C,
END OF TY_EXCEL.
DATA: IT_EXCEL TYPE STANDARD TABLE OF TY_EXCEL,
WA_EXCEL TYPE TY_EXCEL..
E V E N T : S T A R T - O F - S E L E C T I O N *
START-OF-SELECTION.
Here you populate the Internal Table.
Display - Top of the Page.
PERFORM DISPLAY_TOP_OF_PAGE.
E V E N T : E N D - O F - S E L E C T I O N *
END-OF-SELECTION.
SET PF-STATUS 'GUI_STATUS'.
E V E N T : A T U S E R - C O M M AN D *
AT USER-COMMAND.
CASE SY-UCOMM.
WHEN 'EXPORT'.
Exporting the report data to Excel.
PERFORM EXPORT_TO_EXCEL.
ENDCASE.
*& Form DISPLAY_TOP_OF_PAGE
text
--> p1 text
<-- p2 text
FORM DISPLAY_TOP_OF_PAGE .
SKIP.
WRITE: /05(128) SY-ULINE,
/05 SY-VLINE,
06(127) 'O R I C A'
CENTERED COLOR 1,
132 SY-VLINE.
WRITE: /05(128) SY-ULINE,
/05 SY-VLINE,
06(127) 'Shift Asset Depreciation - Period/Year-wise Report.'
CENTERED COLOR 4 INTENSIFIED OFF,
132 SY-VLINE.
WRITE: /05(128) SY-ULINE.
E X C E L O P E R A T I O N
CLEAR: IT_EXCEL[],
WA_EXCEL.
PERFORM APPEND_BLANK_LINE USING 1.
WA_EXCEL-cell_02 = ' XYZ Ltd. '.
APPEND WA_EXCEL TO IT_EXCEL.
CLEAR: WA_EXCEL.
WA_EXCEL-cell_02 = 'Shift Asset Depreciation - Period/Year-wise Report.'.
APPEND WA_EXCEL TO IT_EXCEL.
PERFORM APPEND_BLANK_LINE USING 1.
ENDFORM. " DISPLAY_TOP_OF_PAGE
*& Form APPEND_BLANK_LINE
text
-->P_1 text
FORM APPEND_BLANK_LINE USING P_LINE TYPE I.
DO P_LINE TIMES.
CLEAR: WA_EXCEL.
APPEND WA_EXCEL TO IT_EXCEL.
enddo.
ENDFORM.
*& Form EXPORT_TO_EXCEL
text
--> p1 text
<-- p2 text
FORM EXPORT_TO_EXCEL .
DATA: L_FILE_NAME(60) TYPE C.
Create a file name
CONCATENATE 'C:\' 'Shift_Depn_' SY-DATUM6(2) '.' SY-DATUM4(2)
'.' SY-DATUM+0(4) INTO L_FILE_NAME.
Pass the internal table (it_excel which is already populated )
to the function module for excel download.
CALL FUNCTION 'WS_EXCEL'
exporting
filename = L_FILE_NAME
tables
data = IT_EXCEL
exceptions
unknown_error = 1
others = 2.
if sy-subrc <> 0.
message e001(ymm) with 'Error in exporting to Excel.'.
endif.
ENDFORM. " EXPORT_TO_EXCEL
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When you click the button - Export to Excel ( GUI-Status) you'll be able to export the content of the Internal Table to an Excel file .......
Regards,
Abir
Don't forget to award Points * -
Tabular form report export to excel
Hi,
I have a tabular form report and i want to export the tabular form report data to excel when a button is clicked on the tabular form.
can anyone help me out with this.
thanks.Hi,
Yes,
http://matzberger.de/oracle/spreadsheet-tut-en.html
http://garethroberts.blogspot.com/2007/10/excel-file-output-from-oracle.html
Br ,Jari
Also
Guides to tomcat + cocoon
http://carlback.blogspot.com/2007/03/apex-cocoon-pdf-and-more.html
http://www.poveravoce.net/blog/?p=85
And use this fop_post
http://rste.blogspot.com/2008/07/excel-export-from-apex-cocoon.html
Then of course there is other printing engines like BI publisher , jasper reports, birt ....
Edited by: jarola on Oct 1, 2009 12:33 AM -
How to change default output XMLP report to rtf/excel !
I used xmlp 5.6.2
The default output for report is pdf file.
Now i want to change default output to rtf or excel file
Please ! help me !Hi Brightsea,
We customized the code in FNDRSRUN.fmb, But we are not able to get the output in RTF format.
Our requirement is to display the report output in .rtf or .xls(Not required to defaultly as .rtf or .xls).
we are getting the following error.
"The XML page cannot be displayed
Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.
Invalid at the top level of the document. Error processing resource 'http://galaxian.bluestar.cvg0:8000/OA_CGI/FNDWRR.exe?t...
{\rtf1\ansi\deff0"
^
Regards,
suresh.
Maybe you are looking for
-
Lightroom 4.3 update exe wont open in windows vista..
I had no problem updating my laptop with windows 8 to lightroom 4.3 however, the exe file wont even open on my main computer using windows Vista.. 4.2 updater opens no problem but 4.3 updater doesn't solution? don't say update windows.. lol
-
Unicode Font in a PDF report (iTextSharp)
I tried to use unicode font (Arial Unicode MS - arialuni.ttf) in a PDF document generated with iTextSharp. I am able to create the PDF document with this font. In the iTextSharp documentation, we are suppose to be able to send unicode, but I don't
-
Audio level in timeline does not match the source's clips audio level
When I playback the sequence the audio level increases a considerable amount (6 to 8 Decibels) when compared to the audio of the source clip in the bin and the source quicktime located in the scratch folder. As a result I'm led to believe the issue i
-
Developer-Online: New Tutorial Released! PHP jQuery Autosuggest Facebook like
PHP jQuery Autosuggest Facebook like Building a database driven auto suggestion box with PHP/MySql and jQuery. We're going to check what a user has typed in, check against what is in our database and where there is a match, pass the results back in a
-
Hi Skype keeps on crashing have tried reinstalling several times. See below for problem details. Also please see attachment, any ideas? Problem signature: Problem Event Name: BEX Application Name: Skype.exe Application Version: 7.6.0.1