Column shifted during Local file download in ALV Grid
Dear Experts,
I have an ALV grid editable report program. The program is developed to maintain custom table data.
The table data will be maintained using this report. User can edit the data and can save it. In this report there are some columns which are defined as checkbox (fieldcat-checkbox = 'X'.).
I have the buttons "Excel Upload" and "Download Template" in the application tool bar of ALV display.
Users can use the "Download Template" which can be used to get the exact excel format.
But sometimes they just download the data into the Local PC file (Excel format), modify the excel data (remove ALV header and space rows) and upload by using the ALV button.(ALV Tool : cl_gui_alv_grid=>mc_mb_export)
While downloading I observed the ALV column values which have defined as checkboxs have shifted to next one in Excel file.
Do any one now how to resolve this error? The column values which are defined as "Check box" (fieldcat-checkbox = 'X', (fieldcat TYPE lvc_s_fcat) should not be shifted to next column in Excel during SAP standard ALV Grid download
(ALV Tool : cl_gui_alv_grid=>mc_mb_export).
I am checking the ALV layout parameters. But doesn't help. If any one knows the solution please share it with me.
Thank you.
Kind Regards,
Senthilraj S
Hi,
I know that you want to participate in answering the questions which is a good thing.
But please check the posting date before answering.
sorry iam just reminding of the posting date.
Hope you understand what i meant.
thanks.
Aswath
Edited by: aswathsa on Jan 18, 2012 10:56 AM
Similar Messages
-
Error in clicking save to local file button in alv grid?
Hi
I am getting error , While clicking on some buttons like save as local file button in alv grid display
How to rectify it
Thanks in advanceIn your REUSE_ALV_GRID_DISPLAY
EXPORTING
I_SAVE = 'U'
put this field....and then check it will definitely work... -
Error in clicking save to local file button in alv grid? urgent
>>>>> if lr_tabledescr->applies_to_data( <coltab_any> ) eq 'X'.
exactly i am getting error here
how to rectify this error
Error in clicking save to local file button and mail receipt button in alv grid?In your REUSE_ALV_GRID_DISPLAY
EXPORTING
I_SAVE = 'U'
put this field....and then check it will definitely work... -
Download from ALV grid to PDF format
hai Friends!
plz tell me how can i download from ALV grid to PDF format..
send me some sample codescheck this thread
ALV Grid to PDF
and do use the search functionality from next time and post the question only wheb u dont find the answer
кu03B1ятu03B9к -
Excel File Format Problem while downloading in ALV Grid
Hi All,
My program gives an ALV Grid Output which contains the file download button , when I choose spread sheet as the file format , the actual data starts only from 4th line and the lines above it contain date, heading etc and the rest are blank. Is it possible that I can download only the records in the grid output with the column names and not the unnecessary log?
Also the format is not proper excel format, this same file will be used for upload into another program using the Function Module 'TEXT_CONVERT_XLS_TO_SAP'. When I load the file saved in the above format, this Function Module always fails.
Please let me know any solution for this problem
Thanks in Advance.Hi
try this code----
*& Form DOWNLOAD_EXCEL_TEMPLATE
text
--> p1 text
<-- p2 text
FORM download_excel_template .
TYPES: BEGIN OF lt_data,
field1(20),
field2(30),
field3(20),
field4(20),
field5(20),
field6(30),
field7(15),
field8(10),
field9(10),
field10(20),
field11(20),
field12(10),
field13(20),
field14(20),
END OF lt_data.
DATA: lv_file TYPE rlgrap-filename,
li_data TYPE STANDARD TABLE OF lt_data,
wa_data TYPE lt_data,
lv_pathcheck type c,
lv_file1 type string.
wa_data-field1 = ''.
APPEND wa_data TO li_data.
REFRESH gi_header.
wa_header-name = 'Company Code'.
APPEND wa_header TO gi_header.
wa_header-name = 'Main Asset Number'.
APPEND wa_header TO gi_header.
wa_header-name = 'Asset Sub Number'.
APPEND wa_header TO gi_header.
wa_header-name = 'Document Date'.
APPEND wa_header TO gi_header.
wa_header-name = 'Posting Date'.
APPEND wa_header TO gi_header.
wa_header-name = 'Asset Value Date'.
APPEND wa_header TO gi_header.
wa_header-name = 'Item Text'.
APPEND wa_header TO gi_header.
wa_header-name = 'Reference'.
APPEND wa_header TO gi_header.
wa_header-name = 'Allocation'.
APPEND wa_header TO gi_header.
wa_header-name = 'Amount Posted'.
APPEND wa_header TO gi_header.
wa_header-name = 'Percentage Rate'.
APPEND wa_header TO gi_header.
wa_header-name = 'Quantity'.
APPEND wa_header TO gi_header.
wa_header-name = 'Prior-Yr Quantity'.
APPEND wa_header TO gi_header.
wa_header-name = 'Curr-Yr Quantity'.
APPEND wa_header TO gi_header.
lv_file = gv_file.
lv_file1 = gv_file.
CALL METHOD cl_gui_frontend_services=>directory_exist
EXPORTING
directory = lv_file1
RECEIVING
result = lv_pathcheck
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
wrong_parameter = 3
not_supported_by_gui = 4
OTHERS = 5.
FIND '.xls' IN lv_file IGNORING CASE.
IF sy-subrc = 0.
REPLACE '.XLS' IN lv_file WITH ' ' IGNORING CASE.
ENDIF.
FIND '.TXT' IN lv_file IGNORING CASE.
IF sy-subrc = 0.
REPLACE '.TXT' IN lv_file WITH ' ' IGNORING CASE.
ENDIF.
CALL FUNCTION 'MS_EXCEL_OLE_STANDARD_DAT'
EXPORTING
file_name = lv_file
data_sheet_name = 'DATA'
TABLES
data_tab = li_data
fieldnames = gi_header
EXCEPTIONS
file_not_exist = 1
filename_expected = 2
communication_error = 3
ole_object_method_error = 4
ole_object_property_error = 5
invalid_pivot_fields = 6
download_problem = 7
OTHERS = 8.
IF sy-subrc <> 0.
MESSAGE ID gv_msgid TYPE 'E' NUMBER 002.
ENDIF.
ENDFORM. " DOWNLOAD_EXCEL_TEMPLATE
regards,
Prashant -
Problem with File download in ALV via ITS. Please help!
Hi Experts,
I have a ALV report which I have web enabled using ITS service. In the ALV there is a delivered functionality for file download. It works fine when the report is run in the SE80. But when I run the ITS service for the report and choose file download option it displays a page saying "this page has been diaplayed due to technical reasons" with title "File properties". In addition it looks for Java runtime in the browser. After all this it opens a popup window for selecting path and file name.
This is not user friendly and many customers have rasied their concerns on it.
My question is that,
Q1: What is the need of this "File properties page"? Why ITS calls this while ABAP editor does not?
Q2: Is there any way we can suppress this so that it directly opens a popup window for selecting path and file name?
Please help me.
Thanks
GopalHello Klaus,
i have also the problem with these intermediate screens!
We have in between installed patch 22 for ITS 6.20 and SP18 at SAP Netweaver 2004!
But they are still not processed invisible for the users.
Are there any additional parameters, which controls this behaviour(~webgui_updown_make_visible is not used!)?
How can i check, if i have really a.ex. the actual ws.jar-file or other related files of the patch?
We are using the standalone ITS with an own (modified) IAC with an own CI-design for the webpages. The intermediate screens are displayed with the "normal" SAPGUI-design because of the parameter ~generatedynpro. Without this it does not work, because the template SAPLSIT_0100 is missing!
Or do you have an example for such a intermediate template with the applet for an upload of a file?
Thanks in advance
Felix -
Local File - Downloads Data into 1 line in Excel 2007
Hello
When I have the option to download a spreadsheet into excel, the data is downloaded correctly. When I have information in a table format and I have to use the local file to download into excel all of my data is exported into 1 line.
Can anyone help?
Thanks!
JoeHello
Request you to please search for notes further in the Service Place. There is a note which I have found might help you. It is
1010935.
Hope it helps you.
Rgds -
Export to local file-pdf from ALV
Exporting data including to PDF format .
Moderator message - Please use a meaning subject line in future.
Message was edited by: Suhas SahaSorry , for keeping it short .
But i want to get pdf when click in alv grid display on
Exporting data .I have use the function module to convert it to the pdf but dont know how to add this file (pdf )to standard alv toolbar button. -
Downloads from ALV GRID-Text conversion to dates in EXCEL
When downloading table displays of data from ALV-GRID for excel spreadsheet, we end of with files that have a header and various line ifnromation. IF we manually clear up the display, then we can have the individicual column headers used and force them to text but if we just call the file up as an EXCEL spreadsheet, some part numbers such 12-3465 appear in Excel as Dec-65.
The following is an example of the record (but it is word wrapped within this display limit). In actuality, the verbage enclosed with the <b> represent the start of the lines that have actual display data running out about 90 characters.
Suggestions on how to make the download immediately correct in Excel direct from SAP ALV-GRID without cleaning out the heading lines and manually forcing the affected columns to TEXT format?
thanks
<b>03/02/2007</b> Dynamic List Display 1
<b>Materials-Inforecord Details Report</b>
<b>Purchasing Org: ILMO</b>
<b>Report Run Date:03/02/2007</b> <b>Report Time:14:31:16</b>
<b>Plnt Mat Grp Vendor Name 1 Material Material</b> description Vendor Cat Mfr MPN PC Item Chg. OUn Eq to BUn Net price Per OPUn Inforecord PGr Mv Avg per ValCl
<b>0042 04 106070 BURROWS COMPANY</b> 184110 Glv Exam Ltx Non Ster 02-5001 TILLOTSON 02-5001 CA 2,000 EA 93.40 1 CA 5300006999 999 93.40 2,000 6438there are different options to export to excel which all behave differently, if you go for the menu ->export it differs from the export button from the alv buttonbar.
try the different export to excel options perhaps there is one that behaves the way you want
kind regards
arthur de smidt -
How to enable excel downloading in ALV grid report.
Hi all,
How to enable excal downing in ALV grid report?
Thanks in Advance.
Siva Sankar.hi
check the following code
Example of a Simple ALV Grid Report
REPORT ZTUFI091 .
*& Report ZDEMO_ALVGRID *
*& Example of a simple ALV Grid Report *
*& The basic requirement for this demo is to display a number of *
*& fields from the EKKO table. *
*REPORT zdemo_alvgrid .
TABLES: ekko.
type-pools: slis. "ALV Declarations
*Data Declaration
TYPES: BEGIN OF t_ekko,
ebeln TYPE ekpo-ebeln,
ebelp TYPE ekpo-ebelp,
statu TYPE ekpo-statu,
aedat TYPE ekpo-aedat,
matnr TYPE ekpo-matnr,
menge TYPE ekpo-menge,
meins TYPE ekpo-meins,
netpr TYPE ekpo-netpr,
peinh TYPE ekpo-peinh,
END OF t_ekko.
DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
wa_ekko TYPE t_ekko.
*ALV data declarations
data: fieldcatalog type slis_t_fieldcat_alv with header line,
gd_tab_group type slis_t_sp_group_alv,
gd_layout type slis_layout_alv,
gd_repid like sy-repid,
gt_events type slis_t_event,
gd_prntparams type slis_print_alv.
*Start-of-selection.
START-OF-SELECTION.
perform data_retrieval.
perform build_fieldcatalog.
perform build_layout.
perform build_events.
perform build_print_params.
perform display_alv_report.
*& Form BUILD_FIELDCATALOG
Build Fieldcatalog for ALV Report
form build_fieldcatalog.
There are a number of ways to create a fieldcat.
For the purpose of this example i will build the fieldcatalog manualy
by populating the internal table fields individually and then
appending the rows. This method can be the most time consuming but can
also allow you more control of the final product.
Beware though, you need to ensure that all fields required are
populated. When using some of functionality available via ALV, such as
total. You may need to provide more information than if you were
simply displaying the result
I.e. Field type may be required in-order for
the 'TOTAL' function to work.
fieldcatalog-fieldname = 'EBELN'.
fieldcatalog-seltext_m = 'Purchase Order'.
fieldcatalog-col_pos = 0.
fieldcatalog-outputlen = 10.
fieldcatalog-emphasize = 'X'.
fieldcatalog-key = 'X'.
fieldcatalog-do_sum = 'X'.
fieldcatalog-no_zero = 'X'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'EBELP'.
fieldcatalog-seltext_m = 'PO Item'.
fieldcatalog-col_pos = 1.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'STATU'.
fieldcatalog-seltext_m = 'Status'.
fieldcatalog-col_pos = 2.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'AEDAT'.
fieldcatalog-seltext_m = 'Item change date'.
fieldcatalog-col_pos = 3.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MATNR'.
fieldcatalog-seltext_m = 'Material Number'.
fieldcatalog-col_pos = 4.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MENGE'.
fieldcatalog-seltext_m = 'PO quantity'.
fieldcatalog-col_pos = 5.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MEINS'.
fieldcatalog-seltext_m = 'Order Unit'.
fieldcatalog-col_pos = 6.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'NETPR'.
fieldcatalog-seltext_m = 'Net Price'.
fieldcatalog-col_pos = 7.
fieldcatalog-outputlen = 15.
fieldcatalog-datatype = 'CURR'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'PEINH'.
fieldcatalog-seltext_m = 'Price Unit'.
fieldcatalog-col_pos = 8.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
endform. " BUILD_FIELDCATALOG
*& Form BUILD_LAYOUT
Build layout for ALV grid report
form build_layout.
gd_layout-no_input = 'X'.
gd_layout-colwidth_optimize = 'X'.
gd_layout-totals_text = 'Totals'(201).
gd_layout-totals_only = 'X'.
gd_layout-f2code = 'DISP'. "Sets fcode for when double
"click(press f2)
gd_layout-zebra = 'X'.
gd_layout-group_change_edit = 'X'.
gd_layout-header_text = 'helllllo'.
endform. " BUILD_LAYOUT
*& Form DISPLAY_ALV_REPORT
Display report using ALV grid
form display_alv_report.
gd_repid = sy-repid.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = gd_repid
i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM
i_callback_user_command = 'USER_COMMAND'
i_grid_title = outtext
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
it_special_groups = gd_tabgroup
it_events = gt_events
is_print = gd_prntparams
i_save = 'X'
is_variant = z_template
tables
t_outtab = it_ekko
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_ALV_REPORT
*& Form DATA_RETRIEVAL
Retrieve data form EKPO table and populate itab it_ekko
form data_retrieval.
select ebeln ebelp statu aedat matnr menge meins netpr peinh
up to 10 rows
from ekpo
into table it_ekko.
endform. " DATA_RETRIEVAL
Form TOP-OF-PAGE *
ALV Report Header *
Form top-of-page.
*ALV Header declarations
data: t_header type slis_t_listheader,
wa_header type slis_listheader,
t_line like wa_header-info,
ld_lines type i,
ld_linesc(10) type c.
Title
wa_header-typ = 'H'.
wa_header-info = 'EKKO Table Report'.
append wa_header to t_header.
clear wa_header.
Date
wa_header-typ = 'S'.
wa_header-key = 'Date: '.
CONCATENATE sy-datum+6(2) '.'
sy-datum+4(2) '.'
sy-datum(4) INTO wa_header-info. "todays date
append wa_header to t_header.
clear: wa_header.
Total No. of Records Selected
describe table it_ekko lines ld_lines.
ld_linesc = ld_lines.
concatenate 'Total No. of Records Selected: ' ld_linesc
into t_line separated by space.
wa_header-typ = 'A'.
wa_header-info = t_line.
append wa_header to t_header.
clear: wa_header, t_line.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
it_list_commentary = t_header.
i_logo = 'Z_LOGO'.
endform.
FORM USER_COMMAND *
--> R_UCOMM *
--> RS_SELFIELD *
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
Check function code
CASE r_ucomm.
WHEN '&IC1'.
Check field clicked on within ALVgrid report
IF rs_selfield-fieldname = 'EBELN'.
Read data table, using index of row user clicked on
READ TABLE it_ekko INTO wa_ekko INDEX rs_selfield-tabindex.
Set parameter ID for transaction screen field
SET PARAMETER ID 'BES' FIELD wa_ekko-ebeln.
Sxecute transaction ME23N, and skip initial data entry screen
CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
ENDIF.
ENDCASE.
ENDFORM.
*& Form BUILD_EVENTS
Build events table
form build_events.
data: ls_event type slis_alv_event.
call function 'REUSE_ALV_EVENTS_GET'
exporting
i_list_type = 0
importing
et_events = gt_events[].
read table gt_events with key name = slis_ev_end_of_page
into ls_event.
if sy-subrc = 0.
move 'END_OF_PAGE' to ls_event-form.
append ls_event to gt_events.
endif.
read table gt_events with key name = slis_ev_end_of_list
into ls_event.
if sy-subrc = 0.
move 'END_OF_LIST' to ls_event-form.
append ls_event to gt_events.
endif.
endform. " BUILD_EVENTS
*& Form BUILD_PRINT_PARAMS
Setup print parameters
form build_print_params.
gd_prntparams-reserve_lines = '3'. "Lines reserved for footer
gd_prntparams-no_coverpage = 'X'.
endform. " BUILD_PRINT_PARAMS
*& Form END_OF_PAGE
form END_OF_PAGE.
data: listwidth type i,
ld_pagepos(10) type c,
ld_page(10) type c.
write: sy-uline(50).
skip.
write:/40 'Page:', sy-pagno .
endform.
*& Form END_OF_LIST
form END_OF_LIST.
data: listwidth type i,
ld_pagepos(10) type c,
ld_page(10) type c.
skip.
write:/40 'Page:', sy-pagno .
endform.
hope it will help you
regards
sreelatha gullapalli -
Column is shifted to 1 position right ( Excel file downloaded from ALV )
After downloading the data into the excel file from ALV ... i checked the file & i came to know that all the columns are shifted to 1 position right. Can anyone help me? Is there any sap notes available for this problem
Hello
What is the result if you open the exported file via 'File => Open' in the excel program?
what is you current basis level?
Jude -
Http Service call during the file download
Hi all,
Is it possible to make some server side calls from Flex application and get the response of them,
while already a download is contiune and saving a file to file system.?
My scenario is that a file is being download on my pc by Adobe air application.While during that period
I want to call some another http call and get the response of them? Also have the doubt about the messaging.
Will the messaging will work during this?
with Regards,
ShardulHTTP calls are routed through the OS network stack. So any limits on simultaneous network connections are determined by the OS, not AIR.
-
How do I stop firefox from pre-downloading a file during a file download prompt?
I use DownThemAll as my download manager for files generally over 10MB, as my internet connection is generally too slow for firefox to download a file larger then this without firefox "finishing" a download before it's complete, corrupting the file. This never happens with DownThemAll.
For some sites, either there is no download link to right click or it starts automatically, launching the download prompt. Firefox's internal download manager automatically starts downloading the file (not visibly, but in the background) before I can choose to use DownThemAll from the prompt instead.
This wastes bandwidth. Even worse, some hosting sites have randomly generated download gates for each session that expire after disconnection or limit you to a single download in a given time frame. This means that I effectively can't use DownThemAll on certain websites because firefox's own download manager steps in and gets in the way.Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance/Themes).
*Don't make any changes on the Safe mode start window.
*https://support.mozilla.org/kb/Safe+Mode
*https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes -
Problem in the local file download by gui_download,pls help!
hello,everyone,
when I use 'GUI_DOWNLOAD' to download file to my pc,the data in the file has some display problem,eg:'440006114002084000 'displayed as 4.40006E+17
when I enlarge the excel grid,then the '4.40006E+17 ' just not change to 440006114002084000,so does any know this problem?pls give me some help.
thank you in advance.Hi,
You need to change the content of the field in your internal table before you call gui_download.
Something like
constant: c_quote value `'`.
loop at data_tab assigning <fs_data>.
concatentate c_quote <fs_data>-ean into wa_ean.
<fs_data>-ean = wa_ean.
endloop.
This will change the field from, for example 123456 to '123456, which Excel will treat as text.
Regards,
Nick -
Slow browsing during any file downloads
Whenever I'm downloading a large file with Firefox (18.0), I can't browse any other sites at the same time. The pages just keep sitting there saying "Connecting" forever. But if I pause the download in the Downloads window, the other pages suddenly finish loading and display their page. If I then resume the download, I can't browse any pages again.
You can check the network.http.* prefs on the about:config page.
Reset network.http prefs to the default value via the right-click context menu -> Reset if they are user set (bold).
*http://kb.mozillazine.org/about:config
It is possible that anti-virus software is corrupting downloaded files or is otherwise interfering with downloading files.<br />
Try to disable the real-time (live) scanning of files in your anti-virus software temporarily to see if that makes downloading work.
See:
*http://kb.mozillazine.org/Unable_to_save_or_download_files
*browser.download.manager.scanWhenDone
Maybe you are looking for
-
How to boldface the header for ONE column
hi, I want to know how to boldface the header for ONE column. The following will boldface the header for all the columns in the table table.getTableHeader().setFont(new java.awt.Font("Dialog", 1, 12)); Thanks. Jrabi
-
Hello aIl I'm giving an small project from a small firm using cloud service for their small business to setup a Ricoh Aficio MP C2500 printer (Scan-to-folder only/shared) within their Network of 5 to 8 user, I only have 24 hours for a solutions due t
-
Why can't I update an event from my hard drive to Mac Pro final cut 10.1 - It says there are no events to update
-
Guys , Is there way to find the windows installation path . c:\windows or d:\windows programatically ? Thanks ?
-
Hi Guys, I really need your help. I want to buy the new iPhone 4S in the USA, I'm living in Israel and it will take a long time until the iPhone 4S will released here. So my question is that, If I'll but the iPhone 4S in the US will it work in Israel