2006 Aug 01 11:21 AM
I am trying to suppress the headers in an ALV grid by setting the parameter no_headers to 'X' in the layout structure and then passint this in the call to set_table_for_first_display. However the headers are still displayed.
Is there any trick to getting this parameter to be recognised?
2006 Aug 01 11:31 AM
Hi Michael,
This option is only used to suppress the headings. this works fine for me .... check this code...
IF CUSTOM_CONTAINER1 IS INITIAL.
SELECTING DATA FROM SFLIGHT.
PERFORM SELECT_TABLE_SFLIGHT CHANGING GT_SFLIGHT.
create a custom container control for our ALV Control
CREATE OBJECT CUSTOM_CONTAINER1
EXPORTING
CONTAINER_NAME = SALES_DOC_HEADER
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
CREATE_ERROR = 3
LIFETIME_ERROR = 4
LIFETIME_DYNPRO_DYNPRO_LINK = 5.
IF SY-SUBRC <> 0.
CALL FUNCTION 'POPUP_TO_INFORM'
EXPORTING
TITEL = G_REPID
TXT1 = SY-SUBRC
TXT2 = 'CONTROL COULD NOT BE CREATED'(510).
ENDIF.
CREATE OBJECT GRID1
EXPORTING I_PARENT = CUSTOM_CONTAINER1.
<b> GS_LAYOUT-GRID_TITLE = 'FLIGHTS'(100).
GS_LAYOUT-SEL_MODE = 'A'.
gs_layout-NO_HEADERS = 'X'.</b>
*call method EVENT_RECEIVER->call_handle_toolbar.
*call method grid1->set_toolbar.
<b>
CALL METHOD GRID1->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING I_STRUCTURE_NAME = 'SFLIGHT'
IS_LAYOUT = GS_LAYOUT
CHANGING IT_OUTTAB = GT_SFLIGHT.</b>
CREATE OBJECT EVENT_RECEIVER.
SET HANDLER EVENT_RECEIVER->HANDLE_TOOLBAR FOR GRID1.
SET HANDLER EVENT_RECEIVER->HANDLE_TOOLBAR FOR all instances.
SET HANDLER EVENT_RECEIVER->HANDLE_USER_COMMAND FOR GRID1.
CALL METHOD GRID1->SET_TOOLBAR_INTERACTIVE.
CALL METHOD CL_GUI_CONTROL=>SET_FOCUS EXPORTING CONTROL = GRID1.
ENDIF.
CALL METHOD CL_GUI_CONTROL=>SET_FOCUS EXPORTING CONTROL = GRID1.
Regards,
Vidya
2006 Aug 01 11:31 AM
Hi Michael,
This option is only used to suppress the headings. this works fine for me .... check this code...
IF CUSTOM_CONTAINER1 IS INITIAL.
SELECTING DATA FROM SFLIGHT.
PERFORM SELECT_TABLE_SFLIGHT CHANGING GT_SFLIGHT.
create a custom container control for our ALV Control
CREATE OBJECT CUSTOM_CONTAINER1
EXPORTING
CONTAINER_NAME = SALES_DOC_HEADER
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
CREATE_ERROR = 3
LIFETIME_ERROR = 4
LIFETIME_DYNPRO_DYNPRO_LINK = 5.
IF SY-SUBRC <> 0.
CALL FUNCTION 'POPUP_TO_INFORM'
EXPORTING
TITEL = G_REPID
TXT1 = SY-SUBRC
TXT2 = 'CONTROL COULD NOT BE CREATED'(510).
ENDIF.
CREATE OBJECT GRID1
EXPORTING I_PARENT = CUSTOM_CONTAINER1.
<b> GS_LAYOUT-GRID_TITLE = 'FLIGHTS'(100).
GS_LAYOUT-SEL_MODE = 'A'.
gs_layout-NO_HEADERS = 'X'.</b>
*call method EVENT_RECEIVER->call_handle_toolbar.
*call method grid1->set_toolbar.
<b>
CALL METHOD GRID1->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING I_STRUCTURE_NAME = 'SFLIGHT'
IS_LAYOUT = GS_LAYOUT
CHANGING IT_OUTTAB = GT_SFLIGHT.</b>
CREATE OBJECT EVENT_RECEIVER.
SET HANDLER EVENT_RECEIVER->HANDLE_TOOLBAR FOR GRID1.
SET HANDLER EVENT_RECEIVER->HANDLE_TOOLBAR FOR all instances.
SET HANDLER EVENT_RECEIVER->HANDLE_USER_COMMAND FOR GRID1.
CALL METHOD GRID1->SET_TOOLBAR_INTERACTIVE.
CALL METHOD CL_GUI_CONTROL=>SET_FOCUS EXPORTING CONTROL = GRID1.
ENDIF.
CALL METHOD CL_GUI_CONTROL=>SET_FOCUS EXPORTING CONTROL = GRID1.
Regards,
Vidya
2006 Aug 01 11:49 AM
Ok, It seems that the problem is around using the parameter is_variant. When passing a variant at the same time, the no_headers parameter appears to be ignored.
I would like to be able to pass a variant and also suppress the headers. Does anyone know if this is possible?
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |