Application Development and Automation 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: 
Read only

decrease titel bar in alv

Former Member
0 Likes
714

1)Hallow I doing a alv report with to 2 tables one is bigger then another and In the small table I wont to decrease the toolbar(I don’t wont icon that I don’t use) how can I do that because when I wont to deal with SET_TABLE_FOR_FIRST_DISPLAY I don’t have access key. What can I do ?

2) I have header for the 2 tables and I won't header for all the report I try with SET TITLEBAR 'TTT' but its not working what can I do to change this because in my header written sap thanks for your time

SET PF-STATUS 'MAIN100'.

SET TITLEBAR 'TTT'

IF g_custom_container IS INITIAL.

CREATE OBJECT g_custom_container

EXPORTING container_name = g_container.

CREATE OBJECT grid1

EXPORTING i_parent = g_custom_container.

gs_layout-grid_title = text-001.

CALL METHOD grid1->set_table_for_first_display

EXPORTING

i_structure_name = 'YHR_GET_EMP_COURSE_STR'

is_layout = gs_layout

is_variant = variant

i_save = 'A'

CHANGING

it_outtab = itab_final.

ENDIF.

IF g_custom_container1 IS INITIAL.

CREATE OBJECT g_custom_container1

EXPORTING container_name = g_container1.

CREATE OBJECT grid2

EXPORTING i_parent = g_custom_container1.

gs_layout-grid_title = text-002.

CALL METHOD grid1->set_table_for_first_display

EXPORTING

i_structure_name = 'YHR_GET_EMP_DONT_COURSE'

is_layout = gs_layout1

is_variant = variant1

i_save = 'A'

CHANGING

it_outtab = IT_FINAL.

ENDIF.

ENDMODULE. " PBO OUTPUT

4 REPLIES 4
Read only

Former Member
0 Likes
658

Hi Antonio,

Go to Menu painter (se41) - give Program name and your STATUS 'MAIN100'

- Change mode- Now delect the Icons which you don't want.

other way - Exclude the options in Application toolbar

wa_excluding-fcode = p_fcode." Give the focde for buttons u want to exclude

APPEND wa_excluding TO it_excluding.

CALL METHOD GR_ALVGRID->SET_TABLE_FOR_FIRST_DISPLAY

EXPORTING

<b>IT_TOOLBAR_EXCLUDING = it_excluding</b>

IS_LAYOUT = GS_LAYOUT

is_variant = variant

I_SAVE = 'A'

CHANGING

IT_FIELDCATALOG = GT_FIELDCAT

IT_OUTTAB = ITAB.

<b>Refer std programs:</b>

BCALV_TEST_FUNCTIONS

BCALV_TEST_GRID_TOOLBAR

Also check this link:

Suggest you to Search in <b>SDN with key - EXCLUDE</b>

Will get few more useful related Posts.

Reward points if this Helps.

Manish

Read only

uwe_schieferstein
Active Contributor
0 Likes
658

Hello Antonio

If you want to have individual titles for your ALV lists then you can use method <b>go_grid->set_gridtitle</b>. If you set<b> gs_layout-smalltitle = 'X'</b> then the grid title (displayed between toolbar and grid) is small otherwise large.

Regards

Uwe

Read only

0 Likes
658

hi uwe sorry for the delay mybe u can give me example from program how to use it thankes

& regards

Read only

uwe_schieferstein
Active Contributor
0 Likes
658

Hello Antonio

Here is a sample report. Simply search for <b>SET_GRIDTITLE</b> and <b>SMALLTITLE</b>.

*&---------------------------------------------------------------------*
*& Report  ZUS_SDN_TWO_ALV_GRIDS_1
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  ZUS_SDN_TWO_ALV_GRIDS_1.




DATA:
  gd_okcode        TYPE ui_func,
*
  go_docking       TYPE REF TO cl_gui_docking_container,
  go_splitter      TYPE REF TO cl_gui_splitter_container,
  go_cell_top      TYPE REF TO cl_gui_container,
  go_cell_bottom   TYPE REF TO cl_gui_container,
  go_grid1         TYPE REF TO cl_gui_alv_grid,
  go_grid2         TYPE REF TO cl_gui_alv_grid.


data:
  gs_layout1       type lvc_s_layo,
  gs_layout2       type lvc_s_layo.

DATA:
  gt_knb1          TYPE STANDARD TABLE OF knb1,
  gt_knvv          TYPE STANDARD TABLE OF knvv.





*---------------------------------------------------------------------*
*       CLASS lcl_eventhandler DEFINITION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
CLASS lcl_eventhandler DEFINITION.

  PUBLIC SECTION.
    CLASS-METHODS:
      handle_double_click FOR EVENT double_click OF cl_gui_alv_grid
        IMPORTING
          e_row
          e_column
          es_row_no
          sender.


ENDCLASS.                    "lcl_eventhandler DEFINITION



*---------------------------------------------------------------------*
*       CLASS lcl_eventhandler IMPLEMENTATION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
CLASS lcl_eventhandler IMPLEMENTATION.

  METHOD handle_double_click.
*   define local data
    DATA:
      ls_knb1      TYPE knb1.

    CHECK ( sender = go_grid1 ).

    READ TABLE gt_knb1 INTO ls_knb1 INDEX e_row-index.
    CHECK ( ls_knb1-kunnr IS NOT INITIAL ).

    CALL METHOD go_grid1->set_current_cell_via_id
      EXPORTING
*        IS_ROW_ID    =
*        IS_COLUMN_ID =
        is_row_no    = es_row_no.


*   Triggers PAI of the dynpro with the specified ok-code
    CALL METHOD cl_gui_cfw=>set_new_ok_code( 'DETAIL' ).



  ENDMETHOD.                    "handle_double_click

ENDCLASS.                    "lcl_eventhandler IMPLEMENTATION






START-OF-SELECTION.

  SELECT        * FROM  knb1 INTO TABLE gt_knb1
         WHERE  bukrs  = '1000'.


* Create docking container
  CREATE OBJECT go_docking
    EXPORTING
      parent                      = cl_gui_container=>screen0
      ratio                       = 90
    EXCEPTIONS
      OTHERS                      = 6.
  IF sy-subrc <> 0.
*   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.


* Create splitter container
  CREATE OBJECT go_splitter
    EXPORTING
      parent            = go_docking
      rows              = 2
      columns           = 1
*      NO_AUTODEF_PROGID_DYNNR =
*      NAME              =
    EXCEPTIONS
      cntl_error        = 1
      cntl_system_error = 2
      OTHERS            = 3.
  IF sy-subrc <> 0.
*   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

* Get cell container
  CALL METHOD go_splitter->get_container
    EXPORTING
      row       = 1
      column    = 1
    RECEIVING
      container = go_cell_top.
  CALL METHOD go_splitter->get_container
    EXPORTING
      row       = 2
      column    = 1
    RECEIVING
      container = go_cell_bottom.

* Create ALV grids
  CREATE OBJECT go_grid1
    EXPORTING
      i_parent          = go_cell_top
    EXCEPTIONS
      OTHERS            = 5.
  IF sy-subrc <> 0.
*   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.


* Set event handler
  SET HANDLER: lcl_eventhandler=>handle_double_click FOR go_grid1.


  CREATE OBJECT go_grid2
    EXPORTING
      i_parent          = go_cell_bottom
    EXCEPTIONS
      OTHERS            = 5.
  IF sy-subrc <> 0.
*   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.



  perform SET_LAYOUT_AND_VARIANT.




* Display data
  CALL METHOD go_grid1->set_table_for_first_display
    EXPORTING
      i_structure_name = 'KNB1'
      is_layout        = gs_layout1
    CHANGING
      it_outtab        = gt_knb1
    EXCEPTIONS
      OTHERS           = 4.
  IF sy-subrc <> 0.
*   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

  CALL METHOD go_grid2->set_table_for_first_display
    EXPORTING
      i_structure_name = 'KNVV'
      is_layout        = gs_layout2
    CHANGING
      it_outtab        = gt_knvv  " empty !!!
    EXCEPTIONS
      OTHERS           = 4.
  IF sy-subrc <> 0.
*   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.


  CALL METHOD go_grid1->set_gridtitle
    EXPORTING
      i_gridtitle = '1st grid: small title'.
  CALL METHOD go_grid2->set_gridtitle
    EXPORTING
      i_gridtitle = '2st grid: LARGE Title'.


* Link the docking container to the target dynpro
  CALL METHOD go_docking->link
    EXPORTING
      repid                       = syst-repid
      dynnr                       = '0100'
*      CONTAINER                   =
    EXCEPTIONS
      OTHERS                      = 4.
  IF sy-subrc <> 0.
*   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.


* NOTE: dynpro does not contain any elements
  CALL SCREEN '0100'.
* Flow logic of dynpro (does not contain any dynpro elements):
*
*PROCESS BEFORE OUTPUT.
*  MODULE STATUS_0100.
**
*PROCESS AFTER INPUT.
*  MODULE USER_COMMAND_0100.



END-OF-SELECTION.

*&---------------------------------------------------------------------*
*&      Module  STATUS_0100  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE status_0100 OUTPUT.
  SET PF-STATUS 'STATUS_0100'.  " contains push button "DETAIL"
*  SET TITLEBAR 'xxx'.


* Refresh display of detail ALV list
  CALL METHOD go_grid2->refresh_table_display
*    EXPORTING
*      IS_STABLE      =
*      I_SOFT_REFRESH =
    EXCEPTIONS
      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.


ENDMODULE.                 " STATUS_0100  OUTPUT

*&---------------------------------------------------------------------*
*&      Module  USER_COMMAND_0100  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE user_command_0100 INPUT.

  CASE gd_okcode.
    WHEN 'BACK' OR
         'END'  OR
         'CANC'.
      SET SCREEN 0. LEAVE SCREEN.

*   User has pushed button "Display Details"
    WHEN 'DETAIL'.
      PERFORM entry_show_details.

    WHEN OTHERS.
  ENDCASE.

  CLEAR: gd_okcode.

ENDMODULE.                 " USER_COMMAND_0100  INPUT

*&---------------------------------------------------------------------*
*&      Form  ENTRY_SHOW_DETAILS
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM entry_show_details .
* define local data
  DATA:
    ld_row      TYPE i,
    ls_knb1     TYPE knb1.

  CALL METHOD go_grid1->get_current_cell
    IMPORTING
      e_row = ld_row.

  READ TABLE gt_knb1 INTO ls_knb1 INDEX ld_row.
  CHECK ( syst-subrc = 0 ).

  SELECT        * FROM  knvv INTO TABLE gt_knvv
         WHERE  kunnr  = ls_knb1-kunnr.



ENDFORM.                    " ENTRY_SHOW_DETAILS


*&---------------------------------------------------------------------*
*&      Form  SET_LAYOUT_AND_VARIANT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
form SET_LAYOUT_AND_VARIANT .

  gs_layout1-smalltitle = abap_true.   " small grid title
  gs_layout2-smalltitle = abap_false.  " large grid title

endform.                    " SET_LAYOUT_AND_VARIANT

Regards

Uwe