Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Change the field format when Excel Downloading..

Former Member
0 Kudos

Hi.

In ALV, when downloads, some fields change into date format.

ex. In screen : 37-1

In excel : jan-37.

How to correct it? let's me know..plz..

Thank you in advance.

Best regards.

kil

3 REPLIES 3

Former Member
0 Kudos

this might be excel is treating that value as Date. you can make the field as Character field by putting a single quote(') before that value.

for example if you type---> '37-1

in the EXCEL column, you dont see that conversion to JAN-37.

so to do that from the program,you can do by CONCATENATE

DATA : V_TEXT(10) TYPE C.

CONCATENATE <b>'''' "these 4 single quotes form 1 single quote</b>

V_VALUE

INTO V_TEXT.

so in the program the value in V_TEXT will be '37-1

if you check this in excel,the value will appear correctly now.

but if you open the file in NOTEPAD,you still can see the single quote before that value.

Regards

Srikanth

Message was edited by: Srikanth Kidambi

Former Member
0 Kudos

I solved the problem.

I add the space as prefix.

No problem.. In ALV and Excel..

IF it use "'", in ALV I see the "'".

Thanks a lot..

0 Kudos

Hi Kim,

Appreciate if you can share your code. I am having the same problem as yours and I did the same thing as how you solved your problem. It didn't work for me.

Regards,

Kok Meng