RE: cl_salv_table: View could not be changed to: &VEXCEL

      1. TYPES: BEGIN OF tp_ty,
      2. trkorr TYPE trkorr,
      3. as4text TYPE as4text,
      4. toc TYPE trkorr,
      5. importd TYPE d,
      6. importt TYPE t,
      7. impcount TYPE i,
      8. END OF tp_ty.
      9.  
      10. DATA: t_tp TYPE STANDARD TABLE OF tp_ty WITH NON-UNIQUE KEY table_line,
      11. r_alv TYPE REF TO cl_salv_table.
      12. ...
      13. TRY.
      14. cl_salv_table=>factory( IMPORTING r_salv_table = me->r_alv
      15. CHANGING t_table = me->t_tp ).
      16. CATCH cx_salv_msg.
      17. ENDTRY.
      18.  
      19. adjust_column_text( ).
      20.  
      21. lr_functions = me->r_alv->get_functions( ).
      22. lr_functions->set_all( abap_true ).
      23.  
      24. 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

      Hi Matt,   Do you see the same behaviour using the following code?   Copy 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.

      User Rating: Be the first one !
      alex Default Asked on November 2, 2016 in user interface-development.
      Add Comment
      1 Answers

        Hi Matt,

         

        Do you see the same behaviour using the following code?

         

        1. REPORT zsh_test2.
        2.  
        3. PARAMETERS:
        4. p_table TYPE tablename.
        5.  
        6. DATA:
        7. gt_tab TYPE REF TO data,
        8. go_alv TYPE REF TO cl_salv_table,
        9. go_functions TYPE REF TO cl_salv_functions.
        10.  
        11. FIELD-SYMBOLS:
        12. <gt_tab> TYPE ANY TABLE.
        13.  
        14. CREATE DATA gt_tab TYPE STANDARD TABLE OF (p_table).
        15. ASSIGN gt_tab->* TO <gt_tab>.
        16.  
        17. SELECT * FROM (p_table) INTO TABLE <gt_tab>.
        18.  
        19. CALL METHOD cl_salv_table=>factory
        20. IMPORTING
        21. r_salv_table = go_alv
        22. CHANGING
        23. t_table = <gt_tab>.
        24.  
        25. go_functions = go_alv->get_functions( ).
        26. go_functions->set_all( abap_true ).
        27.  
        28. go_alv->display( ).

         

        Regards,

         

        Steve.

        Add Comment

        Your Answer

        By posting your answer, you agree to the privacy policy and terms of service.