on 09-28-2010 10:22 AM
Hi Experts,
I have a ABAP webdynpro report which contains a ALV grid output. The ALV table has a time field (create_time of type tims).
The problem is when the create_time value is initial (00:00:00 by default) it displays 00:00:00 in the ALV.
When I export the contents to excel then there it shows the same value as 12:00:00 AM.
How can I avoid this programmatically? Actually when time is initial then I want to display as blank instead of 00:00:00.
For this if I change the data type of this field to CHAR08 then it displays the value as 0 (if initial) and 140523 (if time has some value or its not initial) instead if 14:05:23.
I don't know if there is any better way to handle this.
Please help.
Thanks & Regards
Gopal
My suggestion is that you make the context attribute a type string. Then when you populate the data into the internal table that is bound to the context you perform a write statement on the date field. Here is some psydo-code.
if <ls_data>-time is initial.
clear <ls_output>-time.
else.
write <ls_data>-time to <ls_output>-time.
endif.
This way when the time is inital you can display nothing instead of the 00:00:00. This should also keep Excel from knowing that this column is a time field. To Excel it will just be a string and it should display whatever text you placed into the field.
Of course this means that filtering and sorting on this field won't work right. Those operations will be befored without knowledge this is actually a time field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I have also a problem with ALV to excel output. I have a material number in ALV, bound to context type MATNR. If we export material numbers like 031710 999 1, with several spaces within, in excel spaces have condensed to one. Tried to change the context type to char18, result same. Is there a way to produce perfect number? Seems to export data as displayed in alv, with condensed materialnumber.
Regards
Pekka Pottonen
Hi,
In user settings (SU01) in the Defaults tab change the time format to "24 hour formaT" and check.
Regards,
madhu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.