Checkbox event in REUSE_ALV_GRID_DISPLAY

Hi,
I have a report using REUSE_ALV_GRID_DISPLAY that a check box.. In the ALV have two quantity fields that have values not equal. then while user click on the checkbox i need to give message that quantity is not equal.
I need to give message once user click on the checkbox itself.
Please don't suggest that while saving the ALV we can give message use PF_STATUS_CALLBACK PROGRAM
Sa_R

Hi,
&ic1 is event code for doubleclick or click when we use hotspot
We can use it in ALV Program.
Check the follwing program
in this i used WHEN '&IC1'.
REPORT zs5.
TABLES:t001w, " plants / branches
mard. " Storage Location data for material
marc. " plant data for material
TYPE-POOLS:slis.
SELECT-OPTIONS:s_werks FOR mard-werks. "plant
DATA:BEGIN OF it_mard OCCURS 0,
werks LIKE mard-werks, " plant
matnr LIKE mard-matnr, " material number
lgort LIKE mard-lgort, " storage location
END OF it_mard.
DATA:BEGIN OF it_t001w OCCURS 0,
werks LIKE t001w-werks, "plant
name1 LIKE t001w-name1, "name
ort01 LIKE t001w-ort01, "city
END OF it_t001w.
DATA: temp_werks(4) TYPE c.
DATA: it_listheader TYPE slis_t_listheader .
DATA: hline TYPE slis_listheader.
DATA: it_fieldcat TYPE slis_t_fieldcat_alv,
wa_fieldcat TYPE slis_fieldcat_alv.
DATA: it_fieldcat1 TYPE slis_t_fieldcat_alv,
wa_fieldcat1 TYPE slis_fieldcat_alv.
DATA: it_events TYPE slis_t_event,
wa_event TYPE slis_alv_event.
DATA: wa_layout TYPE slis_layout_alv.
START-OF-SELECTION.
PERFORM get_data_from_mard.
PERFORM populate_alv.
*& Form get_data_from_mard
FORM get_data_from_mard .
SELECT werks
matnr
lgort
FROM mard INTO TABLE it_mard WHERE werks IN s_werks.
ENDFORM. " get_data_from_mard
*& Form populate_alv
FORM populate_alv .
PERFORM populate_fieldcat.
PERFORM event_call.
PERFORM populate_event.
PERFORM build_listheader USING it_listheader.
PERFORM call_alv_grid_display.
ENDFORM. " populate_alv
*& Form populate_fieldcat
FORM populate_fieldcat .
wa_fieldcat-col_pos = 1.
wa_fieldcat-icon = 'X'.
wa_fieldcat-fieldname = 'WERKS'.
wa_fieldcat-seltext_l = 'plant'.
APPEND wa_fieldcat TO it_fieldcat.
wa_fieldcat-col_pos = 2.
wa_fieldcat-fieldname = 'MATNR'.
wa_fieldcat-seltext_l = 'Material no'.
APPEND wa_fieldcat TO it_fieldcat.
wa_fieldcat-col_pos = 3.
wa_fieldcat-fieldname = 'LGORT'.
wa_fieldcat-seltext_l = 'Storage location'.
APPEND wa_fieldcat TO it_fieldcat.
wa_layout-zebra = 'X'.
wa_layout-colwidth_optimize = 'X'.
ENDFORM. " populate_fieldcat
*& Form event_call
FORM event_call .
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = it_events
EXCEPTIONS
list_type_wrong = 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.
ENDFORM. " event_call
*& Form populate_event
FORM populate_event .
READ TABLE it_events INTO wa_event WITH KEY name = 'TOP_OF_PAGE'.
IF sy-subrc EQ 0.
wa_event-form = 'TOP_OF_PAGE'.
MODIFY it_events FROM wa_event TRANSPORTING form WHERE name =
wa_event-form.
ENDIF.
READ TABLE it_events INTO wa_event WITH KEY name = 'USER_COMMAND'.
IF sy-subrc EQ 0.
wa_event-form = 'USER_COMMAND'.
MODIFY it_events FROM wa_event TRANSPORTING form WHERE name =
wa_event-name.
ENDIF.
ENDFORM. " populate_event
*& Form build_listheader
FORM build_listheader USING p_it_listheader.
hline-info = 'PRIMARY LIST'.
hline-typ = 'H'.
APPEND hline TO it_listheader.
ENDFORM. " build_listheader
*& Form top-of-page
FORM top-of-page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = it_listheader.
ENDFORM. "top-of-page
*& Form call_alv_grid_display
FORM call_alv_grid_display .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_user_command = 'USER_COMMAND'
i_callback_top_of_page = 'TOP-OF_PAGE'
i_grid_title = 'FIRST LIST'
is_layout = wa_layout
it_fieldcat = it_fieldcat
it_events = it_events
TABLES
t_outtab = it_mard
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.
ENDFORM. " call_alv_grid_display
*& Form user_command
FORM user_command USING r_ucomm TYPE sy-ucomm rs_selfield TYPE slis_selfield.
CASE r_ucomm.
WHEN '&IC1'.
IF rs_selfield-fieldname = 'WERKS'.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = rs_selfield-value
IMPORTING
output = temp_werks.
temp_werks = rs_selfield-value.
PERFORM get_data_t001w.
PERFORM populate_fieldcat_t001w.
PERFORM event_call_t001w.
PERFORM populate_event_t001w.
PERFORM build_listheader_t001w USING it_listheader.
PERFORM alv_grid_display_t001w.
ENDIF.
ENDCASE.
ENDFORM. " user_command
*& Form get_data_t001w
FORM get_data_t001w .
SELECT werks
name1
ort01
FROM t001w INTO TABLE it_t001w WHERE werks = temp_werks.
ENDFORM. " get_data_t001w
*& Form populate_fieldcat_t001w
FORM populate_fieldcat_t001w .
wa_fieldcat1-col_pos = 1.
wa_fieldcat1-icon = 'X'.
wa_fieldcat1-fieldname = 'WERKS'.
wa_fieldcat1-seltext_l = 'plant'.
APPEND wa_fieldcat1 TO it_fieldcat1.
wa_fieldcat1-col_pos = 2.
wa_fieldcat1-fieldname = 'NAME1'.
wa_fieldcat1-seltext_l = 'Name'.
APPEND wa_fieldcat1 TO it_fieldcat1.
wa_fieldcat1-col_pos = 3.
wa_fieldcat1-fieldname = 'ORT01'.
wa_fieldcat1-seltext_l = 'City'.
APPEND wa_fieldcat1 TO it_fieldcat1.
wa_layout-zebra = 'X'.
wa_layout-colwidth_optimize = 'X'.
ENDFORM. " populate_fieldcat_t001w
*& Form event_call_t001w
text
--> p1 text
<-- p2 text
FORM event_call_t001w .
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = it_events
EXCEPTIONS
list_type_wrong = 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.
ENDFORM. " event_call_t001w
*& Form populate_event_t001w
FORM populate_event_t001w .
READ TABLE it_events INTO wa_event WITH KEY name = 'TOP_OF_PAGE'.
IF sy-subrc EQ 0.
wa_event-form = 'TOP_OF_PAGE'.
MODIFY it_events FROM wa_event TRANSPORTING form WHERE name = wa_event-form.
ENDIF.
ENDFORM. " populate_event_t001w
*& Form build_listheader
FORM build_listheader_t001w USING p_it_listheader.
hline-info = 'SECONDARY LIST'.
hline-typ = 'H'.
APPEND hline TO it_listheader.
ENDFORM. " build_listheader
*& Form top-of-page_t001w
FORM top-of-page_t001w.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = it_listheader.
ENDFORM. "top-of-page_t001w
*& Form alv_grid_display_t001w
FORM alv_grid_display_t001w .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_top_of_page = 'TOP_OF_PAGE'
i_grid_title = 'SECONDARY LIST'
is_layout = wa_layout
it_fieldcat = it_fieldcat1
it_events = it_events
TABLES
t_outtab = it_t001w
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.
ENDFORM. " alv_grid_display_t001w
<b>Reward if helpful.</b>

Similar Messages

  • How to use the ONF4 event in REUSE_ALV_GRID_DISPLAY?

    I am able to use the methods for BUTTON_CLICK and HOTSPOT_CLICK for a report that outputs ALV Grid using REUSE_ALV_GRID_DISPLAY.
    But I am not able to trigger the ONF4 event.
    How to enable this?
    Thanks,

    hi look at the code ...may be helpful for u..
    TYPE-POOLS SLIS.
    DATA: BEGIN OF T_OUT_FOR_F4 OCCURS 0,
            BUKRS LIKE T001-BUKRS,
            BUTXT LIKE T001-BUTXT,
          END   OF T_OUT_FOR_F4.
    PARAMETERS: P_BUKRS TYPE BUKRS.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_BUKRS.
      PERFORM F4_FOR_BUKRS.
    *&      Form  F4_FOR_BUKRS
          text
    -->  p1        text
    <--  p2        text
    FORM F4_FOR_BUKRS.
      DATA: IT_FIELDCAT TYPE  SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
            IT_REPORT   TYPE  SY-REPID,
            ES_SELFIELD TYPE  SLIS_SELFIELD.
    Get data
      SELECT BUKRS BUTXT FROM T001 INTO TABLE T_OUT_FOR_F4
      WHERE BUKRS = '0001' OR BUKRS = 'US01'.
    Get field
      IT_REPORT = SY-REPID.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
           EXPORTING
                I_PROGRAM_NAME     = IT_REPORT
                I_INTERNAL_TABNAME = 'T_OUT_FOR_F4'
                I_INCLNAME         = IT_REPORT
           CHANGING
                CT_FIELDCAT        = IT_FIELDCAT[].
      LOOP AT IT_FIELDCAT.
        IT_FIELDCAT-KEY = SPACE.
        IF IT_FIELDCAT-FIELDNAME = 'BUTXT'.
          IT_FIELDCAT-KEY = 'X'.
        ENDIF.
        MODIFY IT_FIELDCAT.
      ENDLOOP.
      CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
        EXPORTING
        I_TITLE                       =
        I_SELECTION                   = 'X'
        I_ZEBRA                       = ' '
        I_SCREEN_START_COLUMN         = 0
        I_SCREEN_START_LINE           = 0
        I_SCREEN_END_COLUMN           = 0
        I_SCREEN_END_LINE             = 0
        I_CHECKBOX_FIELDNAME          =
        I_LINEMARK_FIELDNAME          =
        I_SCROLL_TO_SEL_LINE          = 'X'
          I_TABNAME                     = 'T_OUT_FOR_F4'
        I_STRUCTURE_NAME              =
          IT_FIELDCAT                   = IT_FIELDCAT[]
        IT_EXCLUDING                  =
        I_CALLBACK_PROGRAM            =
        I_CALLBACK_USER_COMMAND       =
        IS_PRIVATE                    =
        IMPORTING
          ES_SELFIELD                   = ES_SELFIELD
        E_EXIT                        =
        TABLES
          T_OUTTAB                      = T_OUT_FOR_F4
       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.
      ELSE.
        READ TABLE T_OUT_FOR_F4 INDEX ES_SELFIELD-TABINDEX.
        P_BUKRS = T_OUT_FOR_F4-BUKRS.
      ENDIF.
    ENDFORM.                    " F4_FOR_BUKRS

  • Events with REUSE_ALV_GRID_DISPLAY

    Hi, I would like to insert a "top of list" and  "end of list" into an ALV GRID, is it possible? the problem is that the top is too big so we need to show it just in the first page and in the same time we need that an end of list should be showed.
    Here we send our code, when we use the ALV List Works ok but with the ALV GRID, doesn't. It show us the end of list as a top of list and the top of list disapears.
    perform event_form.
    perform stampa_dati.
    *&      Form  event_form
    form event_form.
    Imposta evento TOP_OF_PAGE e routine in cui viene gestito
      ls_event-name = slis_ev_top_of_page.
      ls_event-form = 'TESTATA_ALV'.
      append ls_event to event_tab.
      clear ls_event.
    Imposta evento TOP_OF_LIST e routine in cui viene gestito
    ls_event-name = slis_ev_top_of_list.
    ls_event-form = 'XTOP_OF_LIST'.
      ls_event-name = slis_ev_end_of_list .
      ls_event-form = 'XEND_OF_LIST'.
      append ls_event to event_tab.
      clear ls_event .
    endform.                    " event_form
    *&      Form  stampa_dati
          text
    -->  p1        text
    <--  p2        text
    form stampa_dati.
    Messa a video dati con function-module
      data: w_callback like sy-repid.
      w_callback = sy-repid.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    call function 'REUSE_ALV_GRID_DISPLAY'
    exporting
      I_INTERFACE_CHECK              = ' '
      I_BYPASSING_BUFFER             =
      I_BUFFER_ACTIVE                = ' '
    i_callback_program             = w_callback
    --------------" attivare se si vuole gestire una gui custom
        i_callback_pf_status_set       = 'MIO_STATO'
    i_callback_user_command        = 'USER_COMMAND'
    i_structure_name               = 'ZZPFIT00032'
    i_background_id                = ' '
    is_layout                      = layout
    it_fieldcat                    = tb_fieldcat[]
      IT_EXCLUDING                   =
      IT_SPECIAL_GROUPS              =
    it_sort                        = tb_u_sort[]
      IT_FILTER                      =
      IS_SEL_HIDE                    =
    i_default                = 'X'
    i_save                   = 'A'
        is_variant               = variante
          is_variant               = 'X'
    it_events                = event_tab[]
      IT_EVENT_EXIT                  =
      IS_PRINT                       =
      IS_REPREP_ID                   =
      I_SCREEN_START_COLUMN           = 1
      I_SCREEN_START_LINE            = 1
       I_SCREEN_END_COLUMN            = 64
      I_SCREEN_END_LINE              = 20
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER        =
      ES_EXIT_CAUSED_BY_USER         =
    tables
    t_outtab                       = tb_print_esec
    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.
    endform.                    " stampa_dati
    *&      Form  testata_alv
          text
    -->  p1        text
    <--  p2        text
    form testata_alv.
      if p_spool is initial.
        exit.
      endif.
      data: w_datum    like bapi_field-date.
      data: w_uzeit(8) type c .
    data : tb_ls_line type zzpbct00007  occurs 0 with header line.
    data : tb_ls_line_sel type zzpbct00007  occurs 0 with header line.
      data: ls_line type slis_listheader.
      refresh tb_list_top_of_page.
      clear ls_line.
      write sy-datum to w_datum dd/mm/yyyy.
      write sy-uzeit to w_uzeit using edit mask '__:__:__'.
    inserisco data
      ls_line-typ  = 'S'.
      ls_line-key  = text-007 .
      ls_line-info = w_datum.
      append ls_line to tb_list_top_of_page.
    inserisco ora
      ls_line-typ  = 'S'.
      ls_line-key  = text-008 .
      ls_line-info = w_uzeit.
      append ls_line to tb_list_top_of_page.
    ***List body comment block output
      call function 'REUSE_ALV_COMMENTARY_WRITE'
           exporting
               i_logo             = 'PMMN_LOGO'
                it_list_commentary = tb_list_top_of_page.
    endform.                    " testata_alv
    *&      Form  XEND_OF_LIST
          text
    -->  p1        text
    <--  p2        text
    form xend_of_list.
      if p_spool is initial.
        exit.
      endif.
      data: w_datum    like bapi_field-date.
      data: w_uzeit(8) type c .
      data :  vl_count(10)   type n.
      data: ls_line type slis_listheader.
    data tb_list_top_of_page type slis_t_listheader.
      data : tb_ls_line_sel type zzpbct00007  occurs 0 with header line.
      refresh tb_list_top_of_page .
      move tb_list_top_of_page[] to tb_ls_line_sel[] .
      move sy-repid to w_report.
      move sy-slset to w_variant .
      perform variante changing w_variant.
    inserisco nome variante
      ls_line-typ  = 'S'.
      ls_line-key  = text-009 .
      ls_line-info = w_variant .
      append ls_line to tb_ls_line_sel .
    inserisco dati da select-options e parameter
      call function 'ZZPBCF00007'
           exporting
                i_report    = w_report
                i_varian    = w_variant
           tables
                io_tab_line = tb_ls_line_sel[].
      move tb_ls_line_sel[] to tb_list_top_of_page[] .
    Inserisco contatore
      clear ls_line.
      ls_line-typ  = 'A'.
      vl_count = vg_contatore.
    Funzione creata per quando i contatori sono iguali a zero.
      perform performance_contatori using text-002
                                          vl_count
                                    changing ls_line-info.
      append ls_line to tb_list_top_of_page.
    **List body comment block output
      call function 'REUSE_ALV_COMMENTARY_WRITE'
           exporting
               i_logo             = 'PMMN_LOGO'
                it_list_commentary =  tb_list_top_of_page .
    endform.                    " XEND_OF_LIST
    Thank you for your help !
    Claudia & Jessica.

    Hi
    it is possible in following way.......
    REPORT  ZALV1.
    ******************TABLE DECLARATION***********************************
    TABLES : VBAP.                    " tables declaration
    *****************TYPE POOLS*******************************************
    TYPE-POOLS : SLIS.                " slis type pool
    *****************INTERNAL TABLE DECLARATION***************************
    DATA : BEGIN OF IT_VBAP OCCURS 0,
    " internal table for sales document item
          VBELN LIKE VBAP-VBELN,      " sales document
          POSNR LIKE VBAP-POSNR,      " document item
          ERNAM LIKE VBAP-ERNAM,
          " name of the person who created the object
          ERDAT LIKE VBAP-ERDAT,      " date on which the record was created
          MATNR LIKE VBAP-MATNR.      " material number
    DATA : END OF IT_VBAP.
    DATA : BEGIN OF IT_MARA OCCURS 0, " general material data
           MATNR LIKE MARA-MATNR,     " material number
           ERNAM LIKE MARA-ERNAM,
           " name of the person who created the object
           MATKL LIKE MARA-MATKL,     " material group
           MEINS LIKE MARA-MEINS,     " base unit of measure
           PSTAT LIKE MARA-PSTAT.     " maintainence status
    DATA : END OF IT_MARA.
    ******************VARIABLE
    DECLARATION**********************************
    DATA : REPID LIKE SY-REPID.       " program name
    DATA : IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
    " field catalog table for vbap
           WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
    DATA : IT_FIELDCAT1 TYPE SLIS_T_FIELDCAT_ALV,
    " field catalog table for mara
           WA_FIELDCAT1 TYPE SLIS_FIELDCAT_ALV.
    DATA : WA_LAYOUT TYPE SLIS_LAYOUT_ALV.
    DATA: GT_XEVENTS TYPE SLIS_T_EVENT.
    DATA: GT_YEVENTS TYPE SLIS_T_EVENT.            " events table
    DATA : XS_EVENT  TYPE SLIS_ALV_EVENT.          " events type
    DATA : GT_PRINT TYPE SLIS_PRINT_ALV.           " print table
    *******************MULTIPLE SELECT INPUT
    PARAMETERS**********************
    SELECT-OPTIONS : S_VBELN FOR VBAP-VBELN.
    " multiple selection for sales document
    ******************INITIALIZATION**************************************
    INITIALIZATION.
      REPID = SY-REPID.
    *******************START OF
    SELECTION************************************
    START-OF-SELECTION.
      PERFORM POP_VBAP.
      " populating the table with document item data
      PERFORM POP_MARA.
      " populating the table with general material data
      PERFORM FIELD_CAT.
      " mapping the fields for the field catalog
      PERFORM EVENTS.                      " using the events
      PERFORM BLOCK_LIST.
      " displaying the data in blocked list
    *&      Form  field_cat
          text
    -->  p1        text
    <--  p2        text
    FORM FIELD_CAT .
      WA_FIELDCAT-FIELDNAME = 'VBELN'.
      WA_FIELDCAT-TABNAME = 'IT_VBAP'.
      WA_FIELDCAT-SELTEXT_L = 'SALES DOC'.
      WA_FIELDCAT-COL_POS = 1.
      WA_FIELDCAT-OUTPUTLEN = 10.
      APPEND WA_FIELDCAT TO IT_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-FIELDNAME = 'POSNR'.
      WA_FIELDCAT-TABNAME = 'IT_VBAP'.
      WA_FIELDCAT-SELTEXT_L = 'DOC ITEM'.
      WA_FIELDCAT-COL_POS = 2.
      WA_FIELDCAT-OUTPUTLEN = 6.
      APPEND WA_FIELDCAT TO IT_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-FIELDNAME = 'ERNAM'.
      WA_FIELDCAT-TABNAME = 'IT_VBAP'.
      WA_FIELDCAT-SELTEXT_L = 'NAME'.
      WA_FIELDCAT-COL_POS = 3.
      WA_FIELDCAT-OUTPUTLEN = 12.
      APPEND WA_FIELDCAT TO IT_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-FIELDNAME = 'ERDAT'.
      WA_FIELDCAT-TABNAME = 'IT_VBAP'.
      WA_FIELDCAT-SELTEXT_L = 'DATE'.
      WA_FIELDCAT-COL_POS = 4.
      WA_FIELDCAT-OUTPUTLEN = 8.
      APPEND WA_FIELDCAT TO IT_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-FIELDNAME = 'MATNR'.
      WA_FIELDCAT-TABNAME = 'IT_VBAP'.
      WA_FIELDCAT-SELTEXT_L = 'MAT NO'.
      WA_FIELDCAT-COL_POS = 5.
      WA_FIELDCAT-OUTPUTLEN = 18.
      APPEND WA_FIELDCAT TO IT_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT1-FIELDNAME = 'MATNR'.
      WA_FIELDCAT1-TABNAME = 'IT_MARA'.
      WA_FIELDCAT1-SELTEXT_L = 'MAT NO'.
      WA_FIELDCAT1-COL_POS = 1.
      WA_FIELDCAT1-OUTPUTLEN = 18.
      APPEND WA_FIELDCAT1 TO IT_FIELDCAT1.
      CLEAR WA_FIELDCAT1.
      WA_FIELDCAT1-FIELDNAME = 'ERNAM'.
      WA_FIELDCAT1-TABNAME = 'IT_MARA'.
      WA_FIELDCAT1-SELTEXT_L = 'NAME'.
      WA_FIELDCAT1-COL_POS = 2.
      WA_FIELDCAT1-OUTPUTLEN = 12.
      APPEND WA_FIELDCAT1 TO IT_FIELDCAT1.
      CLEAR WA_FIELDCAT1.
      WA_FIELDCAT1-FIELDNAME = 'MATKL'.
      WA_FIELDCAT1-TABNAME = 'IT_MARA'.
      WA_FIELDCAT1-SELTEXT_L = 'MAT DESC'.
      WA_FIELDCAT1-COL_POS = 3.
      WA_FIELDCAT1-OUTPUTLEN = 9.
      APPEND WA_FIELDCAT1 TO IT_FIELDCAT1.
      CLEAR WA_FIELDCAT1.
      WA_FIELDCAT1-FIELDNAME = 'MEINS'.
      WA_FIELDCAT1-TABNAME = 'IT_MARA'.
      WA_FIELDCAT1-SELTEXT_L = 'UNITS'.
      WA_FIELDCAT1-COL_POS = 4.
      WA_FIELDCAT1-OUTPUTLEN = 3.
      APPEND WA_FIELDCAT1 TO IT_FIELDCAT1.
      CLEAR WA_FIELDCAT1.
      WA_FIELDCAT1-FIELDNAME = 'PSTAT'.
      WA_FIELDCAT1-TABNAME = 'IT_MARA'.
      WA_FIELDCAT1-SELTEXT_L = 'STATUS'.
      WA_FIELDCAT1-COL_POS = 5.
      WA_FIELDCAT1-OUTPUTLEN = 15.
      APPEND WA_FIELDCAT1 TO IT_FIELDCAT1.
      CLEAR WA_FIELDCAT1.
    ENDFORM.                    " field_cat
    *&      Form  events
          text
    -->  p1        text
    <--  p2        text
    FORM EVENTS .
      CLEAR XS_EVENT.
      XS_EVENT-NAME = SLIS_EV_END_OF_PAGE.
      XS_EVENT-FORM = 'XEND_OF_PAGE'.
      APPEND XS_EVENT TO GT_XEVENTS.
      CLEAR XS_EVENT.
      XS_EVENT-NAME = SLIS_EV_TOP_OF_PAGE.
      XS_EVENT-FORM = 'XTOP_OF_PAGE'.
      APPEND XS_EVENT TO GT_XEVENTS.
      CLEAR XS_EVENT.
      XS_EVENT-NAME = SLIS_EV_TOP_OF_LIST.
      XS_EVENT-FORM = 'XTOP_OF_LIST'.
      APPEND XS_EVENT TO GT_XEVENTS.
      CLEAR XS_EVENT.
      XS_EVENT-NAME = SLIS_EV_END_OF_LIST.
      XS_EVENT-FORM = 'XEND_OF_LIST'.
      APPEND XS_EVENT TO GT_XEVENTS.
      CLEAR XS_EVENT.
      CLEAR XS_EVENT.
      XS_EVENT-NAME = SLIS_EV_END_OF_PAGE.
      XS_EVENT-FORM = 'YEND_OF_PAGE'.
      APPEND XS_EVENT TO GT_YEVENTS.
      CLEAR XS_EVENT.
      XS_EVENT-NAME = SLIS_EV_TOP_OF_PAGE.
      XS_EVENT-FORM = 'YTOP_OF_PAGE'.
      APPEND XS_EVENT TO GT_YEVENTS.
      CLEAR XS_EVENT.
      XS_EVENT-NAME = SLIS_EV_TOP_OF_LIST.
      XS_EVENT-FORM = 'YTOP_OF_LIST'.
      APPEND XS_EVENT TO GT_YEVENTS.
      CLEAR XS_EVENT.
      XS_EVENT-NAME = SLIS_EV_END_OF_LIST.
      XS_EVENT-FORM = 'YEND_OF_LIST'.
      APPEND XS_EVENT TO GT_YEVENTS.
    ENDFORM.                    " events
    *&      Form  XTOP_OF_PAGE
          text
    FORM XTOP_OF_PAGE.
    BREAK-POINT.
      WRITE: / 'X_TOP_OF_PAGE'.
    ENDFORM.                    "XTOP_OF_PAGE
          FORM XTOP_OF_LIST                                             *
    FORM XTOP_OF_LIST.
    BREAK-POINT.
      WRITE: / 'X_TOP_OF_LIST'.
    ENDFORM.                    "XTOP_OF_LIST
          FORM XEND_OF_PAGE                                             *
    FORM XEND_OF_PAGE.
    BREAK-POINT.
      WRITE: / 'X_END_OF_PAGE'.
    ENDFORM.                    "XEND_OF_PAGE
          FORM XEND_OF_LIST                                             *
    FORM XEND_OF_LIST.
    BREAK-POINT.
      WRITE: / 'X_END_OF_LIST'.
    ENDFORM.                    "XEND_OF_LIST
    FORM YTOP_OF_PAGE.
    BREAK-POINT.
      WRITE: / 'Y_TOP_OF_PAGE'.
    ENDFORM.                    "YTOP_OF_PAGE
          FORM YTOP_OF_LIST                                             *
    FORM YTOP_OF_LIST.
    BREAK-POINT.
      WRITE: / 'Y_TOP_OF_LIST'.
    ENDFORM.                    "YTOP_OF_LIST
          FORM YEND_OF_PAGE                                             *
    FORM YEND_OF_PAGE.
    BREAK-POINT.
      WRITE: / 'Y_END_OF_PAGE'.
    ENDFORM.                    "YEND_OF_PAGE
          FORM YEND_OF_LIST                                             *
    FORM YEND_OF_LIST.
    BREAK-POINT.
      WRITE: / 'Y_END_OF_LIST'.
    ENDFORM.                    "YEND_OF_LIST
    *&      Form  POP_VBAP
          text
    -->  p1        text
    <--  p2        text
    FORM POP_VBAP .
      SELECT VBELN
               POSNR
               ERNAM
               ERDAT
               MATNR
               FROM VBAP
               INTO CORRESPONDING FIELDS OF TABLE IT_VBAP
               WHERE VBELN IN S_VBELN.
    ENDFORM.                    " POP_VBAP
    *&      Form  POP_MARA
          text
    -->  p1        text
    <--  p2        text
    FORM POP_MARA .
      LOOP AT IT_VBAP.
        SELECT SINGLE MATNR
                      ERNAM
                      MATKL
                      MEINS
                      PSTAT
                      FROM MARA
                      INTO CORRESPONDING FIELDS OF IT_MARA
                      WHERE MATNR = IT_VBAP-MATNR.
        APPEND IT_MARA.
      ENDLOOP.
    ENDFORM.                    " POP_MARA
    *&      Form  BLOCK_LIST
          text
    -->  p1        text
    <--  p2        text
    FORM BLOCK_LIST .
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
        EXPORTING
          I_CALLBACK_PROGRAM       = REPID
          I_CALLBACK_PF_STATUS_SET = ' '
          I_CALLBACK_USER_COMMAND  = 'user_command'.
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
          EXPORTING
            IS_LAYOUT                        = WA_LAYOUT
            IT_FIELDCAT                      = IT_FIELDCAT
            I_TABNAME                        = 'IT_VBAP'
            IT_EVENTS                        = GT_XEVENTS
      IT_SORT                          =
      I_TEXT                           = ' '
          TABLES
            T_OUTTAB                         = IT_VBAP
    EXCEPTIONS
      PROGRAM_ERROR                    = 1
      MAXIMUM_OF_APPENDS_REACHED       = 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.
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
        EXPORTING
          IS_LAYOUT                        = WA_LAYOUT
          IT_FIELDCAT                      = IT_FIELDCAT1
          I_TABNAME                        = 'IT_MARA'
          IT_EVENTS                        = GT_YEVENTS
        IT_SORT                          =
        I_TEXT                           = ' '
        TABLES
          T_OUTTAB                         = IT_MARA
      EXCEPTIONS
        PROGRAM_ERROR                    = 1
        MAXIMUM_OF_APPENDS_REACHED       = 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.
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
       EXPORTING
      I_INTERFACE_CHECK             = ' '
         IS_PRINT                      = GT_PRINT
      I_SCREEN_START_COLUMN         = 0
      I_SCREEN_START_LINE           = 0
      I_SCREEN_END_COLUMN           = 0
      I_SCREEN_END_LINE             = 0
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER       =
      ES_EXIT_CAUSED_BY_USER        =
    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.
    ENDFORM.                    " BLOCK_LIST
    Regards
    Vasu

  • Checkbox event in one mxml calling function in another mxml

    If you have multiple mxml files to break out the components,
    how can you have an event on the main application (like a checkbox)
    activate a function in the scripting on another?
    thanks

    Set up a listener on the component. See addEventListener() in
    the docs.
    Tracy

  • Checkbox Event

    I've created an example of what I'm hoping to do here:
    http://whendarknessfalls.org/jt/Test.html
    (click Preferences tab)
    Basically, when someone clicks on a checkbox, I want to
    create a new tab button with a set of textboxes and input boxes
    (all of this is done at runtime). I looked at the chapter of
    documentation called "Creating Instances at Runtime" but I had
    difficulty understanding how to do this with a TabNavigator
    component.
    Does anyone know how to do this? Just adding a tab to the
    menu would be a start, we can talk about getting the content into
    it afterwards..
    I'm guessing the click event will look something along the
    lines of this...
    click="myTabNavigator.addchild(button, undefined,
    label="Educational info")";
    Or I may be completely off.. not sure =)

    addChild is the right method, but don't even try to do all
    this in the click hanldler declaration. Call a function, do it
    there.
    Tracy

  • Checkbox field in REUSE_ALV_GRID_DISPLAY without creating additional field

    Hi Experts,
    I want to show checkboxes in ALV without adding an additional checkbox field in my structure. OO-ALV will also do.......
    Plz Help........

    hi check this...
    REPORT Z_TEST7 .
    *Table declaration
    tables: vbak,vbap.
    *internal table
    data: begin of i_sales occurs 0,
    vbeln like vbak-vbeln,
    erdat like vbak-erdat,
    audat like vbak-audat,
    kunnr like vbak-kunnr,
    vkorg like vbak-vkorg,
    matnr like vbap-matnr,
    netpr like vbap-netpr,
    check type c, "checkbox
    end of i_sales.
    type-pools: slis.
    data: v_fieldcat type slis_fieldcat_alv,
    gt_fieldcat type slis_t_fieldcat_alv,
    gt_layout type slis_layout_alv,
    gt_sort type slis_sortinfo_alv,
    fieldcat like line of gt_fieldcat.
    *Selection screen
    parameters: p_vkorg like vbak-vkorg.
    select-options: s_vbeln for vbak-vbeln.
    *start of selection.
    start-of-selection.
    perform get_data.
    perform fill_fieldcatalog.
    perform write_data.
    FORM get_data .
    select avbeln aerdat aaudat akunnr avkorg bmatnr b~netpr into
    corresponding fields of table i_sales from vbak
    as a inner join vbap as b on avbeln = bvbeln
    where a~vkorg = p_vkorg and
    a~vbeln in s_vbeln.
    ENDFORM. " get_data
    FORM write_data .
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = sy-repid
    IS_LAYOUT = gt_layout
    IT_FIELDCAT = gt_fieldcat
    TABLES
    T_OUTTAB = i_sales .
    ENDFORM. " write_data
    FORM fill_fieldcatalog .
    sort i_sales by vbeln.
    clear v_fieldcat.
    "for check box
    v_fieldcat-col_pos = 1.
    v_fieldcat-fieldname = 'CHECK'.
    v_fieldcat-seltext_m = 'chek'.
    v_fieldcat-checkbox = 'X'.
    v_fieldcat-input = 'X'.
    v_fieldcat-edit = 'X'.
    append v_fieldcat to gt_fieldcat.
    clear v_fieldcat.
    v_fieldcat-col_pos = 2.
    v_fieldcat-fieldname = 'VBELN'.
    v_fieldcat-seltext_m = 'Sales Document'.
    append v_fieldcat to gt_fieldcat.
    clear v_fieldcat.
    v_fieldcat-col_pos = 3.
    v_fieldcat-fieldname = 'ERDAT'.
    v_fieldcat-seltext_m = 'Creation Date'.
    append v_fieldcat to gt_fieldcat.
    clear v_fieldcat.
    v_fieldcat-col_pos = 4.
    v_fieldcat-fieldname = 'AUDAT'.
    v_fieldcat-seltext_m = 'Document Date'.
    append v_fieldcat to gt_fieldcat.
    clear v_fieldcat.
    v_fieldcat-col_pos = 5.
    v_fieldcat-fieldname = 'KUNNR'.
    v_fieldcat-seltext_m = 'Customer'.
    append v_fieldcat to gt_fieldcat.
    clear v_fieldcat.
    v_fieldcat-col_pos = 6.
    v_fieldcat-fieldname = 'VKORG'.
    v_fieldcat-seltext_m = 'Sales Organization'.
    append v_fieldcat to gt_fieldcat.
    clear v_fieldcat.
    v_fieldcat-col_pos = 7.
    v_fieldcat-fieldname = 'MATNR'.
    v_fieldcat-seltext_m = 'Material'.
    append v_fieldcat to gt_fieldcat.
    clear v_fieldcat.
    v_fieldcat-col_pos = 8.
    v_fieldcat-fieldname = 'NETPR'.
    v_fieldcat-seltext_m = 'Net Value'.
    append v_fieldcat to gt_fieldcat.
    clear v_fieldcat.
    endform.

  • Events in REUSE_ALV_GRID_DISPLAY

    Hi Gurus,
    Does anyone know what events (I mean those passed by I_EVENTS parameter) are executed in this FM?
    I've tried LIST_CHANGED, but it looks like it works only with REUSE_ALV_LIST_DISPLAY

    hi,
    it is use for different events like TOP_OF_PAGE,END_OF_PAGE,USER_COMMAND...
    in ALV grid there is functionality of calling USER_COMMAND,TOP_OF_PAGE....
    but ALV List if u want these then u need event parameter....
    here is the example...
    *& Report  ZALV_LIST
    REPORT  zalv_list.
    TABLES : mseg.
    TYPE-POOLS : slis.
    DATA : BEGIN OF itab OCCURS 0,
            mblnr LIKE mseg-mblnr,
            matnr LIKE mseg-matnr,
            werks LIKE mseg-werks,
            menge LIKE mseg-menge,
            line_color(4) TYPE c,
           END OF itab.
    DATA : BEGIN OF itab1 OCCURS 0,
            mblnr LIKE mseg-mblnr,
            matnr LIKE mseg-matnr,
            werks LIKE mseg-werks,
            menge LIKE mseg-menge,
            line_color(4) TYPE c,
           END OF itab1.
    DATA : t_fcat TYPE slis_t_fieldcat_alv,
           t_eve TYPE slis_t_event,
           t_subtot TYPE slis_t_sortinfo_alv,
           subtot LIKE LINE OF t_subtot,
           wa_fcat LIKE LINE OF t_fcat,
           gd_layout    TYPE slis_layout_alv.
    DATA : gt_menge LIKE mseg-menge,
           st_menge LIKE mseg-menge.
    SELECTION-SCREEN : BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS : doc FOR mseg-mblnr.
    SELECTION-SCREEN : END OF BLOCK blk1.
    INITIALIZATION.
      PERFORM build_cat USING t_fcat.
      PERFORM build_eve.
      PERFORM build_layout.
    START-OF-SELECTION.
      PERFORM get_data.
      PERFORM display.
    *&      Form  build_cat
    *       text
    *      -->TEMP_FCAT  text
    FORM build_cat USING temp_fcat TYPE slis_t_fieldcat_alv.
      wa_fcat-tabname = 'ITAB'.
      wa_fcat-fieldname = 'MBLNR'.
      wa_fcat-seltext_m = 'Material Doc.'.
      APPEND wa_fcat TO temp_fcat.
      CLEAR wa_fcat.
      wa_fcat-tabname = 'ITAB'.
      wa_fcat-fieldname = 'MATNR'.
      wa_fcat-seltext_m = 'Material'.
      APPEND wa_fcat TO temp_fcat.
      CLEAR wa_fcat.
      wa_fcat-tabname = 'ITAB'.
      wa_fcat-fieldname = 'WERKS'.
      wa_fcat-seltext_m = 'Plant'.
      APPEND wa_fcat TO temp_fcat.
      CLEAR wa_fcat.
      wa_fcat-tabname = 'ITAB'.
      wa_fcat-fieldname = 'MENGE'.
      wa_fcat-seltext_m = 'Quantity'.
      wa_fcat-do_sum = 'Y'.
      APPEND wa_fcat TO temp_fcat.
      CLEAR wa_fcat.
      subtot-spos = 1.
      subtot-fieldname = 'MBLNR'.
      subtot-tabname = 'ITAB'.
      subtot-up = 'X'.
      subtot-group = 'X'.
      subtot-subtot = 'X'.
      subtot-expa = 'X'.
      APPEND subtot TO t_subtot.
    ENDFORM.                    "build_cat
    *&      Form  build_eve
    *       text
    FORM build_eve.
      DATA : wa_eve TYPE slis_alv_event.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type     = 0
        IMPORTING
          et_events       = t_eve
        EXCEPTIONS
          list_type_wrong = 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.
      READ TABLE t_eve WITH KEY name =  slis_ev_top_of_page
                             INTO wa_eve.
      IF sy-subrc = 0.
        MOVE 'TOP_OF_PAGE' TO wa_eve-form.
        APPEND wa_eve TO t_eve.
      ENDIF.
      READ TABLE t_eve INTO wa_eve WITH KEY name = 'END_OF_LIST'.
      IF sy-subrc = 0.
        wa_eve-form = 'END_OF_PAGE'.
        MODIFY t_eve FROM wa_eve INDEX sy-tabix.
      ENDIF.
    ENDFORM.                    "build_eve
    *&      Form  build_layout
    *       text
    FORM build_layout.
      gd_layout-no_input          = 'X'.
      gd_layout-colwidth_optimize = 'X'.
      gd_layout-info_fieldname =      'LINE_COLOR'.
      gd_layout-subtotals_text = 'SUBTOTAL'.
      gd_layout-totals_text = 'TOTAL'.
    ENDFORM.                    " BUILD_LAYOUT
    *&      Form  get_data
    *       text
    FORM get_data.
      SELECT mblnr matnr werks menge FROM mseg INTO CORRESPONDING FIELDS OF TABLE itab
      WHERE mblnr IN doc.
      SORT itab BY mblnr.
    ENDFORM.                    "get_data
    *&      Form  display
    *       text
    FORM display.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          i_callback_program = 'ZALV_LIST'
          is_layout          = gd_layout
          it_fieldcat        = t_fcat
          it_sort            = t_subtot
          it_events          = t_eve
        TABLES
          t_outtab           = itab.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    "display
    *&      Form  top_of_page
    *       text
    FORM top_of_page.
      WRITE:/ 'Material Info'.
    ENDFORM.                    "top_of_page
    *&      Form  end_of_page
    *       text
    FORM end_of_page.
      WRITE:/ 'Dhwani Shah'.
    ENDFORM.                    "end_of_page
    reward if usefull....

  • Checkbox event disables checkboxes

    Hi,
    I am building a Search Component for the KM Using in NW 04 Stack 14.
    In the Search Component I User Checkboxes to search in predefined Taxonomies.
    To make it more easy to our Customers there should be a Checkbox to Search in all of these predefined Taxonomies. This Checkbox is per default enabled.
    When a user select one of the other checkboxes for a single taxonomie search the checkbox should be automatically disabled.
    At the moment I use the code below to create the checkboxes.
    I tried the function setOnClick, but I don’t know the correct syntax to deactivate a checkbox by clicking another one.
    Perhaps someone of you can help me.
    Thanks
    Sascha
    private Component createCheckboxes()
                        Checkbox AGS = new Checkbox(Search_WL.m_buzzwords[1]);
                        AGS.setText(Search_WL.m_buzzwords[1]);
                        AGS.setChecked(false);
                        AGS.setTooltip(Search_WL.IndexTooltip[1]);
                        Checkbox BS = new Checkbox(Search_WL.m_buzzwords[2]);
                        BS.setText(Search_WL.m_buzzwords[2]);
                        BS.setChecked(false);
                        BS.setTooltip(Search_WL.IndexTooltip[2]);
                        Checkbox EDV = new Checkbox(Search_WL.m_buzzwords[3]);
                        EDV.setText(Search_WL.m_buzzwords[3]);
                        EDV.setChecked(false);
                        EDV.setTooltip(Search_WL.IndexTooltip[3]);
                        Checkbox FS = new Checkbox(Search_WL.m_buzzwords[4]);
                        FS.setText(Search_WL.m_buzzwords[4]);
                        FS.setChecked(false);
                        FS.setTooltip(Search_WL.IndexTooltip[4]);
                        Checkbox KHM = new Checkbox(Search_WL.m_buzzwords[5]);
                        KHM.setText(Search_WL.m_buzzwords[5]);
                        KHM.setChecked(false);
                        KHM.setTooltip(Search_WL.IndexTooltip[5]);
                        Checkbox MAKO = new Checkbox(Search_WL.m_buzzwords[6]);
                        MAKO.setText(Search_WL.m_buzzwords[6]);
                        MAKO.setChecked(false);
                        MAKO.setTooltip(Search_WL.IndexTooltip[6]);
                        Checkbox VSS = new Checkbox(Search_WL.m_buzzwords[7]);
                        VSS.setText(Search_WL.m_buzzwords[7]);
                        VSS.setChecked(false);
                        VSS.setTooltip(Search_WL.IndexTooltip[7]);
                        Checkbox VPS = new Checkbox(Search_WL.m_buzzwords[8]);
                        VPS.setText(Search_WL.m_buzzwords[8]);
                        VPS.setChecked(false);
                        VPS.setTooltip(Search_WL.IndexTooltip[8]);
                        Checkbox Vertrieb = new Checkbox(Search_WL.m_buzzwords[9]);
                        Vertrieb.setText(Search_WL.m_buzzwords[9]);
                        Vertrieb.setChecked(false);
                        Vertrieb.setTooltip(Search_WL.IndexTooltip[9]);
                        Checkbox Alle = new Checkbox(Search_WL.m_buzzwords[0]);
                        Alle.setText(Search_WL.m_buzzwords[0]);
                        Alle.setChecked(true);
                        Alle.setTooltip(Search_WL.IndexTooltip[0]);
                        GridLayout grid = new GridLayout();          
                                            grid.setWidth("100%");
                        grid.addComponent(AGS);
                        grid.addComponent(BS);                    
                        grid.addComponent(EDV);
                        grid.addComponent(FS);
                        grid.addComponent(KHM);                    
                        grid.addComponent(MAKO);
                        grid.addComponent(VSS);
                        grid.addComponent(VPS);                    
                        grid.addComponent(Vertrieb);
         grid.addComponent(Alle);
                        return grid;

    Hi Sascha,
    You can implement a javascript function to disable the other chekboxes one you click a particular chekbox. You can call this javascript function on the onClientClick of this checkbox. So when you click this checkbox all the other chekboxes will get disabled.
    in the javascript function you can write something like this..
    document.forms[0].<%= compId %>.enabled = false;
    you can get the dynamic id of the HTMLB component from your java class like this.
    compId = pageContext.getParamIdForComponent(chkBox);
    where pageContext is the IPageContext.
    hope it helps
    cheers
    Kiran

  • CheckBox reader and other bits

    Hi
    I'm a perl srcipter so I get the basics of programming even if I've got the java terminology wrong. I have a table with 4 rows 5 columns, I want to draw each row as a line on a graph and I want to be able to control which row(s) are displayed with checkboxes. The code below compiles as it stands so hopefully you can see what I'm trying to do. I have the following issues which I've been unable to sort and hope someone will point me the right way.
    Reading the checkbox events. My plan was for a boolean array (checkBoxSetting[]) which recorded true/false for each line on the graph then I could print 'if true'. Do I need to somehow call the 'itemStateChanged' method (line 7 from within the arrayExp() method (line 112)? Do I need the block commented out at lines 60-65 and if so what causes the error "addItemListener(java.awt.event.ItemListener) in javax.swing.AbstractButton cannot be applied to (arrayExp)"? Am I any where close to getting this working?
    Other problems...
    Line 124 I changed from grid layout to box layout so I don't think I sould need this line but if I comment it out I get a very small panel with nothing on it. So what should I put insead?
    Line 163 I need to scale the data by dividing the height of the y axis by the highest data value. With the test data that should be 200/400 = 0.5 but whatever I define scale as (double, float, int) I get zero as the result? (thus it's currently over written on line 164)
    I find testing as an application easyer so I plan to convert this to an applet once I've got it working. Is that a bad plan, should I just make it into an applet now the worry about functionality later?
    Any help on the above problems would be appreciated and if you want to advise on other glaring errors in my structure please do. Thanks Annie
      * 1.1 version.
    import java.awt.*;
    import java.awt.event.*;
    import java.lang.Math;
    import java.net.*;
    import java.io.*;
    import java.util.*;
    import javax.swing.*;
    public class arrayExp extends Frame
                            implements ActionListener {
         boolean inAnApplet = true;
         JCheckBox ATButton;
         JCheckBox CdButton;
         JCheckBox CuButton;
         JCheckBox PAHButton;
         boolean[] checkBoxSetting = {true,true,true,true};
         public static void main(String[] args) {
              arrayExp window = new arrayExp();
              window.inAnApplet = false;
              window.setTitle("expressions");
              window.pack();
              window.setVisible(true);
         public void actionPerformed(ActionEvent event) {
              //The only action event we get is when the
              //user requests we bring up a FileDialog.
              FileDialog fd = new FileDialog(this, "FileDialog");
              fd.setVisible(true);
         public JPanel CheckBoxPanel() {
              //Create the check boxes.
              ATButton = new JCheckBox("AT");
              ATButton.setMnemonic(KeyEvent.VK_C);
              ATButton.setSelected(true);
              checkBoxSetting[0]=true;
              CdButton = new JCheckBox("Cd");
              CdButton.setMnemonic(KeyEvent.VK_G);
              CdButton.setSelected(true);
              checkBoxSetting[1]=true;
              CuButton = new JCheckBox("Cu");
              CuButton.setMnemonic(KeyEvent.VK_H);
              CuButton.setSelected(true);
              checkBoxSetting[2]=true;
              PAHButton = new JCheckBox("PAH");
              PAHButton.setMnemonic(KeyEvent.VK_T);
              PAHButton.setSelected(true);
              checkBoxSetting[3]=true;
    /*          //Register a listener for the check boxes.
              ATButton.addItemListener(this);
              CdButton.addItemListener(this);
              CuButton.addItemListener(this);
              PAHButton.addItemListener(this);
              JPanel p = new JPanel();
              p.setLayout(new GridLayout(4,1));
              p.add(ATButton);
              p.add(CdButton);
              p.add(CuButton);
              p.add(PAHButton);
              return (p);
    // add a checkbox listener
         public void itemStateChanged(ItemEvent event) {
              char c = '-';
              Object source = event.getItemSelectable();
              if (source == ATButton) {
                   checkBoxSetting[0] = false;
                   c = 'T';
                   System.out.println("CheckBox "+c);
              else if (source == CdButton) {
                   checkBoxSetting[1] = false;
                   c = 'd';
                   System.out.println("CheckBox "+c);
              else if (source == CuButton) {
                   checkBoxSetting[2] = false;
                   c = 'u';
                   System.out.println("CheckBox "+c);
              else if (source == PAHButton) {
                   checkBoxSetting[3] = false;
                   c = 'H';
                   System.out.println("CheckBox "+c);
              //Now that we know which button was pushed, find out
              //whether it was selected or deselected.
              if (event.getStateChange() == ItemEvent.DESELECTED) {
                   System.out.println("CheckBox "+c);
                   c = '-';
              repaint();
         public arrayExp() {
              Panel canvasPanel = new Panel();
              JPanel cbp = CheckBoxPanel();
              setLayout(new BorderLayout());
              //layout area as boxes left to right
              canvasPanel.setLayout(new BoxLayout(canvasPanel, BoxLayout.LINE_AXIS));
              //Put a graph (MyCanvas) in the first box.
              canvasPanel.add(new MyCanvas());
              //Put checkboxes in the right box.
              canvasPanel.add(cbp);
              add("East", canvasPanel);  //why do I need this when I changed to a box layout?
              addWindowListener(new WindowAdapter() {
                   public void windowClosing(WindowEvent event) {
                        if (inAnApplet) {dispose();}
                        else {System.exit(0);}
    }//----------------end class arrayExp
    //paint the graph on a canvas.
    class MyCanvas extends Canvas {
         public void paint(Graphics g) {
              System.out.println("Paint");
              //tempory array of expression levels for four treatments X 5 exposures
              //to be read from database in future
              int[][] expLevels =      {  {0, 50, 120, 200, 200},
                                                 {20, 200, 100, 300, 200},
                                                 {100, 100, 100, 400, 200},
                                                 {0, 150, 200, 150, 0}  };
              //find max expression to scale y axis
              int max=0;
              for (int i=0; i<4; i++) {
                   for (int j=0; j<5; j++){
                        if (expLevels[i][j]>max) {max=expLevels[i][j];}
              //origin (form top left x right, y down)
    //      int w = getSize().width;
    //      int h = getSize().height;
              int originX=50;
              int step=100;  //distance between exposures on x axis
              int height=200;
              int originY=height+originX;
              double scale=height/max;
              scale=0.5;
              g.drawString("height"+height+"/ max"+max+" = scale"+scale, 0, originY+60);
              //set up an array of 5 colours
              Color[] EColor = new Color[5];
              EColor[0]= new Color(200,0,255); //magenta
              EColor[1]= new Color(0,0,255);      //green
              EColor[2]= new Color(0,255,0);      //blue
              EColor[3]= new Color(230,230,0); //yellow
              //draw axis
              g.setColor(Color.black);
              g.drawLine(originX, originX, originX, originY);
              g.drawLine(originX, originY, originX+(step*4), originY);
              //lable x axis
              g.drawString("LC0", originX, originY+20);
              g.drawString("LC12.5", originX+step, originY+20);
              g.drawString("LC25", originX+(step*2), originY+20);
              g.drawString("LC37.5", originX+(step*3), originY+20);
              g.drawString("LC50", originX+(step*4), originY+20);
              g.drawString("Exposure", originX+(step*2), originY+40);
              //lable y axis
              int xs=originX; int ys=originY; int zs=(int)((max/height)*0.25);
    //          g.drawString("x"+xs+" y"+ys+" zs"+zs+" max"+max+" scale"+scale, 0, originY+60);
              g.drawString("0", originX-15, originY);
              g.drawString(""+(int)(max*scale*0.25), originX-20, originY- (int) (max*scale*0.25));//400*.5=200*.25=50
              g.drawString(""+(int)(max*scale*0.50), originX-20, originY- (int) (max*scale*0.5));
              g.drawString(""+(int)(max*scale*0.75), originX-20, originY- (int) (max*scale*0.75));
              g.drawString(""+max, originX-20, originY- (int) (max*scale));
              g.drawString("Expression", originX-100, originY-(int)(height*0.5));
              int x=originX; int y;
              for (int i=0; i<4; i++) {
    //               if (checkBoxSetting) {
                        g.setColor(EColor[i]);
                        for (int j=0; j<4; j++){
                             y=j+1;
                             g.drawLine(x,originY-(int)(expLevels[i][j]*scale), x+step, originY-(int)(expLevels[i][y]*scale));
                             x=x+step;
                        x=originX;
         //If we don't specify this, the canvas might not show up at all
         //(depending on the layout manager).
         public Dimension getMinimumSize() {return new Dimension(550,300);}
         //If we don't specify this, the canvas might not show up at all
         //(depending on the layout manager).
         public Dimension getPreferredSize() {return getMinimumSize();}
    }//end-------------class MyCanvas

    To address some of your questions:
    Do I need the block commented out at lines 60-65 and if so what causes the error
    "addItemListener(java.awt.event.ItemListener) in javax.swing.AbstractButton cannot be applied
    to (arrayExp)"?Uncommenting that block would seem reasonable. However, you then have to make arrayExp implement ItemListener and provide an itemStateChanged(ItemEvent) method.
    Note that this advice only applies while you're learning. For production-quality code I wouldn't have a component also be a listener, but I'd use an (anonymous, generally) inner class.
    Line 163 I need to scale the data by dividing the height of the y axis by the highest data
    value. With the test data that should be 200/400 = 0.5 but whatever I define scale as (double,
    float, int) I get zero as the result?The problem is on the right hand side of the = sign. You're dividing an int by an int, and that performs integer division. The tidiest way of fixing this is to cast the expression after the / to double:           double scale=height/(double)max;Whenever division produces suspicious zeroes that's something to check.
    if you want to advise on other glaring errors in my structure please do.MyCanvas seems to do an awful lot of work in the paint method. All of the bits which set up data should be pulled out, probably into the constructor. (Some people would disagree with me and have an init() method instead. There are pros and cons).

  • To check the checkbox dynamically used in thmlb tag

    Hi all,
    I am new to crm 2007,
      I have added a thtmlb tab to create a checkbox. I am able to get checkbox event to get value of the check box and process. But when reopen the  view the check box should be checked  dynamically depending on the conditions.
                   how to make a check box checked dynamically.
    Thanks
    Hema

    Hi john,
    I have table control with fore fileds like this..
    'text box'-------'get button'.
    chkbox---item-material---qty
    box1--1abcde--
    10
    box2--2xyhnb--
    20
    Nothing is allow input value except chkbox.
    Values are coming by one text box above this table.
    Text box allow input value..
    if i click box1 ...that row will be selected and it takes to second screen.....
    But this box is not allowing to check...
    kaki
    Message was edited by: Kaki R
    Message was edited by: Kaki R

  • Event handling between JComboBox & JCheckBox

    Hi.
    My problem is that when i click on the JCheckBox object, the code (i have) also executes the condition for JComboBox object. I assume there is a very simple solution, but i have yet to find it.
    This is the code i'm using:
         public void itemStateChanged(ItemEvent e){
              if(qcmCheckBox.isSelected()){
                   System.out.println("checkbox selected");
              if(e.getStateChange() == ItemEvent.SELECTED){
                   System.out.println("combo selected " + comboBoxOptions.getSelectedIndex());
         }My problem is, i think, that the e.getStateChange() is always returning true. I just haven't figured out a way to 'single out' when the JComboBox is selected.

    thanks for the tip, but that didn't exactly work.
    these are my steps:
    select second drop down option (out of 3)
    select checkbox
    deselect checkbox
    old output
    combo selected1
    qcm selected
    combo selected1new output (using instanceof)
    combo selected 1
    combo selected 1
    checkbox selected
    combo selected 1
    combo selected 1here's my code:
    // setting up vars
    private JCheckBox checkBox = new JCheckBox();
    private final String comboNames[] = {"Option 1", "Option 2", "Option 3"};
    private JComboBox comboBoxOptions = new JComboBox(comboNames);
    // combo box
    comboBoxOptions.addItemListener(this);
    // checkbox
    checkBox.addItemListener(this);
    // event handler
    public void itemStateChanged(ItemEvent e){
         if(checkBox.isSelected()){
              System.out.println("checkbox selected");
         //if(comboBoxOptions instanceof JComboBox){ // the suggested alternative
         if(e.getStateChange() == ItemEvent.SELECTED){
              System.out.println("combo selected " + comboBoxOptions.getSelectedIndex());
    }For some reason, the suggested answer gives me duplicate entries for the dropdown and it still gives me duplicate entries when i click on the checkbox.
    Again, what i'm trying to do is just get the checkbox not to execute the 2nd if statement "if(e.getStateChange() == ItemEvent.SELECTED){"
    I think the statement "e.getStateChange()" is returning everything true because its an event happening but i don't know a way to single the checkbox event.
    I would appreciate all the help I can get. Thanks.
    sijis

  • REUSE_ALV_GRID_DISPLAY - replacing the standard selection column with check

    I am attempting to replace the standard selection column (what you press to highlight an entire line) with a column
    of checkboxes using the REUSE_ALV_GRID_DISPLAY.  Which would mean that when you press on '(de)select all' that the
    checkboxes would behave accordingly.
    There is a 'box' field in the internal table and the layout is referencing it.  I have verified in debug that the
    '(de)select all' functionality is updating that field in the internal table.  When I add the 'box' field to the field
    catalog it will display on the screen but it does not show as ticked when '(de)select all' is pressed.  Again in debug
    the itab is being updated.
    I have been googling for a solution and found others with similar problems, but no useful solutions were provided.
    It is not an option to go with an ALV OO solution per the environment.  Thank you in advance.

    Hi Glen,
    If you are checking condition like whether it is select all or deselect all you can modify the internal for that fields as below
    if select all.
    itab-check = 'X'.
    modify itab where check = 'X' transporting check.
    endif.
    This will update all your itab-check coloumn with check indicator.
    This may be useful for you.
    Thanks,
    Manjunath M

  • Dynamic Tree menu with checkbox

    Dear Boss
    Now I am in a problem for some task. But I have not ever done these. Please help me if you possible for you. I need a tree menu in java which has the following attributes:
    v This check box will implement on Oracle form
    v Checkbox Event tracking
    v On check event data will save in database
    v On check event text item of form will be re-query
    I am looking for your reply
    Aktar Chowdhury

    Play around with it, it is simpler than you think! Add a spry menu to a page with a css menu on it, see how it is structured, then make the changes to get the results you want. A Spry menu uses a UL/LI structure very similar to that generated by css_menu, you just need to add a class to the LI.
    //CSS Dynamic Menus required file
    require_once('includes/cssmenus2/gwb_Menu2.inc.php');
    //Begin Menu1
      $Menu1 = new MX_Menu2('MenuBar1');
      $Menu1->setQuery($rs_Menu1);
      $Menu1->setPK("MenuID");
      $Menu1->setFK("ParentID");
      $Menu1->setNameField("MenuLabel");
      $Menu1->setTitleField("Tip");
      //URL parameters
      $Menu1->setLinkField("Link");
      $Menu1->setTargetField("");
      // Layout
      $Menu1->setLevel(-1);
      $Menu1->setSkin("MenuBarVertical");  <---------
    //End Menu1
    body
    <?php  // Dynamic CSS Menu 
      echo $Menu1->render();
    ?>
    css_menu2.inc.php
      foreach($this->DBItems[$id] as $key=>$val){
        $li_class = ' class="MenuBarItemSubmenu"';     <-----
        //the efective row

  • How to access TileList checkboxes?

    I have a question that should be relatively easy for you
    veteran Flex developers. I am rendering a series of checkboxes into
    a TileList component via a dataProvider. How can I enumerate all
    checkboxes to determine the checked state of each?
    Here is how I generate my TileList:
    <mx:TileList allowMultipleSelection="true"
    click="handleCheckState(event.target)" id="tlDeptList"
    maxColumns="10" rowHeight="30" columnWidth="70"
    itemRenderer="mx.controls.CheckBox" x="10" y="79" width="478"
    height="229"/>
    I can get the data from the tlDeptList.dataProvider property,
    but I can't seem to locate where the checked (selected) state for
    the rendered checkboxes is located. <shrug>
    Thanks in advance...
    Regards,
    Chris

    This may help.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute">
    <mx:Script>
    <![CDATA[
    import mx.containers.Box;
    import mx.controls.CheckBox;
    private function handleCheckState(event:Event):void {
    var tempCB:CheckBox = CheckBox(event.target);
    trace(tempCB.selected);
    ]]>
    </mx:Script>
    <mx:TileList allowMultipleSelection="true"
    click="handleCheckState(event)"
    id="tlDeptList" maxColumns="10" rowHeight="30"
    columnWidth="70"
    itemRenderer="mx.controls.CheckBox" x="10" y="79"
    width="478" height="229">
    <mx:dataProvider>
    <mx:String>Item1</mx:String>
    <mx:String>Item2</mx:String>
    <mx:String>Item3</mx:String>
    </mx:dataProvider>
    </mx:TileList>
    </mx:Application>

  • Possible to show/hide sections in a table?

    Hello all,
    First post here. I've only started using LiveCycle Designer a few weeks ago, never knowing that it came with my Acrobat. I've been busy converting forms we use in our business into pdf versions that can be filled, and created some with simple scripting etc.  Anyway my most ambitious effort to date is to create a gross payroll calculator in which I would enter the total hours worked for each employee and the gross payroll is calculated. The calculations I have no issue with.
    I am using a hidden "config" subform (thanks to kingphysh for your easy and simple example!) to store the employee names and payrates and the department they work in.
    My main form, the one on which I am entering total time for each employee, consists of a table with a section for each department. Thus I can put all employees in a department in one section of the table and then easily do subtotals by department etc.
    Table1
    Table1.Section1
          Dept. Name | Emp. Name | Pay Rate | Total Hrs | Gross Pay|  <-- this would be one row in the section     
    Table1.Section2
          Dept. Name | Emp. Name | Pay Rate | Total Hrs | Gross Pay|
    Table1.Section3
          Dept. Name | Emp. Name | Pay Rate | Total Hrs | Gross Pay|
    and so on. Each section also has a footer row for subtotals.
    This form will be used at various physical locations and not every location will have all departments. Thus I want the table to show only those sections for which the corresponding departments exist based on a selection (checkbox) that is on the hidden config page.
    Its not so much the actual scripting thats a problem, but where to put the script. Should I use a Table1 event or the checkbox event? I've tried both but neither works as desired. Or should I use an event for the individual rows in the section itself?
    Any pointers and suggestions will be greatly appreciated!
    Harry.

    Niall,
    Many thanks for all your help. With the examples you provided, I have been able to almost finish the form and learned a little bit along the way too.
    There are a couple of things still vexing me though.
    My form's hierarchy is as follows:
    page1 (flowed)
         - wrapper (flowed)
              - form1  (positioned)  <-- sub-form (form on which data is entered and calculation results are displayed_
                   - table1
                        -HEADER
                        -Section1 - bodyrow
                                       - section1 footer
                        -Section2 - bodyrow
                                        - section2 footer
                        -FOOTER
              - config   (positioned) <--  sub-form (normally hidden "config" form which stores employee data - accessed by password
                   - table1
    The sub-form form1 contains a table with six sections. Each section represents one department and has  body rows and a footer row for subtotals.
    the number of body rows in each section can vary with the number of employees in the department.
    I have two issues remaining with the form and it will be done. Hopefully you will be able to point me in the right direction.
    1. Pagination - in the form, I have set page1 to "flowed". wrapper is also flowed. form1 is positioned.
         I would like to be able to set it so that if any section is going to be split, it would go onto the next page.
         The header should be repeated in each page. Each section footer should be with the section, and the Table footer should be on the last page.
    2. Column Subtotals
         I have set the form to be as general purpose as possible. Thus it can take time totals in either decimal or HH:MM format. I am having trouble adding columns of time totals in HH:MM format.
    For example, given 3 time totals (all are in text fields):
    10:35
    15:59
    03:24
    I would thing the best way to do this is to parse the strings and add the minutes and hrs separately and then depending on the total of the minutes, use the floor and mod functions to get the correct total. I just can't get it to add the columns at all.
    This is the code I am using to add the column:
    if (_FD.count gt 0) then   //make sure at least one body row exists in this section
    for i = 1 upto (_FD.count) do
    mins = Sum(Right (FD[i].fdr_tot[i], 2))        // FD is the row and fdr_tot is the cell in the row which is to be included in the calc.
    hrs = Sum(Left (FD[i].fdr_tot[i], (Len (FD[i].fdr_tot[i]) - 3)))
    endfor
    endif
    I've tried using the code below as well to no avail.
    mins = Sum(Right (FD[*].fdr_tot[*], 2))
    hrs = Sum(Left (FD[*].fdr_tot[*], (Len (FD[*].fdr_tot[*]) - 3)))
    Any suggestions will be greatly appreciated.
    Thanks.

Maybe you are looking for

  • HT1766 I have problem in my 4s I phone no sim

    Hi I have problem with my 4S I phone always give me no sim install i did every thing change the sim and clean the port the sim card working in another phones very good without any problems i try to reset the software by recovery and same problem now

  • Accessing external web service with non-constant URL

    Hello, all I am looking in the documentation on accessing external web services, but either I am looking in the wrong place, or the documentatoin is lacking info. My clients have several web services in the local network (regular services, not DB-bas

  • Problem with the performance assistant

    For the past few days, I have not been able to see nothing on the performance assistant pop-up screen while my collegues are able to see it. What is wrong with my SAP screen? Is there any setting to be made for the SAP GUI? Please help me asap.

  • I can not make AirDrop work, any help?

    I tried to use AirDrop among my Imac and my MacBook pro, they do n ot let me select the files, so I can not trasnsfer them Any help?

  • IPod Touch 2.0 location problem...

    Downloaded 2.0 and loving it. Discovered one problem I cannot figure out how to fix. I have searched everywhere for an answer, but haven't seen this yet. I have had a few new apps ask if they can use my current location. When I answer yes to them, it