How to save the ALV Output in diffrent formats
Hi Experts,
I have a requirement wherein i need to save Hierarchical ALV output in different formats such as(as per user)in
Unconverted
Spreadsheet
Rich text format
HTML format
Copy to clipboard
This has to be acheived by clicking a button in application toolbar.
Can you share the CODE in detail
Thanks & Regards,
Ullas.
hi Ullas
http://abap4.tripod.com/Save_Report_Output_to_a_PDF_File.html
award points if u think it was useful
Similar Messages
-
How to put the alv output into the spool request?
Hi guys,
How to put the alv output into the spool request?
Thanks!Hi
Sending an ALV List screen output to SPOOL
Convert ALV list to PDF and send mails to respective persons
Regards
Pavan -
Want to save the alv output in local file
Hi,
i want to save the alv output to local file throuh menu.
in out put
system>LIst>save
using oops alv
Regards
Jagadeeshwar.BHi,
I get the following dump when i try to download alv output to local file.Please suggest what is to be done:-
Runtime Errors PERFORM_NOT_FOUND
Except. CX_SY_DYN_CALL_ILLEGAL_FORM
Date and Time 09/23/2008 22:09:28
Error analysis
An exception occurred that is explained in detail below.
The exception, which is assigned to class 'CX_SY_DYN_CALL_ILLEGAL_FORM', was
not caught in
procedure "METHOD_PRINT_TOP_OF_PAGE" "(FORM)", nor was it propagated by a
RAISING clause.
Since the caller of the procedure could not have anticipated that the
exception would occur, the current program is terminated.
The reason for the exception is:
The program "SAPLSLVC_FULLSCREEN" is meant to execute an external PERFORM,
namely the routine "TOP_OF_PAGE_BATCH " of the program "ZRTCLT06_ALV ", but
this routine does not exist.
Line SourceCde
133 endif.
134
135 export alv_form_html from abap_false
136 to memory id 'ALV_FORM_HTML'.
137
138 endform. " METHOD_END_OF_LIST
139 &----
140 *& Form METHOD_PRINT_TOP_OF_PAGE
141 &----
142 * text
143 ----
144 * --> p1 text
145 * <-- p2 text
146 ----
147 form method_print_top_of_page using value(i_table_index) type syindex.
148
149 if gt_grid-r_salv_fullscreen_adapter is bound.
150 if not gt_grid-i_callback_top_of_page is initial and
151 not i_callback_program is initial.
152 perform (gt_grid-i_callback_top_of_page)
153 in program (i_callback_program) using i_table_index.
154 endif.
155 else.
156 if not gt_grid-i_callback_top_of_page is initial and
157 not i_callback_program is initial.
158 perform (gt_grid-i_callback_top_of_page)
159 in program (i_callback_program).
160 endif.
161 endif.
162
>>>> endform. " METHOD_PRINT_TOP_OF_PAGE
164 ----
165 * FORM METHOD_PRINT_END_OF_LIST *
166 ----
167 * ........ *
168 ----
169 form method_print_end_of_list.
170 if not gt_grid-i_callback_end_of_list is initial and
171 not i_callback_program is initial.
172 perform (gt_grid-i_callback_end_of_list)
173 in program (i_callback_program).
174 endif.
175
176 endform. " METHOD_PRINT_END_OF_LIST
177 &----
178 *& Form METHOD_DOUBLE_CLICK
179 &----
180 * text
181 ----
182 * --> p1 text -
How to download the ALV output with colors into the excel sheet
Hi,
I'm having an ALV Grid report output where each and every row has some colors in it. When i download it to an excel sheet whatever the colors that comes on the output of the report the same should come in the excel sheet. When i download the output to an excel sheet using List --> Export -->Local file . If i open the excel files no colors are coming in the excel sheet.
can anyone tell how to get the colors in the excel sheet also. thanks...
Regards,
Rose.Hi Camila,
Use the OLE concept.
Check the below threads:
Colors in Excel Sheet
colors in alv
Regards,
Soumya. -
How to check the ALV output for the background job
Hi Guru,
We are having a cutomized report which will display the result like a ALV report.
We configured it as an background job, after the completion of the background job, it will send the result to the SPOOL, and we can use SP02 to check the output,
But it is not easy for user to directly check the result easily, is there an method we can save it as an spreadsheet and send the output to a specific location or mailbox and then user can check it easily
thanks,In SM37 ,select the Job > Spool > Select Spool No > Display Contents > Here it will show you the Output of the Report.Now select Ctrl +Shift + F12 , it will ask you to save the Spread sheet in specified location.
Best Regards,
Ankur -
How to display the ALV output in a Group format
Hello Experts,
I have my current ALV report output like this:
GROUP DESCRIPTION
group1 adsfadsfadsfa
group1 lkjadsfjlajdsfla
group1 adsfadsfadsf
group1 adsfadsfadfa
group2 adsfadsfafaa
group2 oiueworuowe
group2 zxvzcxvzvcsd
group2 oiuqoewruqw
And I need to display the output of my ALV report in a group format like this:
GROUP DESCRIPTION
group1 adsfadsfadsfa
lkjadsfjlajdsfla
adsfadsfadsf
adsfadsfadfa
group2 adsfadsfafaa
oiueworuowe
zxvzcxvzvcsd
oiuqoewruqw
Can anybody please let me know if there is any sample program/thread/help etc.
I grealty appreciate your help.
Thanks.Hi Rainer,
Thanks for the reply. I am using container for the ALV Display.
So I wrote my code lie this:
sort t_data by zgroup zdesc ( t_data is my output internal table) .
I have my ALV layout delcared like this:
data: alv_layout type lvc_s_layo.
So I have modified my code like this:
alv_layout-NO_MERGING = 'X'.
But it did'nt work. Please let me know if I need make any other changes.
Thanks again. -
How to download the report output into PDF format
Hi friedns
from the report output when user clicks download button
it has to download to PDF format
how to do this
thanks in advance
venuhi venu,
check this sample code
Save Report Output to a PDF File
This report takes another report as input, and captures the output of that report. The output is then converted to
PDF and saved to a local file. This shows how to use some of the PDF function modules, as well as an easy way to
create PDF files.
Source Code Listing
report zabap_2_pdf.
*-- Enhancements: only allow to be run with variant. Then called
*-- program will be transparent to users
*-- TABLES
tables:
tsp01.
*-- STRUCTURES
data:
mstr_print_parms like pri_params,
mc_valid(1) type c,
mi_bytecount type i,
mi_length type i,
mi_rqident like tsp01-rqident.
*-- INTERNAL TABLES
data:
mtab_pdf like tline occurs 0 with header line,
mc_filename like rlgrap-filename.
*-- SELECTION SCREEN
parameters:
p_repid like sy-repid, " Report to execute
p_linsz like sy-linsz default 132, " Line size
p_paart like sy-paart default 'X_65_132'. " Paper Format
start-of-selection.
concatenate 'c:\'
p_repid
'.pdf'
into mc_filename.
*-- Setup the Print Parmaters
call function 'GET_PRINT_PARAMETERS'
exporting
authority= space
copies = '1'
cover_page = space
data_set = space
department = space
destination = space
expiration = '1'
immediately = space
in_archive_parameters = space
in_parameters = space
layout = space
mode = space
new_list_id = 'X'
no_dialog= 'X'
user = sy-uname
importing
out_parameters = mstr_print_parms
valid = mc_valid
exceptions
archive_info_not_found = 1
invalid_print_params = 2
invalid_archive_params = 3
others = 4.
*-- Make sure that a printer destination has been set up
*-- If this is not done the PDF function module ABENDS
if mstr_print_parms-pdest = space.
mstr_print_parms-pdest = 'LOCL'.
endif.
*-- Explicitly set line width, and output format so that
*-- the PDF conversion comes out OK
mstr_print_parms-linsz = p_linsz.
mstr_print_parms-paart = p_paart.
submit (p_repid) to sap-spool without spool dynpro
spool parameters mstr_print_parms
via selection-screen
and return.
*-- Find out what the spool number is that was just created
perform get_spool_number using sy-repid
sy-uname
changing mi_rqident.
*-- Convert Spool to PDF
call function 'CONVERT_ABAPSPOOLJOB_2_PDF'
exporting
src_spoolid= mi_rqident
no_dialog = space
dst_device = mstr_print_parms-pdest
importing
pdf_bytecount = mi_bytecount
tables
pdf = mtab_pdf
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.
call function 'DOWNLOAD'
exporting
bin_filesize = mi_bytecount
filename = mc_filename
filetype = 'BIN'
importing
act_filename = mc_filename
tables
data_tab = mtab_pdf.
FORM get_spool_number *
Get the most recent spool created by user/report *
--> F_REPID *
--> F_UNAME *
--> F_RQIDENT *
form get_spool_number using f_repid
f_uname
changing f_rqident.
data:
lc_rq2name like tsp01-rq2name.
concatenate f_repid+0(8)
f_uname+0(3)
into lc_rq2name separated by '_'.
select * from tsp01 where rq2name = lc_rq2name
order by rqcretime descending.
f_rqident = tsp01-rqident.
exit.
endselect.
if sy-subrc ne 0.
clear f_rqident.
endif.
endform." get_spool_number
Regards,
Naveen -
How to export the sql output to Excel?
I installed Raptor on my system. I ran few reports and trying to figure out how to save the reprots to excel srpeasheet format. I just see 'save' but not sure where the output is saved and with what filename. Saveas is grayed out all the time.
Unfortunately, there are some things that Excel gets confused going through CSV files (or copy and pate). For example, our task number structure within Oracle Projects is to name each task with the super-task number "-" sub task number (10, 10-1, 10-2, 10-3, etc). As soon as you are not directly creating the Excel file, Excel will interpret the "10-1", "10-2", etc as dates - 10-Jan, 10-Feb for our date format and presumably 1-Oct, 2-Oct for US date format.
I have just tested exporting the data to CSV and then opening in Excel and also selecting all data, copying and pasting into Excel and both convert "10-1" to 10-Jan (assumes current year).
You get similar issues with text columns that contain only numeric values (for example our employee numbers are stored in a text field, but are numeric and left passed with zeros to ensure consistent length), or a mixture of numeric values and alpha-numeric values. -
How to extract in the ALV output the old data using EXTRACT
Dear Friends,
I have requiremnt where the user executes the report -
using REUSE_ALV_GRID_DISPLAY FM. On the output
i have given an option to user to edit values on the output. So user will edit the values and updating to the data base this
the functionality which we have given to the custom report till now . Now the user came back and asking to provide a SAVE
option on the ALv output so that before updating the total records to the database he can re edit the values which he
has entered previous day . To do this functionality i have read in ALV documentation using the EXTRACT- INCLUDE vex01top.
I have added this but iam not getting exactly how to do this option when the user saves on the ALV output how can he retrive back the saved data on to the output again( i.e on the ouput screen) using the Extract functionality . If any body has done this
do help me . I would like to know should we maintain any custom table for this,for saving the records when user press
save button? .
Thanks & Regards
Madhuri.> i have read in ALV documentation using the EXTRACT- INCLUDE vex01top.
I don't know where you got that. You have to define your own GUI status (first, copy it from standard status STANDARD_FULLSCREEN of function group SLVC_FULLSCREEN) with your button, and define as follows:
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = l_repid
i_callback_pf_status_set = 'SET_PF_STATUS'
i_callback_user_command = 'USER_COMMAND'
FORM set_pf_status USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'USER_STATUS' EXCLUDING rt_extab.
ENDFORM. "set_pf_status
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
IF r_ucomm = 'SAVE'.
ENDIF.
ENDFORM.
> I would like to know should we maintain any custom table
Of course. Create your own custom table. Where else do you want to store data? -
How to do the ALV report output in groups and caluculate the tOTALS(URGENT
Hi
In my ALV report output .I have to group the output based on the DAYS field
0-10 days in one group
10-30 days in one group
above 30 days one group
There is also a field by name "AMOUNT" in my output.
I have to calculate SUBTOTALs at the end of every group and at the end of the report i should caluculate GRAND TOTAL.
Please remember that i should not use any any BLOCKED ALVs and for Totals i should not use the SYMBOLS provided in the application toolbar of the report
Thanks in AdvancePlease don't repost your questions...
Check out my answer in your other post.
How to make the ALV report in groups and caluculate the TOTALS
Regards,
Naimesh Patel -
How to send the ALV GRID output to spool by using the print button in std t
How to send the ALV GRID output to spool by using the print button in standard tool bar.
We have created a button in the va02 transaction. If user click on the button the new screen will be display on that screen we are populating the alv grid output using the oops concept. But i am unable to send the output to spool using the print button in the standard tool bar.
I am able to display the Print parameter dialog box but i am not able to send it to spool.
Kindly help.
Thanks In Advance.
G.V.RamanaHi Shaik,
There is not properties button in my print screen.
MODULE user_command_0900 INPUT.
WHEN 'EXCEL'.
PERFORM excel_download.
WHEN 'PRI'.
PERFORM print_output.
form Print_output.
CALL FUNCTION 'RSPO_LIST_LAYOUT_FITS'
EXPORTING
columns = 80
device = 'ANY '
lines = 65
maxpenality = 1999
TABLES
layouts = lt_layouts1
EXCEPTIONS
unknown_device = 1
OTHERS = 2.
IF sy-subrc = 0.
LOOP AT lt_layouts1.
IF lt_layouts1-penality < 1000 AND
lt_layouts1-penality < l_min_penality.
l_layout = lt_layouts1-layout.
l_min_penality = lt_layouts1-penality.
ENDIF.
ENDLOOP.
IF NOT l_layout IS INITIAL.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
mode = 'CURRENT'
line_size = 80 "#EC *
new_list_id = l_new_list_id
no_dialog = l_no_dialog
layout = l_layout
IMPORTING
out_archive_parameters = rs_arc_params
out_parameters = rs_pri_params
valid = l_valid
EXCEPTIONS
archive_info_not_found = 1
invalid_print_params = 2
invalid_archive_params = 3
OTHERS = 4.
IF sy-subrc NE 0. " INS SLIN
ENDIF. " INS SLIN
IF rs_pri_params-linsz LT 80 OR
rs_pri_params-linsz LT gt_stack-s_lprint-width.
gt_stack-print_line_break = 'X'.
ELSE.
CLEAR gt_stack-print_line_break.
ENDIF.
IF l_valid NE 'X'.
rs_pri_params = ls_pri_params_sav.
rs_arc_params = ls_arc_params_sav.
ENDIF.
ENDIF.
ENDIF.
endform. " Print_output
CALL METHOD gv_cost_tot_alv_grand->set_table_for_first_display
EXPORTING
is_layout = gs_layout_cost_tot_grand
CHANGING
it_fieldcatalog = gt_fcat_cost_tot_grand[]
it_outtab = gt_cost_tot_grand[].
Please check my code -
How to save the output of sap script to pdf document in sap
hi abapers
how to save the output of sap script in sap so that can retrieve the saved document later.
i have to save the rcia output from sap script in pdf document in sap so that it can be retrieved later
how to use dmsHi deepika,
This thread will solve ur problem OTF -> PDF
Regards,
Pravin -
How to save the output of sap script in sap so that can be retrieved later
hi abapers
how to save the output of sap script in sap so that can retrieve the saved document later.
i have to save the rcia output from sap script in pdf document in sap so that it can be retrieved later
how to use dms
<MOVED BY MODERATOR TO THE CORRECT FORUM>
Edited by: Alvaro Tejada Galindo on Dec 26, 2008 11:01 AMHi Deepika,
Look into this link https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/401cca81-b861-2910-ada2-f416dfb3b3fe
Regards,
Pravin -
How to insert blank lines in the ALV output.
Hi Friends,
Could any body help me out How to insert blank lines in the ALV output.?? Any Code pls...
Thank you,
Vikram.Chi vikram
do like this
In the fieldcatalog table all the fields should be in editable mode
ie lw_fcat-edit = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_pf_status_set = 'SET_PF_STATUS'
i_callback_user_command = 'USER_COMMAND'
is_layout = lv_layout
it_fieldcat = lt_fcat[]
i_save = 'A'
is_variant = lv_variant
TABLES
t_outtab = lt_license[]
EXCEPTIONS
program_error = 1
OTHERS = 2.
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. " display_data
*& Form user_command
FORM user_command USING r_ucomm TYPE sy-ucomm
rs_selfield TYPE slis_selfield.
CASE r_ucomm.
WHEN 'ADD'. "
data: lv_ind type i.
data: lv_line type i.
describe table lt_license lines lv_line.
loop at lt_license into lw_license.
lv_ind = sy-tabix.
if lv_ind = lv_line.
append initial line to lt_license.
endif.
endloop.
ENDCASE.
ENDFORM. "user_command
reward points if useful
Rohan -
How to send the alv list display to spool
Hi all,
I am executing a program in foreground. My requirement is sending alv list output to spool. When i execute the smae program in background mode the SAP is handling the spool output in hierarchial list display. How to get the same output in foreground also.
Thanks and Regards,
Vijay.Hi max,
I think my question is not clear.
when I execute my report in background mode, I can able to see the output in the spool.
But when I execute the same report in foreground no spool output is getting generated.
To handle this I am calling some function modules like RSPO_OPEN_SPOOLREQUEST , RSPO_WRITE_SPOOLREQUEST, RSPO_WRITE_SPOOLREQUEST. But by using this i cannot able to get the desired output in alv list display format. what to do to get my desired output.
Thanks and Regards,
Vijay.
Maybe you are looking for
-
Can I use Visual Basic to covert form user data from multiple .pdf files to a single .csv file? If so, how?
-
Hi all, pls post me the FM to get only RAW material cost of FG material. not include man, machine and other cost. Best Regards Nazar
-
It was there and now it's gone
I had a site, was using my sister's dot mac. It published fine. I got my own trial account, site was still publishing to my sister's. Did a ton of updating yesterday, saved site in file with name other than domain, worked great, people tested, worked
-
Oracle.mds.versioning.VersioningNotSupportedException: MDS-01900
Hi people, I'm trying set a label in my MDS to test customizzations in my application with this code: public void meuMetodo() { try { MDSInstance mds = (MDSInstance)ADFContext.getCurrent().getMDSInstanceAsObject(); VersionHelper vh = VersionHelper.ge
-
Hi: How add a new Row in a JTable