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: 

Enabling Excel in Place icon in ALV Hierarchical List

Former Member
0 Kudos

Hi Gurus,

I have included the 'Excel in Place' button in my ALV output, but the problem here is that it cannot be executed. Anyone knows on how to enable this? I'm displaying my output in ALV Hierarchical List and used the CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'. Your help is highly much appreciated. Thanks in advance!

1 REPLY 1

Former Member
0 Kudos

Hi,

You should use the GUI status any standard program to get the excel Icon, After that you just follow the below shown coding.

FORM user_command USING iv_ucomm TYPE sy-ucomm

iv_selfield TYPE slis_selfield.

CASE iv_ucomm.

when '&VEXCEL'.

data:v_file_name type RLGRAP-FILENAME,

v_f4_file_name type IBIPPARMS-PATH.

CALL FUNCTION 'F4_FILENAME'

EXPORTING

PROGRAM_NAME = SYST-CPROG

DYNPRO_NUMBER = SYST-DYNNR

IMPORTING

FILE_NAME = V_F4_FILE_NAME.

v_file_name = v_f4_file_name.

CALL FUNCTION 'MS_EXCEL_OLE_STANDARD_DAT'

EXPORTING

FILE_NAME = v_file_name

TABLES

  • PIVOT_FIELD_TAB =

DATA_TAB = gt_item

  • FIELDNAMES =

EXCEPTIONS

FILE_NOT_EXIST = 1

FILENAME_EXPECTED = 2

COMMUNICATION_ERROR = 3

OLE_OBJECT_METHOD_ERROR = 4

OLE_OBJECT_PROPERTY_ERROR = 5

INVALID_PIVOT_FIELDS = 6

DOWNLOAD_PROBLEM = 7

OTHERS = 8

.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ENDCASE.

CLEAR iv_selfield.

ENDFORM.

I hope this solve your problem