Problem in downloading ALV output in excel
Dear Abapers,
I am facing a problem while downloading alv output in spreadsheet. Report headers and data headings are coming in excle but contents are missing instead of that No Data is displaying on excel sheet. I have debug that and observed the deep structure name T_OUTTAB using by the FM ALV_DATA_EXPORT is empty, It should contain the contents of my output data.
Below I am giving my code.
***********************************************declaration****************
BEGIN OF d_file_out,
index TYPE i, "Index no
msg TYPE string, "Message
msgtyp(1) TYPE c, "Message type
END OF d_file_out,
DATA:t_file_out TYPE TABLE OF d_file_out.
DATA:wa_file_out TYPE d_file_out.
Display Error Logs
PERFORM display_logs USING text-006.
FORM display_logs USING p_text TYPE string.
CONSTANTS: c_count TYPE char5 VALUE 'INDEX',
c_mestyp TYPE char6 VALUE 'MSG',
c_message TYPE char7 VALUE 'MSGTYP'.
*Field catalog
PERFORM: z_field_catalog USING c_count text-010, "Record number
z_field_catalog USING c_mestyp text-011, "Message type
z_field_catalog USING c_message text-012. "Message
*Top of page event
PERFORM z_event USING t_events.
wa_layout-colwidth_optimize = c_x.
ALV grid.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_buffer_active = 'X'
i_callback_program = sy-repid
is_layout = wa_layout
I_STRUCTURE_NAME = wa_file_out
it_fieldcat = t_field
it_events = t_events
TABLES
t_outtab = t_file_out
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.
***********************************Fieldcatalog**********************************************
FORM z_field_catalog USING p_field TYPE any
p_name TYPE any.
wa_field-fieldname = p_field.
wa_field-seltext_l = p_name.
IF p_field = 'INDEX'.
wa_field-outputlen = '14'.
wa_field-col_pos = 1.
ELSEIF p_field = 'MSG'.
wa_field-outputlen = '120'.
wa_field-col_pos = 2.
ELSEIF p_field = 'MSGTYP'.
wa_field-outputlen = '08'.
wa_field-col_pos = 3.
ENDIF.
APPEND wa_field TO t_field.
CLEAR wa_field.
ENDFORM.
Here I have given my code, which contain the building of field catalog and Calling ALV Grid. I have already checked the excel micros settings. Other programs are working fine on my system and downloading in excel is also working.
Hope to get reply soon.
Regards,
Himanshu
Hi ,
use this to down load to xcel
v_file = lv_file.
DATA: BEGIN OF s_head OCCURS 0,
head(40) TYPE c ,
END OF s_head.
s_head-head = text-015."'Sales price'. * for header
APPEND s_head.
s_head-head = text-016."'Purchase price'. * for header
APPEND s_head.
s_head-head = text-017."'Listing Procedure'. * for header
APPEND s_head.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = v_file
filetype = 'ASC'
write_field_separator = '#'
TABLES
data_tab = it_output1[]
fieldnames = s_head[]
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
OTHERS = 22
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Similar Messages
-
Problem in Download ALV Output to Excel
Hi All,
When iam going to Download the ALV ( Grid ) Output to Excel, all columns are not coming in Output.
But the ALV Output Contains 140 Columns.
How to solve this issue.
Points Rewarded.
Thanks & Regards,
Kiran . IHi,
You can download the report by going to menu option
List->export->local file.. in this select spreadsheet and give the name for this to download.
You can view all the columns here in xls sheet.
Regards,
Ram Mohan
Pls reward poins if useful... -
Problem in downloading ALV output to Excel
Here are the details of short dump.
Run time Error OBJECTS_NOT_CHARLIKE
The current statement only supports character-type data objects.
What happened?
Error in ABAP application program.
The current ABAP program "SAPLKKBL" had to be terminated because one of the
statements could not be executed.
This is probably due to an error in the ABAP program.
What can you do?
Print out the error message (using the "Print" function)
and make a note of the actions and input that caused the
error.
To resolve the problem, contact your SAP system administrator.
You can use transaction ST22 (ABAP Dump Analysis) to view and administer
termination messages, especially those beyond their normal deletion
date.
Error analysis
In statement
"STRLEN( obj )..."
the argument "obj" can only take a character-type data object.
In this case, the operand "obj" has the non-character type "P".Declare another variable of same length as 'obj' let us say its obj1 , then move 'obj' to 'obj1', now findout the length of 'obj1', which wil be the same value.
MOVE obj TO obj1.
STRLEN(obj1).
Hope ur dump wil not trigger again.
Regards,
Sujatha. -
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 -
Getting ERROR when downloading alv output to Excel
Hello All,
I get a error message when I try to use the standard funtionality to download the alv output to excel.
The current statement only supports character-type data objects.
What happened?
The current ABAP/4 program "SAPLKKBL " had to be terminated because
one of the statements could not be executed.
This is probably due to an error in the ABAP/4 program.
Error analysis
In statement
"STRLEN( obj )..."
the argument "obj" can only take a character-type data object.
Source code extract
038620 * ansonsten entspricht sich min. Ausgabelänge und Ausprägungslänge
038630 else.
038640 if gs_fc-tech_form ne 99.
> gs_out-hlplen = strlen( ).
038660 endif.
038670 endif.
In this case, the operand "obj" has the non-character type "I".
Please can anyone put some light on this. It is veru difficult to go through the whole std functionality to download.
Thanks for all support guys!
Sri.Hi srikanth,
This error comes because the values present in any one of the displayed coloums containing special character like * present before or after the number.... i.e instead of 4 ...**4.
While displaying in the screen it is of no problem. since both *4 are converted into char format (internally) and gets displayed.
But while you download the same throu the EXCEL functionality SAP will intenally convert the same into NUMERIC format. Since 4 is number.
So in that case *4 will cause dump.
*So find out the place in which the value appearing like this *4 and try to correct it.
*Surely it is of Field LENGTH problem. Try to increase the length of the field 4.
It Should WORK.!!!.. else post ur query here.
REWARD POINTS IF USEFUL
~Lakshmiraj~ -
Hi gurus,
Cany anybody explain what is the procedure to download the alv output to EXCEL sheet?
Marks will be awarded
Thanks in Advance
RaviHi
when display the ALV . select from PF-STATUS menu bar select download option then SPEADSHEET. Thats all.
Reward all the helpful answers..
With Regards
Navin Khedikar -
Problem in download ALV output
Hi experts,
When I try to download my ALV report output, its giving dump 'Field symbol has not yet been assigned.
In my ALV output, I have 46 fields/columns. When I have 18 fields/columns or less, I able to download, but if it is more than 18. Its giving the above dump.
*Error details:*
Runtime Errors GETWA_NOT_ASSIGNED
Date and Time 05.09.2009 17:56:13
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.
Error analysis
You attempted to access an unassigned field symbol
(data segment 110).
This error may occur if
- You address a typed field symbol before it has been set with
ASSIGN
- You address a field symbol that pointed to the line of an
internal table that was deleted
- You address a field symbol that was previously reset using
UNASSIGN or that pointed to a local field that no
longer exists
- You address a global function interface, although the
respective function module is not active - that is, is
not in the list of active calls. The list of active calls
can be taken from this short dump.
Please provid the solution for this.
Thanks and regards,
SubbuHi Sandra,
As you told, There is a problem in populating field catalog.
Actually, I had passed the same field name 2 times while populating field catalog table. Thats why, the issue has been raised. Now I changed it accordingly.
Thanks and regards
Subbu
Edited by: subbu_1983 on Sep 6, 2009 11:10 AM -
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 -
Problem in downloading alv output to spreadsheet using sap standard downlo.
Hi all,
I have an ALV report Output of approx 120 columns , But when I am downloading the output to spreadsheet using standard download button , thefile is downloaded but the columns in multiple lines, is there any method/setting by which i can download the column output in same line. using the same sap standard button
thanks
bobbyanswered
-
To download alv output to two excel sheets because of large data
Hi all,
I want to download alv output to excel sheet,I know how to do,but the no of record is very large and can not be accomodated in one sheet.
can anyone please tell how to download it into two sheets or some other way.
I want excel format only.
Regards,
sudhahi sudha yadav,
right now i am working on the same issue.
what right i am doing is that,
i want to download an internal table it is containing more than 2 lakhs records but excel can accomidate 60000 records, so
before call gui download i am sending first 60000 records into another internal table with same time, by using append statemen and indexs,
that new internal table i am downloading
again i am repeating the same thing by using sy-tabix,
finally i am creating more than one excel file
by using oops concepts we can also create in one excel file no of work sheets
but its lengthy process so i am right now creating no of excel files only
if it is useful , pls rewards points to this answer -
Displaying alv output into excel with delimeter
Hai,
am downloading alv output to excel :
1. in that output one field is long text field with # delimeter at the end of sting .
while exporting this outout to excel it is not showing # and one empty column is adding after that field.Hi Satya,
Can you try out this piece of code below. It creates a demo Internal table to store some string with '#' as the final delimiter.
TYPES : BEGIN OF l_ty_demo,
data TYPE string,
END OF l_ty_demo.
DATA : l_i_demo TYPE STANDARD TABLE OF l_ty_demo.
DATA : l_wa_demo TYPE l_ty_demo.
DATA : l_v_i TYPE sy-tabix.
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.
WHILE l_v_i < 10.
l_wa_demo-data = 'Welcome to the world of computers#'.
APPEND l_wa_demo TO l_i_demo.
l_v_i = l_v_i + 1.
ENDWHILE.
* start Excel
CREATE OBJECT h_excel 'EXCEL.APPLICATION'.
PERFORM err_hdl.
SET PROPERTY OF h_excel 'Visible' = 1.
PERFORM err_hdl.
* 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.
LOOP AT l_i_demo INTO l_wa_demo.
h = sy-tabix + 1.
PERFORM fill_cell USING h 1 0 l_wa_demo-data.
ENDLOOP.
*& Form FILL_CELL
* text
* -->I text
* -->J text
* -->BOLD text
* -->VAL text
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. "FILL_CELL
*& Form ERR_HDL
* text
FORM err_hdl.
IF sy-subrc <> 0.
WRITE: / 'Fehler bei OLE-Automation:'(010), sy-subrc.
STOP.
ENDIF.
ENDFORM. "ERR_HDL
Please refer to the following Demo ABAP Code for a complete reference.
RSDEMO01.
Hope this helps.
Thanks,
Samantak. -
Problem while downloading ALV GRID Output to Local Spreadsheet(Excel) File.
Hi,
I am displaying output in ALV GRID. While downloading the output to Excel file using "Local File" option provided by ALV.
But while downloading the columns and their respective values are coming in single column vertially of excel file instead of horizontal.
e.g. Grid output is as follows.
F1 F2
V1 V2
(F represents Field Title, and V represent Value)
Downloaded Excel File content:-
F1
F2
V1
V2
Please help.Hi ,
Please use below FM :
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = 'C:\Documents and Settings\akshayr2403\Desktop\docs\rep.xls'
FILETYPE = 'WK1'
WRITE_FIELD_SEPARATOR = 'X'
tables
data_tab = it_vbak
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22
IF sy-subrc 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Also, if your problem still persist, please refer SAP's demo code on ALV "BCALV_FULLSCREEN_DEMO".
There are many sample codes available, what you need to do is just go to SE38 and put BCALV* and do F4.
I hope this will help you.
Regards,
Rahul Mahajan -
Facing problem while downloading ALV grid Output into Excel
Hi Guys,
I am facing problem while downloading ALV grid Output into Excel.
It is downloading into excel, but all character columns first and next all quantity columns it is displaying. But I need columns order as it is in the grid.
If I take all columns as characters it works fine. But it will be problem for calculating total, subtotals of quantity columns
Can someone help me regarding this
thanks for your helpHi,
Open up Excel on your desktop. Goto Tools > Macro > Security.
Make sure that your security is set to Medium (or less). SAP uses OLE automation to run the Excel instance and in Office 2003 (for example), Microsoft has increased their default security setting to High. With the High setting, the output to Excel fails.
Was this your problem? Don't forget those points, either.
check with this wetther it is solved or not.
Regards,
sana. -
Downloading of ALV output to excel by asking the password
Hi all,
I need to down load the ALV output into the excel sheet. But the thing is that before going to download the output into excel sheet, the system has to prompt for password.once it happens then the user will enter the password and it should validate. if the validation is successful then the output should download to the excel sheet. This is the requirement, can anybody help me out regarding this.Please provide the function module names and sample code.
Thanks & Regards.
Laxman.P
B'lore.Hi,
Check this thread,
Make excel sheet password protected through ABAP codeu0085
Regards,
Omkar. -
Problem in downloading ALv Grid output
Hi Friends,
I've made an ALV report using the FM: REUSE_ALV_GRID_DISPLAY. Now when I try to download the output in excel using the path:LIST->EXPORT->EXCELSHEET, the 'excelsheet' option is showing as disabled. This is happening only for this report, while I'm successfully ablw to do this for other ALV grid reports. I'm on ECC6.0 & trying to download the output in XXL format.Kindly help me as what exactly needs to looked into.
Thanks:
Gauravhi,
Think that you does n't have authorization for that (auth group "J_1IDNLD").
You can try to do with another user which is ahving authorisation.
Get authorization for above grp. Hope it will helps you. Thanks!
Kishore
Maybe you are looking for
-
How can I go to a specific date in the future other than by clicking one month at a time?
Would like to go to a specific date several years from now and see what else I have scheduled (if any) or to see if that day is a holiday or even just to see what day of the week that day falls on. Can I do this in some way other than clicking on the
-
T-Mobile Lumia 925 - What is the Best way to manag...
really love this phone after moving from BlackBerry Bold 9900 but I keep running into Memory problems. I also have like 25 GB of Skydrive Storage due to special loyalty thing with Microsoft. So When I got the phone it says 16 GB but the status bar on
-
Reference object data update in Location tab page of order
Hello When a reference object in notification/order is changed, the location and account assignment data is updated in order location data by standard settings in SAP but any changes to the master data of the existing reference object is not change
-
Error: Set type Z contains multiple-value attributes
Hi forum, I have a problem when i try to assign a set type with the same value but diferent name on another set type to the same product category. This is the detail of the error but i dont know where i have to set this indicator: If you set this ind
-
Programming Standard ( syntaxe )
Hi guys, I'm looking for a "guidelines" or document which illustrate which is the "java sun or any other good" standard to write codes lines. From starting to correctly place the "{" ...to naming variables... is it: public void FctName() { public voi