‎2007 Jun 19 8:19 AM
hi....
m creating a simple report. in which output is displayed in ALV grid.
now if i click to excel view it gives me just excel sheet without data. so what is the reason for this. and how can i remove unwanted funtion on toolbar.
m nt using modular prog.
pls tell me what shud i do now....
‎2007 Jun 19 8:27 AM
HI,
I donno the reason for that , but you can remove the buttons from the toolbar..
Eg Program:
REPORT ZNAZSAM.
place tab on the function and press F1 to get the function code
TYPE-POOLS: slis.
DATA: x_fieldcat TYPE slis_fieldcat_alv,
it_fieldcat TYPE slis_t_fieldcat_alv,
l_layout TYPE slis_layout_alv.
data: IT_EXCLUDE TYPE SLIS_T_EXTAB.
DATA: BEGIN OF itab OCCURS 0,
field1 TYPE i,
field2 TYPE i,
field3 TYPE i,
END OF itab.
DO 20 TIMES.
itab-field1 = sy-index.
itab-field2 = sy-index + 1.
APPEND itab.
CLEAR itab.
ENDDO.
LOOP AT itab.
itab-field3 = itab-field1 + itab-field2.
MODIFY itab INDEX sy-tabix.
ENDLOOP.
x_fieldcat-fieldname = 'FIELD1'.
x_fieldcat-seltext_l = 'One'.
x_fieldcat-tabname = 'ITAB'.
x_fieldcat-col_pos = 1.
APPEND x_fieldcat TO it_fieldcat.
CLEAR x_fieldcat.
x_fieldcat-fieldname = 'FIELD2'.
x_fieldcat-seltext_l = 'Two'.
x_fieldcat-tabname = 'ITAB'.
x_fieldcat-col_pos = 2.
APPEND x_fieldcat TO it_fieldcat.
CLEAR x_fieldcat.
x_fieldcat-fieldname = 'FIELD3'.
x_fieldcat-seltext_l = 'Sum'.
x_fieldcat-tabname = 'ITAB'.
x_fieldcat-col_pos = 3.
APPEND x_fieldcat TO it_fieldcat.
CLEAR x_fieldcat.
<b>append '%PC' to it_exclude. "local files Removes the local file button..
append '&OUP' to it_exclude. "sort ascending
append '&ODN' to it_exclude. "sort descending
append '&ILT' to it_exclude. "set filter</b>
*find the function code for the button you want to exclude from the toolbar
*put cursor on the button and press F1 , you get the Function code and append it *in the above
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-repid
is_layout = l_layout
it_fieldcat = it_fieldcat
<b>IT_EXCLUDING = it_exclude</b>
TABLES
t_outtab = itab
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
rewards if helpful,
regards,
nazeer
‎2007 Jun 19 8:21 AM
This will surely work for 100 %
<b>
To exculde some the buttons from ALV just follow the steps below .</b>
Go to SE80 T-code
Select Package in first combo
give BALV_ADDON in secod combo give Enter.
u will get list below ..
From that list select PROGRAMS->R_ALV_LIST_TOOLBAR_MANAGER.
in that u can see on tool bar named STANDARD....
This is the standard one which ALV is useing ..
Just right click and select COPY ...
it will ask from pogram and to program ..
u give ur program name in to program
and ZSTANDARD for tool bar ...
Now u can go to u r program and edit that toolbar
i.e delete the buttons that u dont need ..
thanks
JK
‎2007 Jun 19 8:27 AM
HI,
I donno the reason for that , but you can remove the buttons from the toolbar..
Eg Program:
REPORT ZNAZSAM.
place tab on the function and press F1 to get the function code
TYPE-POOLS: slis.
DATA: x_fieldcat TYPE slis_fieldcat_alv,
it_fieldcat TYPE slis_t_fieldcat_alv,
l_layout TYPE slis_layout_alv.
data: IT_EXCLUDE TYPE SLIS_T_EXTAB.
DATA: BEGIN OF itab OCCURS 0,
field1 TYPE i,
field2 TYPE i,
field3 TYPE i,
END OF itab.
DO 20 TIMES.
itab-field1 = sy-index.
itab-field2 = sy-index + 1.
APPEND itab.
CLEAR itab.
ENDDO.
LOOP AT itab.
itab-field3 = itab-field1 + itab-field2.
MODIFY itab INDEX sy-tabix.
ENDLOOP.
x_fieldcat-fieldname = 'FIELD1'.
x_fieldcat-seltext_l = 'One'.
x_fieldcat-tabname = 'ITAB'.
x_fieldcat-col_pos = 1.
APPEND x_fieldcat TO it_fieldcat.
CLEAR x_fieldcat.
x_fieldcat-fieldname = 'FIELD2'.
x_fieldcat-seltext_l = 'Two'.
x_fieldcat-tabname = 'ITAB'.
x_fieldcat-col_pos = 2.
APPEND x_fieldcat TO it_fieldcat.
CLEAR x_fieldcat.
x_fieldcat-fieldname = 'FIELD3'.
x_fieldcat-seltext_l = 'Sum'.
x_fieldcat-tabname = 'ITAB'.
x_fieldcat-col_pos = 3.
APPEND x_fieldcat TO it_fieldcat.
CLEAR x_fieldcat.
<b>append '%PC' to it_exclude. "local files Removes the local file button..
append '&OUP' to it_exclude. "sort ascending
append '&ODN' to it_exclude. "sort descending
append '&ILT' to it_exclude. "set filter</b>
*find the function code for the button you want to exclude from the toolbar
*put cursor on the button and press F1 , you get the Function code and append it *in the above
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-repid
is_layout = l_layout
it_fieldcat = it_fieldcat
<b>IT_EXCLUDING = it_exclude</b>
TABLES
t_outtab = itab
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
rewards if helpful,
regards,
nazeer
‎2007 Jun 19 8:35 AM
hi nidhi,
just in FM 'REUSE_ALV_GRID_DISPLAY'
set expot parameter i_save = 'A'.
hope this will help u...
please reward in case usefull....
regards,
prashant