<?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 ALV display ? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-display/m-p/2373192#M525950</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;                  I have a requirement wher i have to display a amount value for each week from the date mentioned. How do i dynamically decide the number of columns in ALV. if for example user enters todays date and enters 2 weeks i shud display the amount for 2 weeks only . Also how do i display two headers for one alv dipslay .For example my first header will hv week1 week2 ...and second header(below the first one) will have amount and receipts for the week1 and then week2 so on. Any sample code will be very helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly help,&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Ashwin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 Jun 2007 07:27:32 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-06-19T07:27:32Z</dc:date>
    <item>
      <title>ALV display ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-display/m-p/2373192#M525950</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;                  I have a requirement wher i have to display a amount value for each week from the date mentioned. How do i dynamically decide the number of columns in ALV. if for example user enters todays date and enters 2 weeks i shud display the amount for 2 weeks only . Also how do i display two headers for one alv dipslay .For example my first header will hv week1 week2 ...and second header(below the first one) will have amount and receipts for the week1 and then week2 so on. Any sample code will be very helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly help,&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Ashwin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jun 2007 07:27:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-display/m-p/2373192#M525950</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-19T07:27:32Z</dc:date>
    </item>
    <item>
      <title>Re: ALV display ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-display/m-p/2373193#M525951</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do a get_column for the column you wish to display. It will return you a column reference. On this, if you do a set_technical( ), then the column will not be displayed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can set the header of the column at run time by calling lr_column-&amp;gt;set_short_text. Thereby each time, the same column will have different headers. Hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jun 2007 07:29:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-display/m-p/2373193#M525951</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-19T07:29:50Z</dc:date>
    </item>
    <item>
      <title>Re: ALV display ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-display/m-p/2373194#M525952</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;for this u need to build the internal table dynamically ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then populate the vauels also in that table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after populating the values in the interanl table pass that to the ALV function module.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i hve one document about building the internal table dynamically&lt;/P&gt;&lt;P&gt;if u want send me u r mail id i wil send that document to u ..&lt;/P&gt;&lt;P&gt;my mail id is &lt;/P&gt;&lt;P&gt;jayakumar.t@arteriatech.com&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks and regards&lt;/P&gt;&lt;P&gt;JK&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jun 2007 07:34:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-display/m-p/2373194#M525952</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-19T07:34:45Z</dc:date>
    </item>
    <item>
      <title>Re: ALV display ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-display/m-p/2373195#M525953</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi &lt;/P&gt;&lt;P&gt;This can be achieved using ALV using classes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. use the container class CL_GUI_CUSTOM_CONTAINER , create a screen with custom control.&lt;/P&gt;&lt;P&gt;2. create a reference variable of class cl_gui_alv_grid&lt;/P&gt;&lt;P&gt;3. call the methods of the class set_table_for_first_display and pass the itab contents.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sample code.&lt;/P&gt;&lt;P&gt;*-- Global data definitions for ALV&lt;/P&gt;&lt;P&gt;*--- ALV Grid instance reference&lt;/P&gt;&lt;P&gt;DATA gr_alvgrid TYPE REF TO cl_gui_alv_grid .&lt;/P&gt;&lt;P&gt;*--- Name of the custom control added on the screen&lt;/P&gt;&lt;P&gt;DATA gc_custom_control_name TYPE scrfname VALUE &amp;#145;CC_ALV&amp;#146; .&lt;/P&gt;&lt;P&gt;*--- Custom container instance reference&lt;/P&gt;&lt;P&gt;DATA gr_ccontainer TYPE REF TO cl_gui_custom_container .&lt;/P&gt;&lt;P&gt;*--- Field catalog table&lt;/P&gt;&lt;P&gt;DATA gt_fieldcat TYPE lvc_t_fcat .&lt;/P&gt;&lt;P&gt;*--- Layout structure&lt;/P&gt;&lt;P&gt;DATA gs_layout TYPE lvc_s_layo .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF gr_alvgrid IS INITIAL .&lt;/P&gt;&lt;P&gt;*----Creating custom container instance&lt;/P&gt;&lt;P&gt;CREATE OBJECT gr_ccontainer&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;container_name = gc_custom_control_name&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----Creating ALV Grid instance&lt;/P&gt;&lt;P&gt;CREATE OBJECT gr_alvgrid&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;i_parent = gr_ccontainer&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----Preparing field catalog.&lt;/P&gt;&lt;P&gt;PERFORM prepare_field_catalog CHANGING gt_fieldcat .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----Preparing layout structure&lt;/P&gt;&lt;P&gt;PERFORM prepare_layout CHANGING gs_layout .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----Here will be additional preparations&lt;/P&gt;&lt;P&gt;*--e.g. initial sorting criteria, initial filtering criteria, excluding&lt;/P&gt;&lt;P&gt;*--functions&lt;/P&gt;&lt;P&gt;CALL METHOD gr_alvgrid-&amp;gt;set_table_for_first_display&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;is_layout = gs_layout&lt;/P&gt;&lt;P&gt;CHANGING&lt;/P&gt;&lt;P&gt;it_outtab = gt_list[]&lt;/P&gt;&lt;P&gt;it_fieldcatalog = gt_fieldcat&lt;/P&gt;&lt;P&gt;ENDIF .&lt;/P&gt;&lt;P&gt;ENDFORM .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM prepare_field_catalog CHANGING pt_fieldcat TYPE lvc_t_fcat .&lt;/P&gt;&lt;P&gt;DATA ls_fcat type lvc_s_fcat .&lt;/P&gt;&lt;P&gt;ls_fcat-fieldname = 'CARRID' .&lt;/P&gt;&lt;P&gt;ls_fcat-inttype = 'C' .&lt;/P&gt;&lt;P&gt;ls_fcat-outputlen = '3' .&lt;/P&gt;&lt;P&gt;ls_fcat-coltext = 'Carrier ID' .&lt;/P&gt;&lt;P&gt;ls_fcat-seltext = 'Carrier ID' .&lt;/P&gt;&lt;P&gt;APPEND ls_fcat to pt_fieldcat .&lt;/P&gt;&lt;P&gt;CLEAR ls_fcat .&lt;/P&gt;&lt;P&gt;ls_fcat-fieldname = 'CONNID' .&lt;/P&gt;&lt;P&gt;ls_fcat-ref_table = 'SFLIGHT' .&lt;/P&gt;&lt;P&gt;ls_fcat-ref_table = 'CONNID' .&lt;/P&gt;&lt;P&gt;ls_fcat-outputlen = '3' .&lt;/P&gt;&lt;P&gt;ls_fcat-coltext = 'Connection ID' .&lt;/P&gt;&lt;P&gt;ls_fcat-seltext = 'Connection ID' .&lt;/P&gt;&lt;P&gt;APPEND ls_fcat to pt_fieldcat .&lt;/P&gt;&lt;P&gt;ENDFORM .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**********changing the columns of the fieldcatalog&lt;/P&gt;&lt;P&gt;FORM prepare_field_catalog CHANGING pt_fieldcat TYPE lvc_t_fcat .&lt;/P&gt;&lt;P&gt;DATA ls_fcat type lvc_s_fcat .&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;i_structure_name = 'SFLIGHT'&lt;/P&gt;&lt;P&gt;CHANGING&lt;/P&gt;&lt;P&gt;ct_fieldcat = pt_fieldcat[]&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;inconsistent_interface = 1&lt;/P&gt;&lt;P&gt;program_error = 2&lt;/P&gt;&lt;P&gt;OTHERS = 3.&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;*--Exception handling&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;LOOP AT pt_fieldcat INTO ls_fcat .&lt;/P&gt;&lt;P&gt;CASE pt_fieldcat-fieldname .&lt;/P&gt;&lt;P&gt;WHEN 'CARRID' .&lt;/P&gt;&lt;P&gt;ls_fcat-outpulen = '10' .&lt;/P&gt;&lt;P&gt;ls_fcat-coltext = 'Airline Carrier ID' .&lt;/P&gt;&lt;P&gt;MODIFY pt_fieldcat FROM ls_fcat .&lt;/P&gt;&lt;P&gt;WHEN 'PAYMENTSUM' .&lt;/P&gt;&lt;P&gt;ls_fcat-no_out = 'X' .&lt;/P&gt;&lt;P&gt;MODIFY pt_fieldcat FROM ls_fcat .&lt;/P&gt;&lt;P&gt;ENDCASE .&lt;/P&gt;&lt;P&gt;ENDLOOP .&lt;/P&gt;&lt;P&gt;ENDFORM .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this solves ur problem....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;do reward if useful....&amp;lt;/b&amp;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;dinesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jun 2007 07:37:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-display/m-p/2373195#M525953</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-19T07:37:36Z</dc:date>
    </item>
  </channel>
</rss>

