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: 

ALV to excel

Former Member
0 Kudos

Hi,

I am facing problem in dowloading alv to excel for one particular field.

Code for the column is:

month - yy.

for ex: July -13  But after dowloading it shows 13 - July.

CALL FUNCTION 'ISP_GET_MONTH_NAME'

      EXPORTING

       DATE               = wa_final-lwd

        language           = SY-LANGU

*       MONTH_NUMBER       = '00'

     IMPORTING

*       LANGU_BACK         =

*       LONGTEXT           =

       SHORTTEXT          = month

*     EXCEPTIONS

*       CALENDAR_ID        = 1

*       DATE_ERROR         = 2

*       NOT_FOUND          = 3

*       WRONG_INPUT        = 4

*       OTHERS             = 5

              .

    IF sy-subrc <> 0.

* Implement suitable error handling here

    ENDIF.

CONCATENATE month '-'  wa_final-lwd+2(2) INTO wa_final-month_yy.

Please help.

Thanks in advance.

5 REPLIES 5

VenkatRamesh_V
Active Contributor
0 Kudos

Hi,

select the  the excel column, right click->Format cell->number tab->custom->mmmm-yy

eg Microsoft Excel 2007.

Regards,

Venkat

0 Kudos

Thanks.I have informed user about this solution already.

But  they want permanat solution irrespective of any setting or format.

I am getting some sap note for that .. will confirm if I get any solution ...

0 Kudos

Hi,

That's excel related...

Just some idea, if you want to avoid that Excel recognize your value as a date you can also concatenate a single quote in front of the value before sending it...eg. 'July - 13

Br,

Manu.

Former Member
0 Kudos

Hi ,

It worked, thanks but still after downloading to excel we have to double clk on the cell...

0 Kudos

Hi,

I used   '="'   this before and after the fields

ex.

CONCATENATE '="' month '-'  wa_final-lwd+2(2)   '"' INTO wa_final-month_yy   .

It worked .. valaues are not changing in excel.

But only thing is,  in alv display is not proper  - - - >   ="APR-14"  .