11-09-2011 11:33 PM
HI,
I am facing funny problem.
I have a varialble, please see below
I_LGTYP TYPE CHAR10
I_LGTYP = '01-01-01'.
when i write this value into XLS file using GUI_DOWNLOAD FM, It is converting as Date and writing in Excel as 1/1/2001
i tried different options by declaring I_LGTYP as NUM10 and then it is writing as 10101
String same as CHAR.
please tell me how can i reslove this problem as i would like to see in Excel as 01-01-01.
I tried typing 01-01-01 in excel it immediatley changed to date format 1/1/2001, then i tried '01-01-01 and this time it works.
Thanks
Sarath
11-10-2011 4:35 PM
so, put your leading single quote on the value and "fool" Excel. This is an Excel "feature" that we've all had to deal with....there are other fixes, I'm sure.
And, seriously, Microsoft products cause such severe problems....so, search the forums for these basic problems....it's been asked a few hundred times before....
Edited by: BreakPoint on Nov 10, 2011 5:36 PM
11-10-2011 12:10 AM
HI before you filling up your internal table fields,
just write statement like...
WRITE WA_FIELD TO I_LGTYP DD/MM/YYYY.
I_LGTYP will be containing in date format.
11-10-2011 12:34 AM
hi suji thanks for replay
I am not sure if this statement is going to work as i would want to see output 01-01-01 in Excel not as Date format but as Text filed, and more over the value can be some times 01-01 or VS1-002 or 0180000026 or PACKING
thanks
sb
11-10-2011 2:41 AM
You can enter a quote into a text field by typing 3 single quotes. The first quote is used to begin the string, the other two quotes used to indicate to SAP that a quote is to be escaped.
DATA: I_LGTYP TYPE CHAR10.
I_LGTYP = '''01-01-01'.
11-10-2011 4:32 PM
Vishnu, thanks for reply
how can i send variable insted of value?
for example if i send like below
WA_RECORD-STO_BIN = '''WA_LQUA-LGPLA'.
Note : WA_LQUA-LGPLA variable has value 01-01-01
If i write above statement in program the output I am getting in excel as WA_LQUA-LG (since the variable is 10 long)
thanks
SB
11-10-2011 4:35 PM
so, put your leading single quote on the value and "fool" Excel. This is an Excel "feature" that we've all had to deal with....there are other fixes, I'm sure.
And, seriously, Microsoft products cause such severe problems....so, search the forums for these basic problems....it's been asked a few hundred times before....
Edited by: BreakPoint on Nov 10, 2011 5:36 PM
11-10-2011 5:18 PM
Guys,
it worked if i write code like below
CONCATENATE '''' WA_LQUA-LGPLA INTO WA_LQUA-LGPLA.
WA_RECORD-STO_BIN = WA_LQUA-LGPLA.
thanks for all your comments