<?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 colwidth_optimize not working for alv grid report in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/colwidth-optimize-not-working-for-alv-grid-report/m-p/7918450#M1598483</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         I have developed an ALV grid report using 'REUSE_ALV_GRID_DISPLAY'.  The field catalog field columns are having the heading size more than 30 characters. So, to optimize the size of the headings, I am using SLIS_LAYOUT_ALV  and passing the value 'X' to colwidth_optimize.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but still the column heading is not getting fully display. Rather it is display first 20 characters only.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For your reference please find the code snippet &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
*bold* **************** declarations ************************ *bold*
DATA : fieldcat       TYPE slis_fieldcat_alv,
             t_fieldcat     TYPE slis_t_fieldcat_alv,
            ws_layout      TYPE slis_layout_alv.
            


*bold* **************** field catalogue ********************** *bold*
  CLEAR fieldcat.
  fieldcat-fieldname     = 'RFWRT_PD_MTRL'.
  fieldcat-seltext_m = 'Pending Quotation Spares Value'.   {quote} this heading not getting fully displayed {quote}
  fieldcat-tabname       = 'IT_FNL'.
***    FIELDCAT-REF_TABNAME   = 'VBFA'.
  fieldcat-col_pos       = col_pos.
  APPEND fieldcat TO t_fieldcat.
  ADD 1 TO col_pos.

  CLEAR fieldcat.
  fieldcat-fieldname     = 'RFWRT_PD_SERV'.
  fieldcat-seltext_m = 'Pend Quot-JobWorkVal'.
  fieldcat-tabname       = 'IT_FNL'.
  fieldcat-col_pos       = col_pos.
  APPEND fieldcat TO t_fieldcat.
  ADD 1 TO col_pos.


  ws_layout-colwidth_optimize = 'X'.


*bold* ****************************** alv grid function call ******************** *bold*
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
   EXPORTING
*    i_buffer_active                         = space
      i_callback_program                  = sy-repid
     i_callback_user_command        = 'USER_COMMAND'
***   i_callback_pf_status_set           = 'PF_STATUS'
*   I_STRUCTURE_NAME                  =
     it_fieldcat                        = t_fieldcat[]
     is_layout                          =  ws_layout
    TABLES
      t_outtab                          = it_fnl
   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.


  CLEAR wa_fnl.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please look into it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Searched the forum for the similar issue. but didnt got any solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Murali Krishna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 24 Jun 2011 11:31:08 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-06-24T11:31:08Z</dc:date>
    <item>
      <title>colwidth_optimize not working for alv grid report</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/colwidth-optimize-not-working-for-alv-grid-report/m-p/7918450#M1598483</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         I have developed an ALV grid report using 'REUSE_ALV_GRID_DISPLAY'.  The field catalog field columns are having the heading size more than 30 characters. So, to optimize the size of the headings, I am using SLIS_LAYOUT_ALV  and passing the value 'X' to colwidth_optimize.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but still the column heading is not getting fully display. Rather it is display first 20 characters only.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For your reference please find the code snippet &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
*bold* **************** declarations ************************ *bold*
DATA : fieldcat       TYPE slis_fieldcat_alv,
             t_fieldcat     TYPE slis_t_fieldcat_alv,
            ws_layout      TYPE slis_layout_alv.
            


*bold* **************** field catalogue ********************** *bold*
  CLEAR fieldcat.
  fieldcat-fieldname     = 'RFWRT_PD_MTRL'.
  fieldcat-seltext_m = 'Pending Quotation Spares Value'.   {quote} this heading not getting fully displayed {quote}
  fieldcat-tabname       = 'IT_FNL'.
***    FIELDCAT-REF_TABNAME   = 'VBFA'.
  fieldcat-col_pos       = col_pos.
  APPEND fieldcat TO t_fieldcat.
  ADD 1 TO col_pos.

  CLEAR fieldcat.
  fieldcat-fieldname     = 'RFWRT_PD_SERV'.
  fieldcat-seltext_m = 'Pend Quot-JobWorkVal'.
  fieldcat-tabname       = 'IT_FNL'.
  fieldcat-col_pos       = col_pos.
  APPEND fieldcat TO t_fieldcat.
  ADD 1 TO col_pos.


  ws_layout-colwidth_optimize = 'X'.


*bold* ****************************** alv grid function call ******************** *bold*
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
   EXPORTING
*    i_buffer_active                         = space
      i_callback_program                  = sy-repid
     i_callback_user_command        = 'USER_COMMAND'
***   i_callback_pf_status_set           = 'PF_STATUS'
*   I_STRUCTURE_NAME                  =
     it_fieldcat                        = t_fieldcat[]
     is_layout                          =  ws_layout
    TABLES
      t_outtab                          = it_fnl
   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.


  CLEAR wa_fnl.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please look into it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Searched the forum for the similar issue. but didnt got any solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Murali Krishna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jun 2011 11:31:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/colwidth-optimize-not-working-for-alv-grid-report/m-p/7918450#M1598483</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-24T11:31:08Z</dc:date>
    </item>
    <item>
      <title>Re: colwidth_optimize not working for alv grid report</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/colwidth-optimize-not-working-for-alv-grid-report/m-p/7918451#M1598484</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you've used seltext_m instead of seltext_l...seltext_m is 20 characters.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jun 2011 12:02:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/colwidth-optimize-not-working-for-alv-grid-report/m-p/7918451#M1598484</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-24T12:02:54Z</dc:date>
    </item>
    <item>
      <title>Re: colwidth_optimize not working for alv grid report</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/colwidth-optimize-not-working-for-alv-grid-report/m-p/7918452#M1598485</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi DaveL,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks alot for your help. My problem solved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please suggest me how we can optimize the column based on the total amount which is summed up (fieldcat-do_sum)&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;&lt;/P&gt;&lt;P&gt;Murali.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 09 Jul 2011 09:46:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/colwidth-optimize-not-working-for-alv-grid-report/m-p/7918452#M1598485</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-07-09T09:46:29Z</dc:date>
    </item>
  </channel>
</rss>

