Download alv report in excel format in Linux
Hi All,
I am working on SAP GUI for Java in Linux PC. I have installed
Open Office.
After executing an alv report there is no spreadsheet option
to download the report in excel format .
Also, when doing Save as Local File -> Spreadsheet ,
the report is not downloaded in proper format.
So, how to download the alv reports in excel format ?
Hi Vinod ,
Save as Local File -> Spreadsheet
It will ask for Directory and file name with .xls format . Give proper name e.g. test.xls and save, and after saving file right click on the file and click on Open with "OpenOffice.org calc".
It will definetly work.
Abhijeet
Similar Messages
-
Download alv report to excel in linux
Hi All,
I am working on SAP GUI for Java in Linux PC. I have installed
Open Office.
After executing an alv report there is no spreadsheet option
to download the report in excel format .
Also, when doing Save as Local File -> Spreadsheet ,
the report is not downloaded in proper format.
So, how to download the alv reports in excel format ?
Edited by: Vinod Iyer on Jan 8, 2008 11:51 AMThe problem of course is that you can't actually call up EXCEL on a Linux machine so such XXL functions as call function 'ALV_XXL_CALL' will not work.
I don't think SAP has OPEN OFFICE integration -- and even if you use EXCEL via the Linux Cross Over Office it is unlikely to work.
You might need to fiddle around with the internal file format yourself before saving it as a local file.
For EXCEL 2007 you actually have a better chance since if you save in TRUE EXCEL 2007 format the data is saved in a type of XML file.
You can read about the EXCEL 2007 new file formats on the M$ site. Note however that you will need to download the EXCEL 2007 file viwer to read the file with earlier versions of EXCEL.
(You can use EXCEL 2007 in "compatability" mode but using an XML file IMO seems a better option).
If you use a lot of EXCEL functionality probably the best option is to install Windows as a VM on your linux machine (VMWARE/PARALLELS/VMBOX etc) and then run the standard SAPGUI from the Windows VM.
Probably not the answer you want but it's the best I can do.
Cheers
jimbo -
Problem in downloading ALV report to Excel
hi All,
i am facing the problem when i am trying to download the ALV report to Excel format i should have the option to save as the Excel file from the dropdown where as instead of it i am getting the option to save as XML file.
is it something related to settings in SAP or is it done through programatically.
thanks,Anyways is this happening for every one in your team or just for one. If the latter, looks like the user has selected the download in XML format & checked the "remember these settings" checkbox
You can refer to this link on how to change the default settings: [http://home4sap.com/Blog/2010/03/ecc5-0-alv-default-file-format-when-extracting-files-to-excel/|http://home4sap.com/Blog/2010/03/ecc5-0-alv-default-file-format-when-extracting-files-to-excel/]
You can also check this SAP offers the possibility to make from transaction FAGLB03 a download
Edited by: Suhas Saha on Apr 13, 2010 4:40 PM -
How to send ALV Report in excel format from SAP
Hi Gurus,
We are using SAP 4.7 and using different SAP reports.Now I want to send SAP ALV report in excel format directly from SAP in background.Now we send these reports in background weekly by using autimetic scheduling but this is PDF format.Now I want to change this pdf format to excel format.In SCOT T.Code I am able to find any excel format.Please help me out.
I am waiting for your reply.
Advance Thanks
NirmalHi Nirmal,
I have done the same in my previous organisation.For this particular solution you need to ask your basis guys to upgrade the support package so that BCS classes could be available in the system.
API interafces five some problem with attachemnts and SAP has recommended to use BCS classes.
Currently BCS classes won't be availbale in 4.7.
Once the BCS classes are available
use below code
CONSTANTS:
lc_tab TYPE c VALUE cl_bcs_convert=>gc_tab,
lc_crlf TYPE c VALUE cl_bcs_convert=>gc_crlf,
lc_codepage TYPE abap_encod VALUE '4103',
data :
lv_string TYPE string,
binary_content TYPE solix_tab,
size TYPE so_obj_len,
*" Set Heading of Excel File
CONCATENATE 'Employee DATA'
lc_crlf lc_crlf
INTO lv_string.
*" Set Header for Excel Fields
CONCATENATE lv_string
lc_header1 lc_tab
lc_header2 lc_tab
lc_header3 lc_tab
lc_header4 lc_tab
lc_header5 lc_tab
lc_header6 lc_tab
lc_header7 lc_tab
lc_header8 lc_tab
lc_header9 lc_tab
lc_header10 lc_crlf
INTO lv_string.
"lc_header1 to 10 could be your field headers
"Move Internal table data
LOOP AT gt_final1 INTO gwa_final1.
CONCATENATE lv_string
gwa_final1-field1 lc_tab
gwa_final1-field2 lc_tab
gwa_final1-field3 lc_crlf
INTO lv_string.
ENDLOOP.
*" convert the text string into UTF-16LE binary data including
*" byte-order-mark. Mircosoft Excel prefers these settings
*" all this is done by new class cl_bcs_convert (see note 1151257)
TRY.
cl_bcs_convert=>string_to_solix(
EXPORTING
iv_string = lv_string
iv_codepage = lc_codepage "suitable for MS Excel, leave empty
iv_add_bom = abap_true "for other doc types
IMPORTING
et_solix = binary_content
ev_size = size ).
CATCH cx_bcs.
MESSAGE e445(so).
ENDTRY.
TRY.
*" create persistent send request
send_request = cl_bcs=>create_persistent( ).
document = cl_document_bcs=>create_document(
i_type = lc_doc
i_text = main_text
i_subject = lc_sub ).
document->add_attachment(
i_attachment_type = lc_attach "#EC NOTEXT
i_attachment_subject = lc_sub "#EC NOTEXT
i_attachment_size = size
i_att_content_hex = binary_content ).
send_request->set_document( document ).
recipient = cl_cam_address_bcs=>create_internet_address( email ).
CALL METHOD send_request->add_recipient
EXPORTING
i_recipient = recipient.
IF recipient IS NOT INITIAL.
sent_to_all = send_request->send( i_with_error_screen = abap_true ).
COMMIT WORK.
* MESSAGE text-014 TYPE gc_succ .
ENDIF.
CATCH cx_bcs INTO bcs_exception.
MESSAGE i865(so) WITH bcs_exception->error_type.
ENDTRY.
For BCS decalartion u can go to se 38 and see program BCS_EXAMPLE_1 to BCS_EXAMPLE_7.
Rewrads if helpful.
Cheers
Ramesh Bhatt -
Dump in prodcution server while downloading ALV report to excel sheet
HI ALL,
ALV report is working fine in bother DEV and PROD servers....but in production while downloading report to excel sheet it is going to dump.
"dump is below:
Short text
Field symbol has not yet been assigned.
What happened?
Error in the ABAP Application Program
The current ABAP program "SAPLKKBL" had to be terminated because it has
come across a statement that unfortunately cannot be executed. "
But in development this problem is not there, iam able to download ALV report to EXCEL sheet.
Any help experts......
Thanks in advance
RamHi,
I had the same problem,
Run a consistency check for your ALV and you will find out. See if you havent passed any unnecessary parameter to FM.
/people/rainer.hbenthal/blog/2009/09/25/sos--my-alv-report-is-not-working
Dump while printing ALV (field symbol not assigned)
Sumit -
Download ALV report to excel sheet
halo fellow SAPiens,
i want to download my alv report into excel sheet...........for tht i used UGI_DOWNLOAD........here if i use the file type as 'ASC' all the leading zeros of numeric values are removed and date format is "yyyy/mm/dd".......
i need the leading zeros and date format in "dd/mmyyy"
when i use file type 'DBF' i get the leading zeros but my date is replaced by '#####.............wht shld i do...........To get the leading zeros to come, append an apostrophe to the start of each field that has the leading zeros as shown
loop at itab.
concatenate '''' itab-field1 into itab-field1.
modify itab.
endloop.
note that
1. This sometimes doesnt show correctly in excel and you may have to double click on the cell to prevent the apostrophe from displaying in the sheet
2. You field needs to have an extra character to add the apostrophe -
Downloading ALV report in excel and csv format
1.I have generated a report in ALV.
Now, I want a button 'generate' on my alv tooldbar.
How to do that?
2.Now clicking on that generate button will show a popup window containing the title 'Save list in file..'
And the window will contain two radio buttons to download the report in either in excel or in csv file format.
i. Spreadsheet(.xls)
ii.Spreadsheet(.csv)
How to get the popup window containing two radio buttons and having the options for downloading the alv report in the above file formats.
Kindly guide.@chandrasekhar:
Thanks for your response. I'll try with the export button but also willing to know how to create button on toolbar.And by clicking on that button a popup box will come having two radio buttons asking to download the report either in .xls or in .csv format. I am looking for the subroutines for that.
Thanks.
Message was edited by:
cinthia nazneen -
Help me to download my report in excel format.
Here is my code below. On selection screen I am giving three inputs.
And There are two radio buttons present on my selection screen.
first one is for display the report.
second button name is generate(to export the report).
Clicking on the generate radio button will show the report.
There should be a standard button on the toolbar called GENERATE.
Clicking on that button will show a popup window asking to download the report either in .xls format or in .csv format.
==========================================================
My report is being displayed perfectly.But not getting how to downlaod the report in excel and csv format. Would u plz guide me what should I write within the export_report function of my program so that I can download the report. Kindly guide.
REPORT ZMYREPORT.
TYPE-POOLS: SLIS.
TYPES: BEGIN OF t_afko,
aufnr type aufnr,
gamng type gamng,
plnbez type matnr,
END OF t_afko.
TYPES: BEGIN OF t_mara,
matnr TYPE matnr,
mtart type mtart,
pstat type pstat_d,
END OF t_mara.
TYPES: BEGIN OF t_output,
aufnr type aufnr, "Production order
gamng type gamng, "move number
mtart type mtart, "size/fit
pstat type pstat_d, "Variant
quantity type meng8, "Quantity
barcode(35) type c, "barcode
END OF t_output.
INTERNAL TABLES, WORK AREAS AND VARIABLES
*For work area.
DATA:
gwa_afko type t_afko, "work area for t_afko table
gwa_mara type t_mara, "work area for t_mara table
gwa_output type t_output, "work area for t_output table
gwa_output1 type t_output, "second work area for t_output table
gwa_fieldcat type slis_fieldcat_alv, "work area for slis_fieldcat_alv
gwa_top type slis_listheader, "work area for slis_listheader
wa_variant type disvariant, "work area for variant
wa_Variant1 type disvariant, "work area for variant
*For internal tables.
gi_afko TYPE STANDARD TABLE OF t_afko,
gi_mara TYPE STANDARD TABLE OF t_mara,
gi_output TYPE STANDARD TABLE OF t_output,
gi_fieldcat TYPE STANDARD TABLE OF slis_fieldcat_alv,
gi_top TYPE slis_t_listheader,
gi_download TYPE TABLE OF t_download,
*Variables for screen-input.
v_aufnr like caufvd-aufnr, "for production order
v_txt04 like tj02t-txt04, "for production order status
v_plnbez like afko-plnbez. "for article
*For constants.
CONSTANTS: quantity(1) type c value '1',
lv_save(01) TYPE c VALUE 'A',
c_csv TYPE char1 VALUE '|'.
S E L E C TI O N S C R E E N *
SELECTION-SCREEN:
BEGIN OF block inputpath1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS: s_aufnr for v_aufnr,
s_txt04 for v_txt04,
s_plnbez for v_plnbez.
SELECTION-SCREEN: END OF block inputpath1.
SELECTION-SCREEN:
BEGIN OF block inputpath2 WITH FRAME TITLE TEXT-002.
PARAMETERS:
p_disp RADIOBUTTON GROUP rb DEFAULT'X', "Button to display report
p_gen RADIOBUTTON GROUP rb. "button for generate option
SELECTION-SCREEN: END OF block inputpath2.
SELECTION-SCREEN:
BEGIN OF block inputpath3 WITH FRAME TITLE TEXT-003.
PARAMETERS:layout TYPE disvariant.
SELECTION-SCREEN: END OF block inputpath3.
I-N-I-T-I-A-L-I-Z-A-T-I-O-N *
INITIALIZATION.
DATA: g_repid LIKE sy-repid,
g_uname LIKE sy-uname.
g_repid = sy-repid.
AT SELECTION SCREEN *
*Function module for variant.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR layout.
wa_variant-username = g_uname.
wa_variant-report = g_repid.
*Display all existing variants
DATA: lv_exit(1) TYPE c.
*Code for variant part.
CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
EXPORTING
is_variant = wa_variant
i_save = lv_save
IMPORTING
e_exit = lv_exit
es_variant = wa_variant1
EXCEPTIONS
not_found = 1
program_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
layout = wa_variant-variant.
ELSE.
IF lv_exit = space.
layout = wa_variant1-variant.
ENDIF.
ENDIF.
MAIN PROGRAM *
AT SELECTION-SCREEN .
*For validating the user inputs on selection screen.
PERFORM validate_input.
START-OF-SELECTION *
START-OF-SELECTION .
SET PF-STATUS 'ZGUI1'.
IF p_disp = 'X'. "If the display radio button is checked.
perform zselection. "Data is fetched from tables.
ENDIF.
END-OF-SELECTION *
END-OF-SELECTION.
IF p_disp = 'X'.
PERFORM buildcat.
PERFORM display_report.
ELSEIF p_gen = 'X'.
PERFORM display_report.
PERFORM export_report.
ENDIF.
*& Form validate_input
Checking input data validation on the display screen. *
form validate_input.
*Local variables for input validation.
DATA: lv_aufnr type aufnr,
lv_txt04 type J_TXT04,
lv_plnbez type matnr.
IF s_aufnr[] is not initial.
SELECT aufnr up to 1 rows
FROM aufk
INTO lv_aufnr
WHERE aufnr IN s_aufnr.
ENDSELECT.
IF lv_aufnr IS INITIAL.
MESSAGE e001(zmssg).
ENDIF.
ENDIF.
IF s_txt04[] is not initial.
SELECT txt04 up to 1 rows
FROM TJ02T
INTO lv_txt04
WHERE txt04 IN s_txt04.
ENDSELECT.
IF lv_txt04 IS INITIAL. "this depicts that if s_txt04 is initial.
Message e002(zmssg).
ENDIF.
ENDIF.
IF s_plnbez[] is not initial.
SELECT plnbez up to 1 rows
FROM afko
INTO lv_plnbez
WHERE plnbez IN s_plnbez.
ENDSELECT.
IF lv_plnbez IS INITIAL. "this depicts that if s_plnbez is initial.
Message e003(zmssg).
ENDIF.
ENDIF.
endform. " validate_input
*& Form zselection
Fetches data *
form zselection .
SELECT aufnr "production order
gamng "move number
plnbez
FROM afko
INTO TABLE gi_afko
WHERE aufnr IN s_aufnr
AND plnbez IN s_plnbez.
SELECT matnr
mtart "size/fit
pstat "variant
FROM mara
INTO TABLE gi_mara
WHERE matnr IN s_plnbez.
Populating final data *
LOOP AT gi_afko INTO gwa_afko.
READ TABLE gi_mara INTO gwa_mara with key matnr = gwa_afko-plnbez.
IF sy-subrc IS INITIAL.
*Moving t_mara and t_afko data from their work area to work area of t_output.
MOVE gwa_mara-mtart TO gwa_output-mtart.
MOVE gwa_mara-pstat TO gwa_output-pstat.
MOVE gwa_afko-aufnr TO gwa_output-aufnr.
MOVE gwa_afko-gamng TO gwa_output-gamng.
APPEND gwa_output TO gi_output.
ENDIF.
ENDLOOP.
*Populating the quantity field
LOOP AT gi_output INTO gwa_output.
gwa_output-quantity = '1'.
MODIFY gi_output FROM gwa_output INDEX sy-tabix TRANSPORTING quantity.
*Concategnating aufnr, pstat into barcode
CONCATENATE gwa_output-aufnr gwa_output-pstat INTO gwa_output-barcode .
MODIFY gi_output FROM gwa_output INDEX sy-tabix TRANSPORTING barcode.
ENDLOOP.
endform. " zselection
*& Form buildcat
text
form buildcat.
CLEAR gwa_fieldcat.
gwa_fieldcat-fieldname = 'AUFNR'.
gwa_fieldcat-seltext_l = 'PRODUCTION ORDER'.
gwa_fieldcat-tabname = 'GI_OUTPUT'.
gwa_fieldcat-emphasize = 'C201'.
gwa_fieldcat-col_pos = 1.
APPEND gwa_fieldcat TO gi_fieldcat.
CLEAR gwa_fieldcat.
gwa_fieldcat-fieldname = 'GAMNR'.
gwa_fieldcat-seltext_l = 'MOVE NUMBER'.
gwa_fieldcat-tabname = 'GI_OUTPUT'.
gwa_fieldcat-emphasize = 'C201'.
gwa_fieldcat-col_pos = 2.
APPEND gwa_fieldcat TO gi_fieldcat.
CLEAR gwa_fieldcat.
gwa_fieldcat-fieldname = 'MTART'.
gwa_fieldcat-seltext_l = 'SIZE/FIT'.
gwa_fieldcat-tabname = 'GI_OUTPUT'.
gwa_fieldcat-emphasize = 'C201'.
gwa_fieldcat-col_pos = 3.
APPEND gwa_fieldcat TO gi_fieldcat.
CLEAR gwa_fieldcat.
gwa_fieldcat-fieldname = 'PSTAT'.
gwa_fieldcat-seltext_l = 'VARIANT'.
gwa_fieldcat-tabname = 'GI_OUTPUT'.
gwa_fieldcat-emphasize = 'C201'.
gwa_fieldcat-col_pos = 4.
APPEND gwa_fieldcat TO gi_fieldcat.
CLEAR gwa_fieldcat.
gwa_fieldcat-fieldname = 'QUANTITY'.
gwa_fieldcat-seltext_l = 'QUANTITY'.
gwa_fieldcat-tabname = 'GI_OUTPUT'.
gwa_fieldcat-emphasize = 'C201'.
gwa_fieldcat-col_pos = 5.
APPEND gwa_fieldcat TO gi_fieldcat.
CLEAR gwa_fieldcat.
gwa_fieldcat-fieldname = 'BARCODE'.
gwa_fieldcat-seltext_l = 'BARCODE'.
gwa_fieldcat-tabname = 'GI_OUTPUT'.
gwa_fieldcat-emphasize = 'C201'.
gwa_fieldcat-col_pos = 6.
APPEND gwa_fieldcat TO gi_fieldcat.
endform. " buildcat
*& Form top
text
FORM top .
REFRESH gi_top.
gwa_top-typ = 'H'.
gwa_top-info = My alv report'.
APPEND gwa_top TO gi_top.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = gi_top
I_LOGO =
I_END_OF_LIST_GRID =
I_ALV_FORM =
ENDFORM. "top
*& Form display_report
form display_report .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = g_repid
I_CALLBACK_PF_STATUS_SET = 'PF-STATUS'
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = 'TOP'
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT =
IT_FIELDCAT = gi_fieldcat
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = 'A'
IS_VARIANT = wa_variant1
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
IR_SALV_FULLSCREEN_ADAPTER =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = gi_output
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_report
*& Form export_report
text
form export_report.
endform.Hi Cinthia,
Check this Link.
How Can we genarate Excel file without GUI_DOWNLOAD
Reward points if useful.
Regards,
Abhishek -
Downloading a report in excel format : getBlob WIS 30270 Error
Hello experts,
I 'm working in "Business Objects XI R2 SP2", the server is a "windows 2003 server".
I have a big report , that some times returns me that message error when I try to download it in excel format:
Error message: "An internal error occured while calling the getblob api error wis30270".
The number of lines in the report is 27800, the number of columns is 62, the file is 27mb.
If I push the drill button the I can download it without errors, but this is not a good solution for the final users...
Best regards
CamilloHi Camillo,
Following information might help you to resolve the issue.
.Business Objects Enterprise provides thresholds to protect the WebIntelligence report server and the Web Application servers from processing large chunks of binary and character data and avoid crashing.
Maximum Binary File Size: Maximum size of a binary file (for example: PDF, XLSu2026) that can be generated by the Report Server. If a binary file generated from a Web Intelligence document is greater than this limit, the generation is stopped to protect the server and an error is returned. Increase this limit if the server has to generate large binary files (for example, if InfoView users view large documents in *.pdf format).
Maximum Character File Size: Maximum size of a text stream (for example: HTML, XML) that will be transferred to the application server. If a text stream sent to the application server is greater than this limit, the generation is stopped to protect the server and an error is returned.
In CMC, under Servers>WebIntelligence Report server, you can possibly set both the above values to 50MB, but you have to ensure that the application server can handle the increased load multiplied by the number of simultaneous connections. If not, it can crash and block all access to applications.
2. Ensure that the Web Application servers have enough memory available to process incoming requests. Usually the -Xmx value for java process is set at 256Mb, which is recommended to be at least 1024Mb or more depending on your Export requirements and application server limitations.
Regards,
Sarbhjeet Kaur -
Downloading ALV Report to Excel
Hi to all
My requirement is,
Final ALV is displaying the records with three headings.
Let there are records with heading.
Name City Address
1) jasvinder Delhi 123_Rambag.
once i download this record in the excel file
the name of the last heading should get changed. like
Name City Place
1) jasvinder Delhi 123_Rambag.
Actually i want to change the heading once
the file get downloaded(automatically).
Is it possible ?hi,
u can give a button in ALV to download to excel.
if u use standard functionality in ALV, ur requirement is not possible.
So by give the buton its possible.
1. By clikcing button.
Use that FM GUI_DOWNLOAD twice:
First time download only header
Second time append table contents to the same file (import parameter append = 'X')
egx:
or example if your itab used for writing the abap list is like below.
data: begin of details occurs 0 ,
customer type kna1-kunnr,
name type kna1-name1 ,
end of details.
declare another internal table.
data: begin of headers occurs 0 ,
customer(100) ,
name(100),
end of headers.
move: '010101' to headers-customer ,
'Anver' to headers-name .
append headers.
now call GUI_download to download headers to filename c:/tem.xls
again call gui_download with APPEND = 'X' to the same file name and download details itab
Regards
Reshma -
How to download ALV report having more than 200 columns to Excel
Dear Experts,
I am facing the issue of line break during downloading ALV report into excel. I referred the lot of forums but i didn't get the proper solution to solve this issue..Please guide me to solve this issue....
My output in ALV
header1 header2..........header200
but when i download that to spreadsheet i am getting like this
header1 header2.....
header65 header66....
header199...
Regards,
Rathish
Edited by: joerathish on Jun 3, 2011 9:53 AMjoerathish wrote:
not working well.
Do you get a excel with empty sheet with excel in place ?
Then you need to enable macro in trust center of excel sheet settings. The way you do this depends on the version of excel you are using.
I am able to get 200+ columns perfectly this way.
Regards -
Problem while downloading a ALV report to excel
Hi experts,
I have an ALV report which took long time to extract records from various table. So while there is some restriction the report can be executed well in foreground. And the report can be extracted well to excel sheet. But while there is hudge records, i have to execute the report in backgroung. And then from spool i generally prefers to download the report to excel.
There is a field UOM where it contains value ' " ' for some records. And also there may be possiblity that other fields can also contain the same.
Now my problem is: while download to excel... When ever there is a value ' " ' from this point to the next value ' " '. It is treating as one record. and keep that in a same position in the excel sheet.
But i want to keep all the values in there respective fields. Can you please how can i do that? Please give me some solution...
regards,
charles.If anybody have any solution please send me....
-
Regarding download of the ALV report to excel
Hi experts,
I have an ALV report which took long time to extract records from various table. So while there is some restriction the report can be executed well in foreground. And the report can be extracted well to excel sheet. But while there is hudge records, i have to execute the report in backgroung. And then from spool i generally prefers to download the report to excel.
There is a field UOM where it contains value ' " ' for some records. And also there may be possiblity that other fields can also contain the same.
Now my problem is: while download to excel... When ever there is a value ' " ' from this point to the next value ' " '. It is treating as one record. and keep that in a same position in the excel sheet.
But i want to keep all the values in there respective fields. Can you please how can i do that? Please give me some solution...
regards,
charles.Actually now I think there is another way to do this, storing file on application server can create problems as sometimes the users don't have directory write access or things like that.
Instead you should export your data to a memory or database cluster and import it back using abother program.
The proposed changes would be
1: At the point you are calling your alv grid function, check if the sy-batch is 'X' for background job, if yes than export to database table INDX or you can create your own. suppose your data is in internal table ITAB than in case of background job, you will do
data: keyf like indx-srtfd.
*We just assign username, date time to this
concatenate sy-uname sy-datum sy-uzeit into keyf.
EXPORT itab TO DATABASE indx(ZZ) ID keyf.
check for subrc if export is successfull.
Now you have stored your itab in database for later processing. remember to have keyf. In case of background job you can have it write in the output so from spool output you can check what was the keyf to use.
You have to write another program to import itab from database and download it or display it.....
This program will have keyf as input parameter and you must define ITAB same as the orignal program.
parameters: p_keyf like like indx-srtfd.
import itab from database indx(ZZ) id keyf.
*Now you have itab. do whatever you want with it. download it using GUI_DOWNLOAD function or display it in an ALV grid.......
Hope you got the overall idea. -
Download ALV output to excel with formatting
Hi All,
i want to download ALV output to excel sheet and the uneditable fields in ALV oputput should be locked (uneditable) in excel also.
Can you please tell me approach to achieve this functionality?
Thanks in advance.Thanks Vamsi. Your Suggestion was helpful.
I have used excel integration and used SET PROPERTY OF (COLUMN) 'LOCKED' = 1.
For more details refer below mentioned link.
http://webcache.googleusercontent.com/search?q=cache:SoY6hFC17PoJ:wiki.sdn.sap.com/wiki/display/Snippets/Download%2BData%2Binto%2BMultiple%2BSheet%2BExcel%2BDocument%2Bwith%2BNon%2BEditable%2BColumns%2B(Password%2Bprotected)%2BUsing%2BABAP%2BOLESetPropertynoteditableexcelsapABAP&cd=1&hl=en&ct=clnk&gl=in&source=www.google.co.in (http://webcache.googleusercontent.com/search?q=cache:SoY6hFC17PoJ:wiki.sdn.sap.com/wiki/display/Snippets/Download%2BData%2Binto%2BMultiple%2BSheet%2BExcel%2BDocument%2Bwith%2BNon%2BEditable%2BColumns%2B%28Password%2Bprotected%29%2BUsing%2BABAP%2BOLESetPropertynoteditableexcelsapABAP&cd=1&hl=en&ct=clnk&gl=in&source=www.google.co.in -
Down loading an ALV report in EXCEl
my ALV report contains 76 columns, if i try to download it in an excel sheel its not getting displayed in correct format.
Few columns are automatically displayed in the second row and also all my values are getting collapsed due to this display.
In the print preview also i am getting the same problem.
Is there any column limit in ALV display or i can make it to get display correctly as it is in the exact output.Hi,
here is an example of downloading an alv report in excel...
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
Maybe you are looking for
-
Restrict goods issue if stock on posting date is zero
Requirement: Current Inventory period : July 2011 Stock of a material from 01.07.2011 to 30.07.2011 is zero(in MB5B report) I upload stock of material or GRN occur on 31.07.2011. Say Quantity u2013 100 Now stock as on 31.07.2011 is 100 in MB5B Still
-
Hi to all, I have question, I just wondering why there is no error in F110 when I change the vendor name. let say I change the vendor name on 10. 20.2008, then I submitted a proposal on 10.28.2008 the approved on 10.3.2008. then but still the vendor
-
Indesign CS6 Font issue after saving
I have had this issue come up about about 4 times since I have been running CS6. When I open a customers document everything is fine no errors. I save it the same way I do the rest of the 30 jobs a day. When I re open the fonts will not load. If I op
-
I downloaded mountain lion and my audio does not work
I Downloaded mountain lion and my audio input does not work. I am tryig to use it with Articulate. I rebooted twice, I ahve taken out the external mic I have looked in Utilities and see if the setting are muted but all ok I have looked in Activity mo
-
I am trying to replicate 2 tables from 10gR2 to 11gR1 using streams. I am new to streams based replication and just started reading through the documentation to get this set up.I used the following web link http://www.oracle.com/technology/oramag/ora