<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic using checkboxes in ALV_LIST in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-checkboxes-in-alv-list/m-p/1503125#M232753</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;i'm trying to checkbox in  a ALV_LIST funtion module.&lt;/P&gt;&lt;P&gt;Also i have added the following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : begin of i_list occurs 0,&lt;/P&gt;&lt;P&gt;         Box(1) ,&lt;/P&gt;&lt;P&gt;        ......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form f_layout_data .&lt;/P&gt;&lt;P&gt;       clear p_gs_layout.&lt;/P&gt;&lt;P&gt;       p_gs_layout-box_fieldname       =  'MATNR'.&lt;/P&gt;&lt;P&gt;       p_gs_layout-box_tabname         =  'I_LIST'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'&lt;/P&gt;&lt;P&gt; EXPORTING&lt;/P&gt;&lt;P&gt;   IS_LAYOUT                      =  gs_layout&lt;/P&gt;&lt;P&gt;   IT_FIELDCAT                    =  gt_fieldcat[]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but the list shows the checkboxes, but when clicking the boxes it is not marked as checked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 04 Aug 2006 05:57:13 GMT</pubDate>
    <dc:creator>govind_parmar</dc:creator>
    <dc:date>2006-08-04T05:57:13Z</dc:date>
    <item>
      <title>using checkboxes in ALV_LIST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-checkboxes-in-alv-list/m-p/1503125#M232753</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;i'm trying to checkbox in  a ALV_LIST funtion module.&lt;/P&gt;&lt;P&gt;Also i have added the following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : begin of i_list occurs 0,&lt;/P&gt;&lt;P&gt;         Box(1) ,&lt;/P&gt;&lt;P&gt;        ......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form f_layout_data .&lt;/P&gt;&lt;P&gt;       clear p_gs_layout.&lt;/P&gt;&lt;P&gt;       p_gs_layout-box_fieldname       =  'MATNR'.&lt;/P&gt;&lt;P&gt;       p_gs_layout-box_tabname         =  'I_LIST'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'&lt;/P&gt;&lt;P&gt; EXPORTING&lt;/P&gt;&lt;P&gt;   IS_LAYOUT                      =  gs_layout&lt;/P&gt;&lt;P&gt;   IT_FIELDCAT                    =  gt_fieldcat[]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but the list shows the checkboxes, but when clicking the boxes it is not marked as checked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Aug 2006 05:57:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-checkboxes-in-alv-list/m-p/1503125#M232753</guid>
      <dc:creator>govind_parmar</dc:creator>
      <dc:date>2006-08-04T05:57:13Z</dc:date>
    </item>
    <item>
      <title>Re: using checkboxes in ALV_LIST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-checkboxes-in-alv-list/m-p/1503126#M232754</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just change,&lt;/P&gt;&lt;P&gt;p_gs_layout-box_fieldname = 'BOX'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and remove&lt;/P&gt;&lt;P&gt;p_gs_layout-box_tabname = 'I_LIST'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And in fieldcatalog,&lt;/P&gt;&lt;P&gt;  IF P_FIELDNAME = 'BOX'.&lt;/P&gt;&lt;P&gt;    ST_FIELDCAT-CHECKBOX = 'X'.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Naimesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Aug 2006 06:01:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-checkboxes-in-alv-list/m-p/1503126#M232754</guid>
      <dc:creator>naimesh_patel</dc:creator>
      <dc:date>2006-08-04T06:01:18Z</dc:date>
    </item>
    <item>
      <title>Re: using checkboxes in ALV_LIST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-checkboxes-in-alv-list/m-p/1503127#M232755</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Govind,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check this report it contains checkboxes in alv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&amp;lt;b&amp;gt;REPORT ZWA_FI_ANNUAL_REPORT .
TYPE-POOLS: slis.
TABLES: BKPF, BSIS, PAYR.

TYPES: begin of itab_post_type,

           bukrs type bkpf-bukrs,
           belnr type bkpf-belnr,
           gjahr type bkpf-gjahr,

           blart type bkpf-blart,
           bstat type bkpf-bstat,

           hkont type bsis-hkont,
           shkzg type bsis-shkzg,
           wrbtr type bsis-wrbtr,



       end of itab_post_type.

DATA: begin of itab_post occurs 0,

           bukrs like bkpf-bukrs,
           belnr like bkpf-belnr,
           gjahr like bkpf-gjahr,

           blart like bkpf-blart,
           bstat like bkpf-bstat,

           hkont like bsis-hkont,
           shkzg like bsis-shkzg,
           wrbtr like bsis-wrbtr,
           flag(1),



       end of itab_post.
*DATA: itab_post type standard table of itab_post_type INITIAL SIZE 0
*with header line.
data: fm_name TYPE rs38l_fnam.

data v_repid like sy-repid.

DATA: it_fieldcat TYPE slis_t_fieldcat_alv WITH HEADER LINE,
      heading  TYPE slis_t_listheader,
      gs_layout  TYPE slis_layout_alv,
      gx_variant LIKE disvariant,
      g_variant  LIKE disvariant,
      g_exit(1) TYPE c,
      g_save(1) TYPE c,
      gt_list_top_of_page TYPE slis_t_listheader,
      gt_events   TYPE slis_t_event,
      olen TYPE i,
      pageno TYPE n,
      filename LIKE sy-repid.
DATA: IT_EXCL_BUTT type SLIS_T_EXTAB.
data: wa_excl_buttons type SLIS_EXTAB.
data: header type slis_keyinfo_alv.
data: wa_header type slis_keyinfo_alv.

v_repid = sy-repid.

"-----------------------------------------------"
" Selection screen for entering search criteria "
"-----------------------------------------------"
select-options:bukrs for bsis-bukrs,
               gjahr for bkpf-gjahr,
               prctr for bsis-prctr,
               kostl for bsis-kostl,
               belnr for bsis-belnr,
               budat for bsis-budat,
               bldat for bkpf-bldat,
               hkont for bsis-hkont,
               blart for bkpf-blart,
               uname for bkpf-usnam.

SELECT bk~bukrs bk~belnr
       bk~gjahr bk~blart
       bk~bstat bs~hkont
       bs~shkzg bs~wrbtr
*INTO TABLE itab_post
INTO    (itab_post-bukrs, itab_post-belnr,
         itab_post-gjahr, itab_post-blart,
         itab_post-bstat, itab_post-hkont,
         itab_post-shkzg, itab_post-wrbtr )

FROM bkpf as bk
JOIN bsis as bs
ON  ( bk~belnr = bs~belnr AND
      bk~bukrs = bs~bukrs AND
      bk~gjahr = bs~gjahr )
WHERE bk~belnr IN belnr AND
      bk~gjahr IN gjahr AND
      bk~bukrs IN bukrs AND
      bk~blart IN blart AND
      bk~bldat IN bldat AND
      bk~usnam IN uname AND
      bs~hkont IN hkont AND
      bs~kostl IN kostl.

  append itab_post.
ENDSELECT.


PERFORM field_catalog.


gs_layout-box_fieldname = 'FLAG'.

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
       EXPORTING
            i_callback_program = sy-repid
            i_callback_user_command = 'ITAB_USER_COMMAND'
            is_layout          = gs_layout
            i_background_id    ='CGA'
            i_grid_title       ='Employee Cheque Advice'

            it_fieldcat        = it_fieldcat[]
            i_save             = g_save
            is_variant         = g_variant
            it_events          = gt_events[]
       TABLES
            t_outtab           = itab_post
       EXCEPTIONS
            program_error      = 1
            OTHERS             = 2.
IF sy-subrc &amp;lt;&amp;gt; 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

**
**ENDLOOP.
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  field_catalog
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --&amp;gt;  p1        text
*  &amp;lt;--  p2        text
*----------------------------------------------------------------------*
FORM field_catalog.


*There are other fields in this structure and can be used accordingly
*for different purposes like no_zero, round, no_sign etc.
  DATA: wa_fieldcat TYPE slis_fieldcat_alv.

  call function 'REUSE_ALV_FIELDCATALOG_MERGE'
  exporting
  i_program_name = v_repid
  i_internal_tabname = 'ITAB_POST'
* I_STRUCTURE_NAME =
* I_CLIENT_NEVER_DISPLAY = 'X'
  i_inclname = v_repid
* I_BYPASSING_BUFFER =
* I_BUFFER_ACTIVE =
  changing
  ct_fieldcat = it_fieldcat[] .



  ENDFORM.                    " field_catalog



*---------------------------------------------------------------------*
*       FORM itab_user_command                                        *
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
*  --&amp;gt;  WHATCOMM                                                      *
*  --&amp;gt;  WHATROW                                                       *
*---------------------------------------------------------------------*
FORM itab_user_command USING whatcomm TYPE sy-ucomm whatrow TYPE
slis_selfield.


  LOOP AT itab_post.
    itab_post-flag = 'X'.
    MODIFY itab_post.
  ENDLOOP.


*--------- IMPORTANT.
  WHATROW-REFRESH = 'X'.


ENDFORM. "ITAB_user_command&amp;lt;/b&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Wasim Ahmed&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Aug 2006 06:02:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-checkboxes-in-alv-list/m-p/1503127#M232755</guid>
      <dc:creator>dani_mn</dc:creator>
      <dc:date>2006-08-04T06:02:09Z</dc:date>
    </item>
    <item>
      <title>Re: using checkboxes in ALV_LIST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/using-checkboxes-in-alv-list/m-p/1503128#M232756</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi govind,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Minor Mistake&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. it should be&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;p_gs_layout-box_fieldname = &amp;lt;b&amp;gt; 'BOX'.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and not&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;p_gs_layout-box_fieldname = 'MATNR'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BCOS the extra field for checkbox is BOX&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. But since u had passed it as MATNR,&lt;/P&gt;&lt;P&gt;   it was not allowing to select the checkbox&lt;/P&gt;&lt;P&gt;  bcos the MATNR value was something&lt;/P&gt;&lt;P&gt;  which corresponded to DISABLED CHECKBOX&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;amit m.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Aug 2006 06:35:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/using-checkboxes-in-alv-list/m-p/1503128#M232756</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-04T06:35:12Z</dc:date>
    </item>
  </channel>
</rss>

