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

Get all the function button in SET_TABLE_FOR_FIRST_DISPLAY

Former Member
0 Likes
1,042

Hi Guys,

I've used the the method SET_TABLE_FOR_FIRST_DISPLAY to display my ALV. Unfortunately, icons like TOTAL, FILTER..... that are availble in SET_TABLE_FOR_FIRST_DISPLAY is not working. Kindly please provide me answer why the icons are not working. Below is my code. Did I miss something? Helpful advise will be rewarded. Thanks!!


CREATE OBJECT CC_OBJ
    EXPORTING
*      PARENT                      =
      CONTAINER_NAME              = 'CC_OBJ'
*      STYLE                       =
*      LIFETIME                    = lifetime_default
*      REPID                       =
*      DYNNR                       =
*      NO_AUTODEF_PROGID_DYNNR     =
    EXCEPTIONS
      CNTL_ERROR                  = 1
      CNTL_SYSTEM_ERROR           = 2
      CREATE_ERROR                = 3
      LIFETIME_ERROR              = 4
      LIFETIME_DYNPRO_DYNPRO_LINK = 5
      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 OBJECT OBJ_ALV_GRID
    EXPORTING
*      I_SHELLSTYLE      = 0
*      I_LIFETIME        =
      I_PARENT          = CC_OBJ
*      I_APPL_EVENTS     = space
*      I_PARENTDBG       =
*      I_APPLOGPARENT    =
*      I_GRAPHICSPARENT  =
*      I_NAME            =
*      I_FCAT_COMPLETE   = SPACE
    EXCEPTIONS
      ERROR_CNTL_CREATE = 1
      ERROR_CNTL_INIT   = 2
      ERROR_CNTL_LINK   = 3
      ERROR_DP_CREATE   = 4
      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.

* CALLING THE CREATED INSTANCE TO METHOD
  CALL METHOD OBJ_ALV_GRID->SET_TABLE_FOR_FIRST_DISPLAY
   EXPORTING
*    I_BUFFER_ACTIVE               =
*    I_BYPASSING_BUFFER            =
*    I_CONSISTENCY_CHECK           =
      I_STRUCTURE_NAME              = 'SFLIGHT'
*    IS_VARIANT                    =
*    I_SAVE                        =
*    I_DEFAULT                     = 'X'
*    IS_LAYOUT                     =
*    IS_PRINT                      =
*    IT_SPECIAL_GROUPS             =
*    IT_TOOLBAR_EXCLUDING          =
*    IT_HYPERLINK                  =
*    IT_ALV_GRAPHICS               =
*    IT_EXCEPT_QINFO               =
*    IR_SALV_ADAPTER               =
    CHANGING
      IT_OUTTAB                     = IT_SFLIGHT
*    IT_FIELDCATALOG               =
*    IT_SORT                       =
*    IT_FILTER                     =
  EXCEPTIONS
    INVALID_PARAMETER_COMBINATION = 1
    PROGRAM_ERROR                 = 2
    TOO_MANY_LINES                = 3
    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.


* FREE MEMORY FOR ALV GRID AND CLASS CL_GUI_CFW.
  CALL METHOD OBJ_ALV_GRID->FREE.
  CALL METHOD CL_GUI_CFW=>FLUSH.
  CALL SCREEN '0100'.

Regards,

Mark

3 REPLIES 3
Read only

Former Member
0 Likes
991

You will see the TOTAL button if your output internal table contain at least one value field, such as data type P.

Alternative you can implement the event handler for TOOLBAR event. BCALV_GRID_05 for your reference.

Edited by: Chris Xu on Nov 11, 2008 5:01 PM

Read only

Former Member
0 Likes
991

hi,

you have to configure the layout of the alv

data: layout type lvc_s_layo.

layout-no_toolbar = ' '.

pass the layout to the method set_table_for_first_display.

Read only

Former Member
0 Likes
991

Thanks for your reply but I got it by myself. Actually, It is automatic that the controls of the ALV is active. The only problem is my logic. Below should be done.


*CALL SCREEN '0100'.

CALL METHOD OBJ_ALV_GRID->FREE.
CALL METHOD CL_GUI_CFW=>FLUSH.*