07-08-2009 9:41 AM
Hi,
I am changing a stnadard report program.
Its displying output as ALV list display. As per stnadard program its having 4 push buttons in the report out.
I have to remove those and display the 'Change Layout' button in the output.
I have deleted the push buttons, but i am not able to get the button of 'Change Layout'.
Please provide the reason or logic.
Thanks in Advance.
07-08-2009 9:55 AM
Hi,
Use the exclude parameter in the FM.
Append the function code for the buttons you want to remove and the pass this internal table.
*FOR EXCLUDING STANDARD BUTTON FROM ALV TOOLBAR
DATA : it_exclude TYPE slis_t_extab,
wa_exclude TYPE slis_extab.
*&---------------------------------------------------------------------*
* FOR EXCLUDING STANDARD BUTTONS FROM ALV TOOLBAR
*&---------------------------------------------------------------------*
wa_exclude-fcode = '&OUP'.
APPEND wa_exclude TO it_exclude.
CLEAR wa_exclude.
wa_exclude-fcode = '&ODN'.
APPEND wa_exclude TO it_exclude.
CLEAR wa_exclude.
wa_exclude-fcode = '&OAD'.
APPEND wa_exclude TO it_exclude.
CLEAR wa_exclude.
wa_exclude-fcode = '&INFO'.
APPEND wa_exclude TO it_exclude.
CLEAR wa_exclude.
"similarly append more function codes for standard buttons that needs to be excluded
"you can get to know the func code for the button by enabling debugging at run time
"and check valus for sy-ucomm and append it to it_exclude
*&---------------------------------------------------------------------*
* DISPLAY RECORDS IN ALV GRID
*&---------------------------------------------------------------------*
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
it_fieldcat = it_field
it_excluding = it_exclude
TABLES
t_outtab = it_final
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
ENDIF.
Hope this helps you.
Regards,
Tarun
07-08-2009 9:46 AM
Hi Anil,
Please check the layout structure you are passing correctly or not??
Because the change layout willl be associated with the layout strucutre.
check whether u r passing all the detials correctly tot he FM.
If u r using classes let me know.
Please revert incase of further help.
Regads
Abhilash.
07-08-2009 9:55 AM
Hi,
Use the exclude parameter in the FM.
Append the function code for the buttons you want to remove and the pass this internal table.
*FOR EXCLUDING STANDARD BUTTON FROM ALV TOOLBAR
DATA : it_exclude TYPE slis_t_extab,
wa_exclude TYPE slis_extab.
*&---------------------------------------------------------------------*
* FOR EXCLUDING STANDARD BUTTONS FROM ALV TOOLBAR
*&---------------------------------------------------------------------*
wa_exclude-fcode = '&OUP'.
APPEND wa_exclude TO it_exclude.
CLEAR wa_exclude.
wa_exclude-fcode = '&ODN'.
APPEND wa_exclude TO it_exclude.
CLEAR wa_exclude.
wa_exclude-fcode = '&OAD'.
APPEND wa_exclude TO it_exclude.
CLEAR wa_exclude.
wa_exclude-fcode = '&INFO'.
APPEND wa_exclude TO it_exclude.
CLEAR wa_exclude.
"similarly append more function codes for standard buttons that needs to be excluded
"you can get to know the func code for the button by enabling debugging at run time
"and check valus for sy-ucomm and append it to it_exclude
*&---------------------------------------------------------------------*
* DISPLAY RECORDS IN ALV GRID
*&---------------------------------------------------------------------*
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
it_fieldcat = it_field
it_excluding = it_exclude
TABLES
t_outtab = it_final
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
ENDIF.
Hope this helps you.
Regards,
Tarun
07-08-2009 10:12 AM
07-08-2009 10:45 AM
Hi,
I want to use the same logic for Hierachical ALV.
But it is not working for that.
Can you plz help in this regard.
thanks in Advance