<?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 Re: Column Width for Check Box in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/column-width-for-check-box/m-p/2194475#M468236</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please find code PBO call&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
form f_create_and_init_alv.
  data: lt_exclude type ui_functions.
  create object g_custom_container
         exporting container_name = g_container.
  create object g_grid
         exporting i_parent = g_custom_container.

  perform f_build_fieldcat changing gt_fieldcat.
  perform f_build_data.
  if p_input eq c_x.
    v_input = 0.
  else.
    v_input = 1.
  endif.
  set titlebar sy-dynnr with p_netwk.
  gs_layout-stylefname = 'CELLTAB'.
  gs_layout-sel_mode      = c_a.
  gs_layout-cwidth_opt    = c_x.
  gs_layout-zebra         = c_x.

  call method g_grid-&amp;gt;set_table_for_first_display
    exporting
      is_layout            = gs_layout
      i_save               = 'A'
      it_toolbar_excluding = i_exclude[]
    changing
      it_fieldcatalog      = gt_fieldcat[]
      it_outtab            = &amp;lt;i_hts&amp;gt;[].
  call method g_grid-&amp;gt;set_ready_for_input
    exporting
      i_ready_for_input = v_input.

  call method g_grid-&amp;gt;refresh_table_display.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code for form f_build_fieldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
form f_build_fieldcat changing pt_fieldcat type lvc_t_fcat.
  refresh pt_fieldcat.
  data ls_fcat type lvc_s_fcat.
  data p_out type c.
  if v_vflg eq c_a.
    p_out = c_x.
  else.
    clear p_out.
  endif.

  ls_fcat-tabname    = text-007.
  ls_fcat-fieldname  = text-008.
  ls_fcat-ref_field  = text-009.
  ls_fcat-ref_table  = 'Z012798'.
  ls_fcat-datatype   = 'CHAR'.
  ls_fcat-coltext    = text-003.
  ls_fcat-tooltip    = text-003.
  ls_fcat-seltext    = text-003.
  ls_fcat-fix_column = c_x.
  ls_fcat-col_opt   = c_x.
  append ls_fcat to pt_fieldcat.
  clear  ls_fcat.

   select * from ynetstat into ynetstat where status in s_stat.
    clear ls_fcat.
    ls_fcat-ref_field = 'STATUS'.
    ls_fcat-ref_table = 'YNETSTAT'.

    ls_fcat-fieldname = ynetstat-status.
    ls_fcat-datatype  = 'CHAR'.
    ls_fcat-checkbox  = c_x.
    ls_fcat-edit      = c_x.
    ls_fcat-coltext   = ynetstat-status.
    ls_fcat-outputlen = 2.
    append ls_fcat to pt_fieldcat.
  endselect.
  describe table pt_fieldcat lines v_rows.
  call method cl_alv_table_create=&amp;gt;create_dynamic_table
    exporting
      it_fieldcatalog = pt_fieldcat
    importing
      ep_table        = g_hts.
  assign g_hts-&amp;gt;* to &amp;lt;i_hts&amp;gt;.

* Create a dummy
  call method cl_alv_table_create=&amp;gt;create_dynamic_table
    exporting
      it_fieldcatalog = pt_fieldcat
    importing
      ep_table        = g_hts.
  assign g_hts-&amp;gt;* to &amp;lt;i_hts1&amp;gt;.

  select * from yfe075
      into corresponding fields of table &amp;lt;i_hts&amp;gt;
      where network eq p_netwk
        and status in s_stat.
endform.                                 " F_build_fieldcat

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By declaring outputlen = 2 also system giving the column width for checkbox is showing 8.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thnaks&lt;/P&gt;&lt;P&gt;aRs&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 Apr 2007 17:31:39 GMT</pubDate>
    <dc:creator>former_member194669</dc:creator>
    <dc:date>2007-04-30T17:31:39Z</dc:date>
    <item>
      <title>Column Width for Check Box</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/column-width-for-check-box/m-p/2194471#M468232</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a ALV report (OOp) within i have column as checkbox. The heading for this column is of length 2. But while in report display system showing this column as displaying the length of 8 character width.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have already check the following paratmers :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gt_fieldcatalog-outputlen = 3&lt;/P&gt;&lt;P&gt;gt_fieldcatalog-col_opt   = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gs_layout-cwidth_opt    = 'X'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After setting above said parameters still system is showing 8 character width of column&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any info?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;aRs&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Apr 2007 16:12:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/column-width-for-check-box/m-p/2194471#M468232</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2007-04-30T16:12:19Z</dc:date>
    </item>
    <item>
      <title>Re: Column Width for Check Box</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/column-width-for-check-box/m-p/2194472#M468233</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;If the field is referred to the Dictionary field, then the length will come for that Dctionary field ..&lt;/P&gt;&lt;P&gt;look at the below link, This link will have all the field catalog fields  ..&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_erp2004/helpdata/en/ff/4649a6f17411d2b486006094192fe3/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_erp2004/helpdata/en/ff/4649a6f17411d2b486006094192fe3/content.htm&lt;/A&gt;&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; Sudheer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Apr 2007 16:39:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/column-width-for-check-box/m-p/2194472#M468233</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-30T16:39:44Z</dc:date>
    </item>
    <item>
      <title>Re: Column Width for Check Box</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/column-width-for-check-box/m-p/2194473#M468234</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It field declared as checkbox is dictionary field and have a length 2. But i don't figure why it is showing length of 8 as column width?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;aRs&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Apr 2007 16:45:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/column-width-for-check-box/m-p/2194473#M468234</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2007-04-30T16:45:27Z</dc:date>
    </item>
    <item>
      <title>Re: Column Width for Check Box</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/column-width-for-check-box/m-p/2194474#M468235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you paste all the field catalog entries for that field ? also, while debugging check whether any field whoch is not cleared is affecting it ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Apr 2007 17:25:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/column-width-for-check-box/m-p/2194474#M468235</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-30T17:25:26Z</dc:date>
    </item>
    <item>
      <title>Re: Column Width for Check Box</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/column-width-for-check-box/m-p/2194475#M468236</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please find code PBO call&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
form f_create_and_init_alv.
  data: lt_exclude type ui_functions.
  create object g_custom_container
         exporting container_name = g_container.
  create object g_grid
         exporting i_parent = g_custom_container.

  perform f_build_fieldcat changing gt_fieldcat.
  perform f_build_data.
  if p_input eq c_x.
    v_input = 0.
  else.
    v_input = 1.
  endif.
  set titlebar sy-dynnr with p_netwk.
  gs_layout-stylefname = 'CELLTAB'.
  gs_layout-sel_mode      = c_a.
  gs_layout-cwidth_opt    = c_x.
  gs_layout-zebra         = c_x.

  call method g_grid-&amp;gt;set_table_for_first_display
    exporting
      is_layout            = gs_layout
      i_save               = 'A'
      it_toolbar_excluding = i_exclude[]
    changing
      it_fieldcatalog      = gt_fieldcat[]
      it_outtab            = &amp;lt;i_hts&amp;gt;[].
  call method g_grid-&amp;gt;set_ready_for_input
    exporting
      i_ready_for_input = v_input.

  call method g_grid-&amp;gt;refresh_table_display.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code for form f_build_fieldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
form f_build_fieldcat changing pt_fieldcat type lvc_t_fcat.
  refresh pt_fieldcat.
  data ls_fcat type lvc_s_fcat.
  data p_out type c.
  if v_vflg eq c_a.
    p_out = c_x.
  else.
    clear p_out.
  endif.

  ls_fcat-tabname    = text-007.
  ls_fcat-fieldname  = text-008.
  ls_fcat-ref_field  = text-009.
  ls_fcat-ref_table  = 'Z012798'.
  ls_fcat-datatype   = 'CHAR'.
  ls_fcat-coltext    = text-003.
  ls_fcat-tooltip    = text-003.
  ls_fcat-seltext    = text-003.
  ls_fcat-fix_column = c_x.
  ls_fcat-col_opt   = c_x.
  append ls_fcat to pt_fieldcat.
  clear  ls_fcat.

   select * from ynetstat into ynetstat where status in s_stat.
    clear ls_fcat.
    ls_fcat-ref_field = 'STATUS'.
    ls_fcat-ref_table = 'YNETSTAT'.

    ls_fcat-fieldname = ynetstat-status.
    ls_fcat-datatype  = 'CHAR'.
    ls_fcat-checkbox  = c_x.
    ls_fcat-edit      = c_x.
    ls_fcat-coltext   = ynetstat-status.
    ls_fcat-outputlen = 2.
    append ls_fcat to pt_fieldcat.
  endselect.
  describe table pt_fieldcat lines v_rows.
  call method cl_alv_table_create=&amp;gt;create_dynamic_table
    exporting
      it_fieldcatalog = pt_fieldcat
    importing
      ep_table        = g_hts.
  assign g_hts-&amp;gt;* to &amp;lt;i_hts&amp;gt;.

* Create a dummy
  call method cl_alv_table_create=&amp;gt;create_dynamic_table
    exporting
      it_fieldcatalog = pt_fieldcat
    importing
      ep_table        = g_hts.
  assign g_hts-&amp;gt;* to &amp;lt;i_hts1&amp;gt;.

  select * from yfe075
      into corresponding fields of table &amp;lt;i_hts&amp;gt;
      where network eq p_netwk
        and status in s_stat.
endform.                                 " F_build_fieldcat

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By declaring outputlen = 2 also system giving the column width for checkbox is showing 8.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thnaks&lt;/P&gt;&lt;P&gt;aRs&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Apr 2007 17:31:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/column-width-for-check-box/m-p/2194475#M468236</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2007-04-30T17:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: Column Width for Check Box</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/column-width-for-check-box/m-p/2194476#M468237</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;multiple points of confusion..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I agree that i_hts has a field for status .. but what is it populated with ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;looking at your code, i assume, the check box field is showing contents (assuming properties) of the field which is displayed just before that column.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is this correct ?   ls_fcat-fieldname = ynetstat-status.  i doubt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try changing it to &lt;/P&gt;&lt;P&gt;ls_fcat-fieldname = 'STATUS'. &lt;/P&gt;&lt;P&gt;ls_fcat-tabname  = 'YNETSTAT'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but, how can the system know, the values of ynetstat-status  ? cos, the itab which u pass is i_hts .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Apr 2007 17:47:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/column-width-for-check-box/m-p/2194476#M468237</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-30T17:47:31Z</dc:date>
    </item>
    <item>
      <title>Re: Column Width for Check Box</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/column-width-for-check-box/m-p/2194477#M468238</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My field catalog is like &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
   FIELDNAME                       CHECKBOX           OUTPUTLEN
                                                              
 YFIELDNAME                     |                  |000000    
 CR                             |X                 |000002    
 A2                             |X                 |000002    
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and &amp;lt;i_hts&amp;gt; looks like&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
YFIELDNAME                     A2 AE AP C5 C6 C7 CA CC CE CR
                                                            
NUMOVL                        |X |  |  |  |  |  |  |  |  |   
LOADRANGE                     |  |  |  |  |  |  |  |  |  |X   

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;aRs.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Apr 2007 17:55:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/column-width-for-check-box/m-p/2194477#M468238</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2007-04-30T17:55:35Z</dc:date>
    </item>
    <item>
      <title>Re: Column Width for Check Box</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/column-width-for-check-box/m-p/2194478#M468239</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for second line in field catalog,  fieldname = 'CR', . that means, while executing, it will look into table &amp;lt;i_hts&amp;gt; for contents of a field named, CR to display under this column. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But we dont have a field named CR in that table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have noticed many time,s that when a field which a field catalog refers to is missing, it just display one of the previous field in that internal table.  I guess that is what happening in ur case.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Apr 2007 19:22:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/column-width-for-check-box/m-p/2194478#M468239</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-30T19:22:32Z</dc:date>
    </item>
    <item>
      <title>Re: Column Width for Check Box</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/column-width-for-check-box/m-p/2194479#M468240</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here fieldcatalog contains not all the field are available in the &amp;lt;i_hts&amp;gt; table. Here &amp;lt;i_hts&amp;gt; may contains more fields that all fields are not mandatory to be available in fieldcatalog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;valere nanni.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;aRs&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Apr 2007 20:10:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/column-width-for-check-box/m-p/2194479#M468240</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2007-04-30T20:10:56Z</dc:date>
    </item>
    <item>
      <title>Re: Column Width for Check Box</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/column-width-for-check-box/m-p/2194480#M468241</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you may forget about all the fieldcatalog hassle. Use the ALV Object Model (cl_salv_table) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Apr 2007 21:55:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/column-width-for-check-box/m-p/2194480#M468241</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2007-04-30T21:55:13Z</dc:date>
    </item>
  </channel>
</rss>

