10-21-2008 10:28 AM
TYPES: BEGIN OF tp_ty,
trkorr TYPE trkorr,
as4text TYPE as4text,
toc TYPE trkorr,
importd TYPE d,
importt TYPE t,
impcount TYPE i,
END OF tp_ty.
DATA: t_tp TYPE STANDARD TABLE OF tp_ty WITH NON-UNIQUE KEY table_line,
r_alv TYPE REF TO cl_salv_table.
...
TRY.
cl_salv_table=>factory( IMPORTING r_salv_table = me->r_alv
CHANGING t_table = me->t_tp ).
CATCH cx_salv_msg.
ENDTRY.
adjust_column_text( ).
lr_functions = me->r_alv->get_functions( ).
lr_functions->set_all( abap_true ).
me->r_alv->display( ).
When the alv is displayed, I get the Excel function button. But when I press it, I get message View could not be changed to: &VEXCEL
Something to do with the structure of t_tp perhaps?
Thanks,
matt
10-21-2008 12:08 PM
Hi Matt,
Do you see the same behaviour using the following code?
REPORT zsh_test2.
PARAMETERS:
p_table TYPE tablename.
DATA:
gt_tab TYPE REF TO data,
go_alv TYPE REF TO cl_salv_table,
go_functions TYPE REF TO cl_salv_functions.
FIELD-SYMBOLS:
<gt_tab> TYPE ANY TABLE.
CREATE DATA gt_tab TYPE STANDARD TABLE OF (p_table).
ASSIGN gt_tab->* TO <gt_tab>.
SELECT * FROM (p_table) INTO TABLE <gt_tab>.
CALL METHOD cl_salv_table=>factory
IMPORTING
r_salv_table = go_alv
CHANGING
t_table = <gt_tab>.
go_functions = go_alv->get_functions( ).
go_functions->set_all( abap_true ).
go_alv->display( ).
Regards,
Steve.
10-21-2008 12:08 PM
Hi Matt,
Do you see the same behaviour using the following code?
REPORT zsh_test2.
PARAMETERS:
p_table TYPE tablename.
DATA:
gt_tab TYPE REF TO data,
go_alv TYPE REF TO cl_salv_table,
go_functions TYPE REF TO cl_salv_functions.
FIELD-SYMBOLS:
<gt_tab> TYPE ANY TABLE.
CREATE DATA gt_tab TYPE STANDARD TABLE OF (p_table).
ASSIGN gt_tab->* TO <gt_tab>.
SELECT * FROM (p_table) INTO TABLE <gt_tab>.
CALL METHOD cl_salv_table=>factory
IMPORTING
r_salv_table = go_alv
CHANGING
t_table = <gt_tab>.
go_functions = go_alv->get_functions( ).
go_functions->set_all( abap_true ).
go_alv->display( ).
Regards,
Steve.
10-21-2008 1:50 PM
Yes... so it's something environmental. GUI/PC related. If I open Excel before clicking on the button, it works fine.
thanks
matt
10-21-2008 2:05 PM
It seems that Excel doesn't always play nicely with the SAPgui. I've had problems before where exiting a program that used the OLE methods of Excel to open XLS documents in place and extract data caused an illegal instruction error in Windows.
Does your SAPgui have the latest patches installed?
Regards,
Steve.
10-22-2008 6:19 AM
If you want to change the view of an cl_salv_table to Excel while you are in the entry mode in an excel window you will get this error message.
After you get out of the entry mode in youe excel window it will work.
Regards
Gabriel
10-09-2012 4:42 PM
12-20-2012 5:55 AM
Thanks so much.
You just solved something that has been troubling me for almost a week now. I didn't know how to reproduce this error that my customer reported, but now I do! (and how to avoid it in future).
Kind regards,
Tim.
10-13-2015 4:00 PM
thanks for posting this
- I had the same problem
(using Windows 8, SAP 7.40, and Excel from MS Offfice Professional Plus 2013)
"Not possible to switch to Excel display" in the status line of the SAPGUI
upon clicking the in-place Excel icon in application icon bar of cl_salv_table.
FWIW,
If upon this message, I then nevertheless click on the in-place Excel icon,
I get a white/empty pane;
the Excel-Icon in the SapGui has gone;
instead there is a ALV-Grid icon;
clicking this ALV-Grid icon switches back to the ALV Grid view alright.
=>
so one can only switch between ALV and an empty pane. (without any error message)
Even if I then close MS-Excel,
the problem with the empty pane persists.
Only after also closing and starting anew the SAP application,
has the problem gone away
(it is now possible to switch to in-place Excel)
FWIW
before I found your post,
I told the user this workaround:
instead of clicking onto the in-place Excel icon:
pressing context-menu-mouse button on some cell in the ALV-Grid itself;
this pops up a small context menu which has
"Spreadsheet",
then "Select from All Available formats",
then "10 Excel (in Office 2007 XLSX Format)",
=>
this exports to a local Excel compatible file.
HTH
01-27-2016 10:48 PM
When I ran a report and clicked View --> Excel inplace, I had the same issue. Later I found out that my excel was open and the cursor was on edit mode. When I came out of the edit mode in that file, excel inplace started working without the error. No coding was changed.
I would have preferred a message that Excel is on edit mode on another open worksheet.