Leading 0 while downloading to excel
Hi All,
I am displaying my output in ALV using REUSE_ALV_GRID_DISPLAY,but when i download the report to excel using standard download button in the tool bar(local file icon), the leading zeros are getting truncated
eg 0004 is displayed as 4
field is VBKD-ZTERM....
Whats the way out?
<REMOVED BY MODERATOR>
Regards
Gunjan
Edited by: Alvaro Tejada Galindo on Mar 4, 2008 2:52 PM
1.Introduce another field in internal table of type Numeric.
2.Before you pass the internal table to Reuse_alv_grid Display
3.Move the character field to Numeric type and use this
numeric field to display in Reuse_alv_grid_display.
Then the leading zeros will also be displayed while downloading to Excel.
<REMOVED BY MODERATOR>
Edited by: Alvaro Tejada Galindo on Mar 4, 2008 2:53 PM
Similar Messages
-
Warning while downloading an Excel file from WD ABAP
Hi folks,
In one of requirements, Client wants to download all the data that is appearing on the screen ( WD ABAP Application ) to an Excel with a layout in different manner.
We achieved this with Simple Transformations.
Now the question is while downloading the excel file, the framework/other is throwing an Warning like
" The file you are trying to open, 'info.xls', is in a different format than specified by the extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now? "
Note: All the users of my client are using MS Office 2002 / 2003.
I am using the following code........!
*------ Call Transformation for Excel OUTPUT
CALL TRANSFORMATION ZEXCEL_OUTPUT
SOURCE
t_dates = t_dates
t_info = t_info
RESULT XML l_xml_string.
REPLACE ALL OCCURRENCES OF '<?xml version="1.0" encoding="utf-16"?>' l_xml_string WITH '<?xml version="1.0"?><?mso-application progid="Excel.Sheet"?>'.
**-- Call Function Module for converting string data to XSTRING
CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
EXPORTING
text = l_xml_string
mimetype = 'application/xml'
IMPORTING
buffer = l_xml_xstring
EXCEPTIONS
failed = 1
OTHERS = 2.
CALL METHOD cl_wd_runtime_services=>attach_file_to_response
EXPORTING
i_filename = 'info.xml'
i_content = l_xml_xstring
i_mime_type = 'application/vnd.ms-excel'.
With this code I am generating a file of type XML SPREADSHEET 2003. While opening this file I am getting the above message which the user unwanted......
Can any one help me on this -
> How to avoid this warning?
Thanks and Regards,
Aneel Danda
Edited by: danda aneel on Jul 13, 2010 1:43 PMFirstly, Thanks for Your quick Response, Thomas.
Even though what ever may be the file name I am passing either info.xml or Info.xls , In error info.xls is coming.
Kindly provide me an alternative on this XML doesn't seem like it would match the 'application/vnd.ms-excel'.
what is the supported format.?
Similarly, It is not considering the UTF-8 / UTF-16 for xml.........same result is appearing in the output.
Edited by: danda aneel on Jul 14, 2010 7:52 AM -
While downloading to Excel Currency field should Blank instead of 0.00
Hi All,
While downloading to excel from ALV report currency field is downloading as 0.00. My requirement is when the value is 0.00 it should download as blank.
I tried by changing the data type to char but still have problem. Any idea how to fix it??
Regards,
JitendraHi Jitendra,
Please paste your sample code to understand Clearly.
Regards,
Srikanth -
Dump while downloading to excel file!!
Hi,
I'm getting a dump while downloading the ALV (Grid) report into an excel file.
When i inspected, the dump was - " Only character-type data objects are supported at the argument position "obj". In this particular case, the operand "obj" has the non-charcter-type type "P". "-
i'm having few currency values to be displayed.
Thought of an alternative my moving the values into char type field and to display it, but the values are getting rounded of.
Thanks in advance..
Any help would be suitably rewarded.
Kumar R.All the internal fields to be char type..if download functionality to be given..
if there is any issue in doing this...
create any another field in ur table(internal ) of type c length same like ur coressponding currency or quatity field....
move these fields into ur new char field and then prepare fieldcatlog on this..
hope this helps...
i handled like this only..
Praveen . -
WUO-712 : Webutil Error while downloading into Excel
Hello Everyone,
I have installed oracle Application server 10g (10.1.2.0.2) with webutill.
But while downloading data into Excel sheet it's through an error WUO-712 randomly due to which some of the data is missed out.
We have installed webutil 10.5 with forms and reports 10g.
Please suggest some solution for the same.
Please revert for the same ASAP.
Thanks in advance
Regards,
Ajinkya
Edited by: Ajinkya on Nov 3, 2009 10:45 PMPlease reply for this thread.......:)
-
Regarding headers while downloading to excel
Hi all,
I have two headers in single output in my report output.It is displaying correctly,but when i am unable to download these two headers into excel while downloading.can anyone please help me in this.
Thanks,
Anil.hi anil,
in GUI_DOWNLOAD FM
fill the header data in table parameter <filednames> and pass to FM
this will show up as your report header. -
Chinese text while downloading to excel
Hello Everyone,
I have one alv report in which text is coming into Chinese language.
When i download my alv data to excel, chinese text is getting converted into #### characters.
Anyone having idea how to download the chinese text from alv into excel.
Thanks in advance.
Regards,
TarunHi,
When you download in Excel, the character formats are taken from the Front end, besure that the chinese font is installed in your system, i.e. you OS should support the lanagugae format you are downloading to.
Hope It Helps
Anirban -
ALV Report Error while downloading to Excel
Hi All,
when i downloading to Excel from a alv grid following message has been displayed.
Template not found in BDS - Layout: Template-
Guid:
please give me any solution to download the report to excel
Thanks & Regards
Ramu GHi,
Standard Function code for Download to Excel Icon used '&VEXCEL'(Microsoft Excel) instead of '&XXL'(Spreadsheet...) it solved my problem.
Thanks & Regards
Ramu Ganji -
PO No is not coming complete in length while downloading in excel from ALV
Hi to all
My problem is
I have declared
EBELN LIKE EBAN-EBELN.
length is 10.
Now in ALV report it is showing complete PO no but
when downloading itto excel , last digit is cut, only 9 digits are displayed.
Why it is so.
Please guide me...
Thanks & regards
AnubhavHi
Please try to declre the field EBELN as character of length 10 in the internal table for ALV.
EBELN type char(10)
<REMOVED BY MODERATOR>
Thanks
Edited by: Alvaro Tejada Galindo on Feb 22, 2008 6:00 PM -
Current Date in the Name of the report while downloading to excel or PPT
Hi,
I have one requirement in which we need to provide
While downloading report can we provide current date in downloading name automatically?(obi ee 10.1.3.4.1)
As far as i know i hope this is not feasible.
Can you please confirm on the above requirement.
Thanks in Advancesgkon wrote:
Hi,
I have one requirement in which we need to provide
While downloading report can we provide current date in downloading name automatically?(obi ee 10.1.3.4.1)
As far as i know i hope this is not feasible.
Can you please confirm on the above requirement.
Thanks in AdvanceDid you try looking at using BI Publisher? Take a look at this:
http://obiee-bip.blogspot.com/2010/05/dynamic-delivery-file-naming-in-bi.html -
Leading zeros deleted while downloading to excel sheet
Hi ,
i am downloading data to excel sheet from internal table, iam using gui_download but its deletin leading zeros can any one tell me as to how i go about this
for ex i ahve a mterial no : 00123
i see 123 i want it to be 00123
Thanks
kajolHi,
try to explain to excel, that this field is character field (I think that it will be done by adding single quote as first character of string).
Pointing to my previous answer try:
Constants: c_single_quote(1) type c value ''''. " I _hope_ it works
loop at itab.
concatenate c_single_quote itab-matnr to texttab-c_matnr.
endloop. -
Last digit truncates while downloading to Excel from ALV Grid
Hi All,
I have been using REUSE_ALV_LIST_DISPLAY and REUSE_ALV_GRID_DISPLAY in my report program.
While i use REUSE_ALV_GRID_DISPLAY and downloading the data to a local file(Excel) the last digit of the Vendor code is truncated. But in REUSE_ALV_LIST_DISPLAY the datas are downloaded correctly as displayed in the ALV.
I have copied the code for the reference.
REPORT zfirp001 .
TYPE-POOLS: slis.
TABLES: bsak.
SELECT-OPTIONS: s_bukrs FOR bsak-bukrs,
s_lifnr FOR bsak-lifnr,
s_blart FOR bsak-blart,
s_augdt FOR bsak-augdt,
s_zterm FOR bsak-zterm.
PARAMETERS: s_list AS CHECKBOX,
s_vari LIKE disvariant-variant.
DATA: g_ext_num(24) TYPE c.
DATA: BEGIN OF gt_bsak OCCURS 0,
bukrs LIKE bsak-bukrs,
lifnr LIKE bsak-lifnr,
augdt LIKE bsak-augdt,
gjahr LIKE bsak-gjahr,
belnr LIKE bsak-belnr,
blart LIKE bsak-blart,
zterm LIKE bsak-zterm,
END OF gt_bsak.
DATA: BEGIN OF gt_bseg OCCURS 0,
bukrs LIKE bseg-bukrs,
belnr LIKE bseg-belnr,
gjahr LIKE bseg-gjahr,
wrbtr LIKE bseg-wrbtr,
projk LIKE bseg-projk,
shkzg LIKE bseg-shkzg,
hkont LIKE bseg-hkont,
END OF gt_bseg.
ALV
DATA: gt_fieldtab TYPE slis_t_fieldcat_alv,
g_save(1) TYPE c,
g_variant LIKE disvariant.
DATA: BEGIN OF gt_result OCCURS 0,
bukrs LIKE bsak-bukrs,
lifnr LIKE bsak-lifnr,
name1 LIKE lfa1-name1,
augdt LIKE bsak-augdt,
gjahr LIKE bsak-gjahr,
belnr LIKE bsak-belnr,
blart LIKE bsak-blart,
zterm LIKE bsak-zterm,
wrbtr LIKE bseg-wrbtr,
waers LIKE bkpf-waers,
ext_num(24) TYPE c,
txt20 LIKE skat-txt20,
usr00 LIKE prps-usr00,
usr01 LIKE prps-usr01,
usr02 LIKE prps-usr02,
usr03 LIKE prps-usr03,
END OF gt_result.
CONSTANTS: c_credit(1) TYPE c VALUE 'H',
c_x(1) TYPE c VALUE 'X',
c_en(2) TYPE c VALUE 'EN',
c_mrc(4) TYPE c VALUE 'CA01'.
*====================================================
INITIALIZATION.
PERFORM initialize_variant.
AT SELECTION-SCREEN.
PERFORM pai_of_selection_screen.
*====================================================
START-OF-SELECTION.
REFRESH gt_result.
find clearing documents
SELECT bukrs
lifnr
augdt
gjahr
belnr
blart
zterm
INTO TABLE gt_bsak
FROM bsak
WHERE bukrs IN s_bukrs
AND lifnr IN s_lifnr
AND augdt IN s_augdt
AND blart IN s_blart
AND zterm IN s_zterm.
CHECK NOT gt_bsak[] IS INITIAL.
LOOP AT gt_bsak.
read WBS items
SELECT bukrs
belnr
gjahr
dmbtr
projk
shkzg
hkont
INTO TABLE gt_bseg
FROM bseg
WHERE bukrs = gt_bsak-bukrs
AND belnr = gt_bsak-belnr
AND gjahr = gt_bsak-gjahr
AND projk > space.
gt_result-bukrs = gt_bsak-bukrs.
gt_result-lifnr = gt_bsak-lifnr.
gt_result-augdt = gt_bsak-augdt.
gt_result-belnr = gt_bsak-belnr.
gt_result-gjahr = gt_bsak-gjahr.
gt_result-blart = gt_bsak-blart.
gt_result-zterm = gt_bsak-zterm.
document currency
SELECT SINGLE waers
INTO gt_result-waers
FROM bkpf
WHERE bukrs = gt_bsak-bukrs
AND belnr = gt_bsak-belnr
AND gjahr = gt_bsak-gjahr.
vendor name
SELECT SINGLE name1
INTO gt_result-name1
FROM lfa1
WHERE lifnr = gt_result-lifnr.
for each accounting document
LOOP AT gt_bseg.
convert to external WBS
CALL FUNCTION 'PSPNUM_INTERN_TO_EXTERN_CONV'
EXPORTING
edit_imp = c_x
int_num = gt_bseg-projk
IMPORTING
ext_num = gt_result-ext_num
EXCEPTIONS
not_found = 1
OTHERS = 2.
debit or credit
IF gt_bseg-shkzg = c_credit.
gt_result-wrbtr = gt_bseg-wrbtr.
ELSE.
gt_result-wrbtr = gt_bseg-wrbtr * -1.
ENDIF.
GL short Text
SELECT SINGLE txt20
INTO gt_result-txt20
FROM skat
WHERE spras = c_en
AND ktopl = 'CA01'
AND saknr = gt_bseg-hkont.
user fields
SELECT SINGLE usr00
usr01
usr02
usr03
INTO (gt_result-usr00,
gt_result-usr01,
gt_result-usr02,
gt_result-usr03)
FROM prps
WHERE pspnr = gt_bseg-projk.
append to result table
APPEND gt_result.
ENDLOOP.
ENDLOOP.
*====================================================
END-OF-SELECTION.
PERFORM initialize_fieldcat USING gt_fieldtab[].
g_variant-report = sy-repid.
g_save = 'A'.
IF s_list = 'X'.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
it_fieldcat = gt_fieldtab
i_default = 'A'
i_save = g_save
is_variant = g_variant
TABLES
t_outtab = gt_result.
ELSE.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
it_fieldcat = gt_fieldtab
i_default = 'A'
i_save = g_save
is_variant = g_variant
TABLES
t_outtab = gt_result.
ENDIF.
*& Form initialize_variant
FORM initialize_variant.
g_save = 'A'.
CLEAR g_variant.
g_variant-report = sy-repid.
CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
EXPORTING
i_save = g_save
CHANGING
cs_variant = g_variant
EXCEPTIONS
not_found = 2.
IF sy-subrc = 0.
s_vari = g_variant-variant.
ENDIF.
ENDFORM. " INITIALIZE_VARIANT
*& Form pai_of_selection_screen
FORM pai_of_selection_screen.
IF NOT s_vari IS INITIAL.
MOVE s_vari TO g_variant-variant.
CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE'
EXPORTING
i_save = g_save
CHANGING
cs_variant = g_variant.
ELSE.
PERFORM initialize_variant.
ENDIF.
ENDFORM. " PAI_OF_SELECTION_SCREEN
*& Form initialize_fieldcat
FORM initialize_fieldcat USING p_fieldtab TYPE slis_t_fieldcat_alv.
DATA: l_fieldcat TYPE slis_fieldcat_alv.
CLEAR l_fieldcat.
l_fieldcat-tabname = 'GT_RESULT'.
l_fieldcat-fieldname = 'BUKRS'.
l_fieldcat-seltext_L = 'Company'.
l_fieldcat-outputlen = '8'.
APPEND l_fieldcat TO p_fieldtab.
l_fieldcat-tabname = 'GT_RESULT'.
l_fieldcat-fieldname = 'LIFNR'.
l_fieldcat-seltext_L = 'Vendor'.
l_fieldcat-outputlen = '10'.
APPEND l_fieldcat TO p_fieldtab.
l_fieldcat-tabname = 'GT_RESULT'.
l_fieldcat-fieldname = 'NAME1'.
l_fieldcat-seltext_L = 'Name'.
l_fieldcat-outputlen = '35'.
APPEND l_fieldcat TO p_fieldtab.
l_fieldcat-tabname = 'GT_RESULT'.
l_fieldcat-fieldname = 'AUGDT'.
l_fieldcat-seltext_L = 'Cleared'.
l_fieldcat-outputlen = '10'.
APPEND l_fieldcat TO p_fieldtab.
l_fieldcat-tabname = 'GT_RESULT'.
l_fieldcat-fieldname = 'GJAHR'.
l_fieldcat-seltext_L = 'Year'.
l_fieldcat-outputlen = '5'.
APPEND l_fieldcat TO p_fieldtab.
l_fieldcat-tabname = 'GT_RESULT'.
l_fieldcat-fieldname = 'BELNR'.
l_fieldcat-seltext_L = 'Document'.
l_fieldcat-outputlen = '10'.
APPEND l_fieldcat TO p_fieldtab.
l_fieldcat-tabname = 'GT_RESULT'.
l_fieldcat-fieldname = 'BLART'.
l_fieldcat-seltext_L = 'Type'.
l_fieldcat-outputlen = '4'.
APPEND l_fieldcat TO p_fieldtab.
l_fieldcat-tabname = 'GT_RESULT'.
l_fieldcat-fieldname = 'ZTERM'.
l_fieldcat-seltext_L = 'Pay Terms'.
l_fieldcat-outputlen = '4'.
APPEND l_fieldcat TO p_fieldtab.
l_fieldcat-tabname = 'GT_RESULT'.
l_fieldcat-fieldname = 'WRBTR'.
l_fieldcat-seltext_L = 'Amount'.
l_fieldcat-outputlen = '13'.
APPEND l_fieldcat TO p_fieldtab.
l_fieldcat-tabname = 'GT_RESULT'.
l_fieldcat-fieldname = 'WAERS'.
l_fieldcat-seltext_L = 'CURR'.
l_fieldcat-outputlen = '5'.
APPEND l_fieldcat TO p_fieldtab.
l_fieldcat-tabname = 'GT_RESULT'.
l_fieldcat-fieldname = 'EXT_NUM'.
l_fieldcat-seltext_L = 'WBS'.
l_fieldcat-outputlen = '24'.
APPEND l_fieldcat TO p_fieldtab.
l_fieldcat-tabname = 'GT_RESULT'.
l_fieldcat-fieldname = 'TXT20'.
l_fieldcat-seltext_L = 'Short Text'.
l_fieldcat-outputlen = '20'.
APPEND l_fieldcat TO p_fieldtab.
l_fieldcat-tabname = 'GT_RESULT'.
l_fieldcat-fieldname = 'USR00'.
l_fieldcat-seltext_L = 'H/O File Ref'.
l_fieldcat-outputlen = '20'.
APPEND l_fieldcat TO p_fieldtab.
l_fieldcat-tabname = 'GT_RESULT'.
l_fieldcat-fieldname = 'USR01'.
l_fieldcat-seltext_L = 'Local File Ref'.
l_fieldcat-outputlen = '20'.
APPEND l_fieldcat TO p_fieldtab.
l_fieldcat-tabname = 'GT_RESULT'.
l_fieldcat-fieldname = 'USR02'.
l_fieldcat-seltext_L = 'INFORM Agree ID'.
l_fieldcat-outputlen = '10'.
APPEND l_fieldcat TO p_fieldtab.
l_fieldcat-tabname = 'GT_RESULT'.
l_fieldcat-fieldname = 'USR03'.
l_fieldcat-seltext_L = 'INFM Prim Ag ID'.
l_fieldcat-outputlen = '10'.
APPEND l_fieldcat TO p_fieldtab.
ENDFORM. " INITIALIZE_FIELDCAT
Could the experts do help to overcome the probs.
Thanks in Advance.
Regards,
Anbalagan.VHi Anbalagan,
i've tested your program - but it works fine (Rel. 4.6C,SAPKB46C30)
download is ok and direct transfer (excel inplace) is ok.
but i've a question to the selection of waers in your program -
why do you select waers from bkpf and not from bsak ?
i think sel. of bkpf is'nt necessary !
regards Andreas -
0001 becomes 1 while downloading to Excel.
Hi friends,
While i download a Internal table to excel, the data 0001 is convreted into 1. Is there any way we can get the exact data to excel or CSV?
Lijo JosephHi,
When the CONTENTS_BIN is filled with the internal table values instead of passing the values directly apppend the Excel formula String and fill the CONTENTS_BIN.
ie. we are explicitly converting the value to a TEXT type.So this string will be transferred to the cells in EXCEL down file where the EXCEL code gets executed and you get your '000's there.
=REPLACE("<value>",<start position>,<num of chars to replace>,"<value>")
=REPLACE("00100",1,5,"00100")
All Excel formatting formulas can be passed like this to achieve the necessary requirement.
cheers
Prabhu
Message was edited by:
prabhu soundara pandian -
Need help on avoid truncation of leading zeros while export to Excel
Hi
I am using crystal reports XI version and facing numerical format issue while exporting data from crystal report viewer to excel file, it is removing leading zeros in a alphanumeric field (String field from DB)
Thanks
NagamaniThe only thing that might do this would be to append an apostrophe (') to the beginning of the field. What I would try is:
1. Add a text object to the report where you want this string to appear.
2. Type an apostrophe in the text box.
3. Drag the field into the text box so that it's to the right of the apostrophe.
If you don't want the apostrophe to appear when viewing the report, try this:
1. Right-click on the text box and select "Format Object". Set the font color to be the same as the background color.
2. Double-click in the text box.
3. Select the field, right-click on it and select the "Format..." option. Set the font color to black or whatever other color you're using in your report.
-Dell -
Field value is truncated while downloading to excel sheet from ALV report
Hi All,
I developed ALV report and displaying output.
In that output i had a filed VBRP-PRODH filed.
In the output it is coming correctly but while i click downlaod to excel the valus is truncted.
for Example the value for VBRP-PRODH is 03322764170100201
while downlaoding this one to excel it is showing 3322764170100200
Any inputs please..
Regards
JaiWrong forum..post in ABAP
Maybe you are looking for
-
Pasing a string from one frame to another can anyone help
HI i have a textboxA in frame1 with a string eg.someones name. when sone one clicks on button A, Frame be will open up with the contents of texyboxA being placed in Textboxb in Frame 2. can anyone show how i can do this. thanks# it would get be out o
-
Hi, I am using JDK 1.4.1 and am trying to implement Drag n Drop between a JTree and Labels with ImageIcons, both on different panes. I got the DnD working just on the tree. but i cant get to drag and drop the label on the Jtree as a node. I am gettin
-
Unable to locate Live Office in Business Objects Enterprise XI3.1 download
We recently downloaded Business Objects Enterprise XI 3.1 and plan to upgrade soon. I have been unable to locate the Live Office files. I looked in the collaterals folder. Any response would be appreciated. Thanks, Mike
-
Cisco documentation recommends using a dedicated controller for the guest anchor controller function becuase it needs to be located in the DMZ. However, if I have spare capacity on an existing controller (ie one used to manage APs) then perhaps I can
-
"cannot allocate memory" When trying to start a new project in FCPX
So I am I getting the "cannot allocate memory" error whenever I try to start a new project in FCPX System specs: Model Name: Mac Pro Model Identifier: MacPro3,1 Processor Name: Quad-Core Intel Xeon Processor Speed: