Alv output to Excel with numeric fields as numeric fields only and not char
Hi,
When we download the alv output to excel format in the locat file using the toolbar button provided in the ALV, the numeric fields get converted to character format. Is there any other way or settings in ALV so that the numeric fields will be get saved as numeric fields only and not character?
Rgds,
MAdhuri
any idea for above problem is welcome
Similar Messages
-
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. -
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 -
How GET Output to Excel with Oracle9i Report using OC4J
how GET Output to Excel with Oracle9i Report using OC4J.
I FINISHED THE SETPS CONCIDERING THE JSP CODE NEEDED TO GET THE EXCEL OUTPUT ON LOCAL MACHINE.
I NEED TO PUBLISH THIS REPORT THROUGH APPLICATION SERVER.
THE QUESTION IS:
1- HOW TO START AN OC4J INSTANCE FROM ORACLE 9I DS FOR THIS REPORT?
2- WHERE (PATH) TO PUBLISH THE REPORT ON THE APPLICATION SERVER?
3- WHAT IS THE DEFAULT URL TO RUN THIS REPORT AND WHERE TO PUT IT?
4- HOW TO MAKE MAPPING FOR DIRECOTRY PATH TO TRANSLATED AS URL FOR THIS REPORT?
5- IF ANY ONE CAN GIVE ME THE FULL CODE TO RUN AND CALL SIMPLE JSP REPORT TO BE VIED IN INTERNET EXPLORER.
THANK YOUHi,
I can't answer to all your questions, however I can tell you that:
2) The directory where to put the report file is specifiend in a file named
<serverName>.conf
in the sourceDire property
<property name="sourceDir" value="/directory/dove/mettere/i/report"/>
that you can find under ORACLE_HOME/reports/conf
3) The URL is
http://<server IAS address>:<port number>/<jsp file path>/<repName>.jsp?server=<report server name>&userid=<user>/<pwd>@<DB conn string>[&<param>=<valore>[&...]]
5) In IE you have only to set the previous URL in the address bar.
Hope this helps you
Bye
Raffy -
Hi All,
I am downloading the ALV output to Excel file.I am making use of LIST--->EXPORT--->SPREADSHEET option.
My list is having Header, Footer, sub totals and totals.When i transfer the list i am facing following problems
1.Even i am getting the empty columns betweeen my output.
2.In the Place of sub totals i am getting astericks
3.On the top of the records downloaded,"DYNAMIC LIST DISPLAY" is found.I want to avoid this text on the top
Thanks,
Ravee...Hello Vinod,
1.I am getting the empty columns betweeen my output.
I am having 16 columns in the ALV output,but i got 19 columns in my excel file.
2.In the Place of sub totals i am getting astericks.
Generally there is no possibility to download the sub totals.i am using LIST->EXPORT->SPREADSHEET.
I am having the sub totals in my output.
*You would have noticed the' * ' for sub total and ' ** ' for grand totals values.*These sub total & total values are not downloaded but these asterisks are carried to excel file.
3.On the top of the records downloaded,"DYNAMIC LIST DISPLAY" is found.I want to avoid this text on the top.
I am using the application tool bar icon only.Still i am getting the same.
Thanks,
Ravee... -
Output to Excel with Oracle9i Report -- DEMO DOWN
The Viewlet "Output to Excel with Oracle9i Report" (as well as the others) at
http://otn.oracle.com/products/reports/htdocs/getstart/demonstrations/index.html
Does not work. I keep getting a 'Incorrect skin. Stoppting' Error.
Please update the viewlet or make it available to email or download.
ThanksActually you don't need to see that viewlet. Just follow the easy follow-by steps in Metalink Note 240819.1 "How to Generate Excel output in browser using Reports9i JSP". This is faster done than watching the viewlet! You can use it for 9i and as well for 10g.
Please note the reference to note 271590.1 in the end of the document. Without that it won't work on 10g.
Regards,
Martin Malmstrom
ORACLE Consulting -
Some albums I put on my Mac to later sync with a Touch appears as seperate tracks and not a single album. How do I get them back together again other than a playlist. I do not want the tracks showing up as albums on the Touch?
Are your tracks pat of a collection? Different artists, but still one album? Then mark them a s acollection or set the album artist. See this guide on how to group separate tracks into albums:
iTunes: Grouping Tracks Into Albums -
My Ipod was in my back pocket and when I took it out it has a white screen with 3 grey lines going threw it, and not even 5mins before, it was working fine... what could i be? it also isnt hooking up to itunes... please help
Try:
- iOS: Not responding or does not turn on
- Also try DFU mode after try recovery mode
How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
- If not successful and you can't fully turn the iOS device fully off, let the battery fully drain. After charging for an least an hour try the above again.
- If still not successful that usually indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.
Apple Retail Store - Genius Bar -
i have problem with my iphone, it;s never lock and not read sim card, before reinstaling 6.01, thnx juliany
If you are both on the T-mobile network, the sim card should work. If you did a Erase All Content and Settings, then she should be at the point of activation as a new device...talk to T-mobile and be sure the sim she is using is a valid sim card.
-
take long to sync contacts and notes calandario 6800 and with Microsoft Outlook
already have 2 hours and not finish the process please helpWhere error messages are you getting?
Can you not do both? Send and Receive?
Check but I think yo have the right setting described here:
iCloud: Mail server information -
Down Loading ALV Output to Excel Sheet
Hi All,
I am working on Vendor Line Items Report which have both Header details as well as line item details.
So i developed Heirarical ALV to display the output and it is working fine.But my problem is Downloading output to Excel sheet functionality is not working.
In output screen LIST->EXPORT->SPREADSHEET functionality is not working.
Please give me suggestions regarding the same or is there any another way to do the same by using ALV List Display.
Points will be rewarded
Thanks and Regards,
Siva.hi ,
this is a working example check this...
REPORT zvenkattest0.
TABLES:pa0002,pa0008.
TYPE-POOLS:slis.
CONSTANTS:c VALUE 'X'.
DATA:BEGIN OF it_pa0008 OCCURS 0,
pernr LIKE pa0008-pernr,
begda LIKE pa0008-begda,
endda LIKE pa0008-endda,
preas LIKE pa0008-preas,
ansal LIKE pa0008-ansal,
lga01 LIKE pa0008-lga01,
expand TYPE xfeld,
END OF it_pa0008.
DATA:BEGIN OF it_pa0002 OCCURS 0,
pernr LIKE pa0002-pernr,
vorna LIKE pa0002-vorna,
nachn LIKE pa0002-nachn,
gbdat LIKE pa0002-gbdat,
gblnd LIKE pa0002-gblnd,
sprsl LIKE pa0002-sprsl,
perid LIKE pa0002-perid,
END OF it_pa0002.
DATA: wa_field_cat TYPE slis_fieldcat_alv,
it_field_cat TYPE slis_t_fieldcat_alv,
wa_keyinfo TYPE slis_keyinfo_alv,
it_layout TYPE slis_layout_alv.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS:s_pernr FOR pa0002-pernr NO INTERVALS.
SELECTION-SCREEN: SKIP.
PARAMETERS:p_expand AS CHECKBOX DEFAULT 'X'.
SELECTION-SCREEN END OF BLOCK b1.
START-OF-SELECTION.
PERFORM select_data.
PERFORM build_field_cat.
PERFORM disply_data.
*& Form SELECT_DATA
text
--> p1 text
<-- p2 text
FORM select_data .
SELECT pernr
begda
endda
preas
ansal
lga01
FROM pa0008
INTO CORRESPONDING FIELDS OF TABLE it_pa0008
UP TO 10 ROWS.
IF NOT it_pa0008[] IS INITIAL.
SELECT pernr
vorna
nachn
gbdat
gblnd
sprsl
perid
FROM pa0002
INTO CORRESPONDING FIELDS OF TABLE it_pa0002
FOR ALL ENTRIES IN it_pa0008
WHERE pernr = it_pa0008-pernr.
ENDIF.
SORT it_pa0008 BY pernr.
ENDFORM. " SELECT_DATA
*& Form BUILD_FIELD_CAT
text
--> p1 text
<-- p2 text
FORM build_field_cat .
wa_field_cat-tabname = 'PA0008'.
wa_field_cat-fieldname = 'PERNR'.
wa_field_cat-seltext_l = 'personnelno'.
APPEND wa_field_cat TO it_field_cat.
wa_field_cat-tabname = 'PA0008'.
wa_field_cat-fieldname = 'BEGDA'.
wa_field_cat-seltext_l = 'begindate'.
APPEND wa_field_cat TO it_field_cat.
wa_field_cat-tabname = 'PA0008'.
wa_field_cat-fieldname = 'ENDDA'.
wa_field_cat-seltext_l = 'enddate'.
APPEND wa_field_cat TO it_field_cat.
wa_field_cat-tabname = 'PA0008'.
wa_field_cat-fieldname = 'PREAS'.
wa_field_cat-seltext_l = 'reason'.
APPEND wa_field_cat TO it_field_cat.
wa_field_cat-tabname = 'PA0008'.
wa_field_cat-fieldname = 'ANSAL'.
wa_field_cat-seltext_l = 'annualsalary'.
APPEND wa_field_cat TO it_field_cat.
wa_field_cat-tabname = 'PA0008'.
wa_field_cat-fieldname = 'LGA01'.
wa_field_cat-seltext_l = 'wagetype'.
APPEND wa_field_cat TO it_field_cat.
wa_field_cat-tabname = 'PA0002'.
wa_field_cat-fieldname = 'VORNA'.
wa_field_cat-seltext_l = 'firstname'.
APPEND wa_field_cat TO it_field_cat.
wa_field_cat-tabname = 'PA0002'.
wa_field_cat-fieldname = 'NACHN'.
wa_field_cat-seltext_l = 'lastname'.
APPEND wa_field_cat TO it_field_cat.
wa_field_cat-tabname = 'PA0002'.
wa_field_cat-fieldname = 'GBDAT'.
wa_field_cat-seltext_l = 'birhtdate'.
APPEND wa_field_cat TO it_field_cat.
wa_field_cat-tabname = 'PA0002'.
wa_field_cat-fieldname = 'GBLND'.
wa_field_cat-seltext_l = 'birthcountry'.
APPEND wa_field_cat TO it_field_cat.
wa_field_cat-tabname = 'PA0002'.
wa_field_cat-fieldname = 'SPRSL'.
wa_field_cat-seltext_l = 'languageused'.
APPEND wa_field_cat TO it_field_cat.
wa_field_cat-tabname = 'PA0002'.
wa_field_cat-fieldname = 'PERID'.
wa_field_cat-seltext_l = 'personnelid'.
APPEND wa_field_cat TO it_field_cat.
ENDFORM. " BUILD_FIELD_CAT
*& Form DISPLY_DATA
text
--> p1 text
<-- p2 text
FORM disply_data .
it_layout-group_change_edit = c.
it_layout-colwidth_optimize = c.
it_layout-zebra = c.
it_layout-detail_popup = c.
it_layout-get_selinfos = c.
IF p_expand = c.
it_layout-expand_fieldname = 'EXPAND'.
ENDIF.
wa_keyinfo-header01 = 'PERNR'.
wa_keyinfo-item01 = 'PERNR'.
wa_keyinfo-item02 = 'SUBTY'.
CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-cprog
is_layout = it_layout
it_fieldcat = it_field_cat
i_tabname_header = 'PA0008'
i_tabname_item = 'PA0002'
is_keyinfo = wa_keyinfo
TABLES
t_outtab_header = it_pa0008
t_outtab_item = it_pa0002.
ENDFORM. " DISPLY_DATA
regards,
venkat. -
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,
HimanshuHi ,
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. -
HI ,
I developed ALV report, the output is coming properly. But if i download that output into local file or spreadsheet from ALV output screen am unable to get the data only header and field headers are coming but data is not coming. But for other ALV with same importing parameters it is downloading properly. I donu2019t know whatu2019s problem only for this ALV, any one can please help me out from this situation pls.
ThxHi Lavanya
There can be two possibilities
1.) check the authorization, if it's missing, then this might happen...u hav said that the other report, it's downloading fine...r u trying to download the other report also with the same user id? is it a standard program or a customized report?
2.) just try reducing the security level in excel --> Tools -> Macros -> Security
regards
Sathish
Maybe you are looking for
-
Watching TV recorded with Eye TV Hybrid on a TV via DVD player
Hello, I need a little help. I have found out on other threads how to take a TV show recorded on my iMac via Eye TV Hybrid and export it to iDVD and burn a DVD to watch on my TV. I was wondering if anyone out there has done this and what the quality
-
Good morning, when I try to deploy an agent on a weblogic server through Camm generates the following error: Failed to deploy. 2011/06/22 15:57:07.912,L,12765,E,DeployThread:adminServer,BEADeployerShell,java.lang.NoClassDefFoundError: weblogic/deploy
-
Tabbed browsing is broken on my 11"MBA. When I open a new tab (cmd-T) and then try to go to a new URL in that tab, the URL opens in the first first tab replacing what was already open on that tab. I've re-installed Safari at least twice but no joy. A
-
Set Core Prefix , can value be a variable ?
<c:set var="foo" scope="session" value="bar"/> <% String varSet = (String)session.getAttribute("foo"); %> For the above variable output is bar...simple now instead of value = "bar" can we have String test = "bar"; <c:set var="foo" scope="session" val
-
Old Producer/Consumer Example question
how would I take this code, the old producer/consumer example, and make it for 2 consumers and 1 producer? basically, like this: Producer put 1 Consumer #1 got 1 Consumer #2 got 1 Producer put 2 Consumer #1 got 2 Consumer #2 got 2 etc..... **********