2008 Jun 06 4:06 PM
Hi,
I need to export LQUA-WERKS to excel..
But when exported I mis leading zeros?
40 need to be exported in excel 0040 ?
tnx,
Adibo.
2008 Jun 06 5:01 PM
Hello Adibo,
Simplest way to achieve this is like below:
CONCATENATE ''''' LQUA-WERKS INTO lv_werks.
Here you are concatenating single colon ( ' ) with your plant number and moving it to char type variable.
Now when you use this variable to download into XL, It will show appending Zeros and it will not show your appended single colon.
This surely works..
<REMOVED BY MODERATOR>
thnx,
ags
Edited by: Alvaro Tejada Galindo on Jun 12, 2008 6:59 PM
2008 Jun 06 4:10 PM
How r u exporting it?
If you r using some internal table then it will take data in the format present in internal table.
If you r exporting it from ALV, it will take as it is displayed in ALV.
So, in both cases, adjust your internal table data and then export.
G@urav.
2008 Jun 06 4:18 PM
2008 Jun 06 4:20 PM
adjust that column data in internal table to whatever format you want it to appear in EXCEL.
G@urav.
2008 Jun 06 4:23 PM
TYPES: BEGIN OF ls_lqua,
werks TYPE lqua-werks,
matnr TYPE lqua-matnr,
gesme TYPE lqua-gesme,
meins TYPE lqua-meins,
letyp TYPE lqua-letyp,
lgtyp TYPE lqua-lgtyp,
lgpla TYPE lqua-lgpla,
END OF ls_lqua.
DATA: lt_lqua TYPE STANDARD TABLE OF ls_lqua,
wa_lqua TYPE ls_lqua.
when I set breakpoint to see format of lt_lqua-werks, it is shown as 0040..but when exported 40 ?? strange
2008 Jun 06 4:30 PM
Do we have checked options and settings in Excel?
I think there should be some setting in Excel.
It must be giving 0040 when you download it into text file.
G@urav.
2008 Jun 06 4:43 PM
Hi
It depends on excel, not SAP.
As the code of plant is a number, excel manage the field as it was a numeric field, so it's deleting the leading zero.
Before opening the file u should set the colunm for WERKS as TEXT field.
Max
2008 Jun 06 4:24 PM
Always best method would be........
through se16 download the data into text file then take out the header, open the blank excell sheet then open your text file in this excell. While opening the this file it will give you differnet options go with delimitor then in the next screen give the another '|' as the delimitor and with shift select all the columns in the below window go with next option
in the next screen select the text radio button and finish.... thats it u will get all the fields with leading zeros if exists in the original list.
2008 Jun 06 4:46 PM
use the FM :
CONVERSION_EXIT_ALPHA_INPUT
this convert ure values or example a char(4) if u have a valu = 3, this function return = 0003
OR
CONVERSION_EXIT_ALPHA_OUTPUT
this quit the zeros example if u have a 0000056, only return 56
2008 Jun 06 5:01 PM
Hello Adibo,
Simplest way to achieve this is like below:
CONCATENATE ''''' LQUA-WERKS INTO lv_werks.
Here you are concatenating single colon ( ' ) with your plant number and moving it to char type variable.
Now when you use this variable to download into XL, It will show appending Zeros and it will not show your appended single colon.
This surely works..
<REMOVED BY MODERATOR>
thnx,
ags
Edited by: Alvaro Tejada Galindo on Jun 12, 2008 6:59 PM
2008 Jun 09 12:48 PM
Hi,
Not one solution has helped..But I solved it like this:
I exported file in TXT. Then when opening with excel chose option to change column WERKS as text!
2008 Jun 10 11:26 AM
Hi Adibo, Can you please explain me how you solved this issue. PLease share this with me.
2008 Jun 12 10:42 AM
Hi @CN,
I just exported lt_lqua as TXT file, that was enough..
When opening this file in EXCEL you can define werks column as TEXT, so leading zeros won't be deleted..