<?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 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/1101683#M103641</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 wanted to write a report with two selection-screen blocks...fo example..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; selection-screen begin of block1.&lt;/P&gt;&lt;P&gt;        s_matnr for mara-matnr.&lt;/P&gt;&lt;P&gt;        -&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt;        -&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt; selecion-screen end of block1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; selection-screen begin of block2.&lt;/P&gt;&lt;P&gt;        s_kunnr for knc1-kunnr.&lt;/P&gt;&lt;P&gt;        -&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt;        -&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; selecion-screen end of block2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In ALV&lt;/P&gt;&lt;P&gt;if i select block1 select-options i'll get one result.&lt;/P&gt;&lt;P&gt;if i select block2 select-options i'll get anoter result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can tell me the how to write the code in ALV grid and send me if u have any sample code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;raju.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 17 Oct 2005 08:19:25 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-10-17T08:19:25Z</dc:date>
    <item>
      <title>ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/1101683#M103641</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 wanted to write a report with two selection-screen blocks...fo example..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; selection-screen begin of block1.&lt;/P&gt;&lt;P&gt;        s_matnr for mara-matnr.&lt;/P&gt;&lt;P&gt;        -&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt;        -&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt; selecion-screen end of block1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; selection-screen begin of block2.&lt;/P&gt;&lt;P&gt;        s_kunnr for knc1-kunnr.&lt;/P&gt;&lt;P&gt;        -&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt;        -&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; selecion-screen end of block2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In ALV&lt;/P&gt;&lt;P&gt;if i select block1 select-options i'll get one result.&lt;/P&gt;&lt;P&gt;if i select block2 select-options i'll get anoter result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can tell me the how to write the code in ALV grid and send me if u have any sample code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;raju.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Oct 2005 08:19:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/1101683#M103641</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-17T08:19:25Z</dc:date>
    </item>
    <item>
      <title>Re: ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/1101684#M103642</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;try with this&lt;/P&gt;&lt;P&gt;data : itab like mara occurs 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if not s_matnr[] is initial and............&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;if block 1 is selected&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  select * into itab where matnr in s_matnr&lt;/P&gt;&lt;P&gt;else not s_kunnr[] is initial and............&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;if block 2 is selected&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  select * into itab where matnr in s_kunnr&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is this helpful ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;P&gt;sasi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Oct 2005 08:26:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/1101684#M103642</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-17T08:26:06Z</dc:date>
    </item>
    <item>
      <title>Re: ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/1101685#M103643</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;U can process this either using TAB strip ALV or simple ALV.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U should have a checkbox or radio butons so that u can process.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if not block1 is initial.&lt;/P&gt;&lt;P&gt; perform get_data1.&lt;/P&gt;&lt;P&gt;In this perform get the data in an output table that u r passing it for final display.&lt;/P&gt;&lt;P&gt;elseif not block2 is initial.&lt;/P&gt;&lt;P&gt; perform get_data2.&lt;/P&gt;&lt;P&gt; In this perform get the data in an output table that u r passing it for final display.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But u can keep the sample output table so that u can pass a single table in the output so that u can avoid confusion.&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapdevelopment.co.uk/reporting/alvhome.htm" target="test_blank"&gt;http://www.sapdevelopment.co.uk/reporting/alvhome.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For TABSTRIP refer this link&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap-code-samples/alv-grid/abap" target="test_blank"&gt;https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap-code-samples/alv-grid/abap&lt;/A&gt; code sample for tab strip in alv.pdf&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Oct 2005 08:33:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/1101685#M103643</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-17T08:33:31Z</dc:date>
    </item>
    <item>
      <title>Re: ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/1101686#M103644</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;just create ascreen with number 0100 and create one custom container in that screen with name 'ALV_CONTAINER'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT zanid_test MESSAGE-ID zz.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES: zsflight.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;G L O B A L   I N T E R N  A L   T A B L E S&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;   DATA: gi_sflight TYPE STANDARD TABLE OF sflight.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;G L O B A L   D A T A&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;  DATA: ok_code LIKE sy-ucomm,&lt;/P&gt;&lt;P&gt;         g_wa_sflight LIKE sflight.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Declare reference variables to the ALV grid and the container&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;   DATA:&lt;/P&gt;&lt;P&gt;     go_grid             TYPE REF TO cl_gui_alv_grid,&lt;/P&gt;&lt;P&gt;     go_custom_container TYPE REF TO cl_gui_custom_container.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;S T A R T - O F - S E L E C T I O N.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;   START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;     SET SCREEN '100'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  *&amp;amp;      Module  USER_COMMAND_0100  INPUT&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   MODULE user_command_0100 INPUT.&lt;/P&gt;&lt;P&gt;     CASE ok_code.&lt;/P&gt;&lt;P&gt;       WHEN 'EXIT'.&lt;/P&gt;&lt;P&gt;         LEAVE TO SCREEN 0.&lt;/P&gt;&lt;P&gt;     ENDCASE.&lt;/P&gt;&lt;P&gt;   ENDMODULE.                 " USER_COMMAND_0100  INPUT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  *&amp;amp;      Module  STATUS_0100  OUTPUT&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   MODULE status_0100 OUTPUT.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create objects&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;     IF go_custom_container IS INITIAL.&lt;/P&gt;&lt;P&gt;       CREATE OBJECT go_custom_container&lt;/P&gt;&lt;P&gt;         EXPORTING container_name = 'ALV_CONTAINER'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       CREATE OBJECT go_grid&lt;/P&gt;&lt;P&gt;         EXPORTING&lt;/P&gt;&lt;P&gt;           i_parent = go_custom_container.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       PERFORM load_data_into_grid.&lt;/P&gt;&lt;P&gt;     ENDIF.&lt;/P&gt;&lt;P&gt;   ENDMODULE.                 " STATUS_0100  OUTPUT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  *&amp;amp;      Form  load_data_into_grid&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   FORM load_data_into_grid.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Read data from table SFLIGHT&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;     SELECT *&lt;/P&gt;&lt;P&gt;       FROM zsflight&lt;/P&gt;&lt;P&gt;       INTO TABLE gi_sflight.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Load data into the grid and display them&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;     CALL METHOD go_grid-&amp;gt;set_table_for_first_display&lt;/P&gt;&lt;P&gt;       EXPORTING i_structure_name = 'SFLIGHT'&lt;/P&gt;&lt;P&gt;       CHANGING  it_outtab        = gi_sflight.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   ENDFORM.                    " load_data_into_grid&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Oct 2005 08:36:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/1101686#M103644</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-17T08:36:38Z</dc:date>
    </item>
    <item>
      <title>Re: ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/1101687#M103645</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 can try something like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If not ( s_matnr[] is initial and s_kunnr[] is initial ).&lt;/P&gt;&lt;P&gt;*That's you have entered in both the blocks&lt;/P&gt;&lt;P&gt;   select * from mara into table itab &lt;/P&gt;&lt;P&gt;               where matnr in s_matnr&lt;/P&gt;&lt;P&gt;                 and matnr in s_kunnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;elseif ( s_matnr[] is initial and  s_kunnr[] is initial ).&lt;/P&gt;&lt;P&gt;*That's you haven't entered in both the blocks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from mara into table itab .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;elseif ( s_matnr[] is initial ).&lt;/P&gt;&lt;P&gt;*You have entered kunnr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from mara into table itab &lt;/P&gt;&lt;P&gt;        where matnr in s_kunnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;*you have entered matnr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from mara into table itab &lt;/P&gt;&lt;P&gt;        where matnr in s_matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly reward points if it is helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Oct 2005 08:46:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/1101687#M103645</guid>
      <dc:creator>jayanthi_jayaraman</dc:creator>
      <dc:date>2005-10-17T08:46:35Z</dc:date>
    </item>
    <item>
      <title>Re: ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/1101688#M103646</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;check this it may help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Report  Y_TWOSELECTIONS                                             *
*&amp;amp;                                                                     *
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;                                                                     *
*&amp;amp;                                                                     *
*&amp;amp;---------------------------------------------------------------------*

REPORT  Y_TWOSELECTIONS               .

type-pools slis.
data: fieldcat type slis_t_fieldcat_alv.
data: sort     type slis_t_sortinfo_alv.

data : begin of wa,
      matnr type mara-matnr,
      kunnr type knc1-kunnr.
data :end of wa.

data : itab like table of wa.

SELECTION-SCREEN BEGIN OF BLOCK A WITH FRAME.

SELECT-OPTIONS : s_matnr for wa-matnr.

SELECTION-SCREEN END OF BLOCK A.

SELECTION-SCREEN BEGIN OF BLOCK A1 WITH FRAME.

SELECT-OPTIONS : s_kunnr for wa-kunnr.

SELECTION-SCREEN END OF BLOCK A1.

Start-of-selection.

if not s_matnr is initial.
select * from mara into corresponding fields of wa where matnr in
s_matnr.

append wa to itab.
endselect.
elseif not s_kunnr is initial.

select * from knc1 into corresponding fields of wa where kunnr in
s_kunnr.

append wa to itab.
endselect.


endif.

 perform write_report.

form write_report.
if not s_matnr is initial.
  perform build_field_catalog.
elseif not s_kunnr is initial.
  perform build_field_catalog1.
  endif.
*  perform build_sort.
* CALL ABAP LIST VIEWER (ALV)
  call function 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
            it_fieldcat = fieldcat
            it_sort     = sort

       TABLES
            t_outtab    = itab.

endform.


************************************************************************
*BUILD_FIELD_CATALOG
************************************************************************
form build_field_catalog.
  data: fc_tmp type slis_t_fieldcat_alv with header line.
  clear: fieldcat.
  refresh: fieldcat.
  clear: fc_tmp.
  fc_tmp-reptext_ddic    = 'Material Number'.
  fc_tmp-fieldname  = 'matnr'.
  fc_tmp-tabname   = 'ITAB'.
  fc_tmp-outputlen  = '8'.
  fc_tmp-col_pos    = 2.
  append fc_tmp to fieldcat.
 endform.

*
************************************************************************
*
*BUILD_FIELD_CATALOG
************************************************************************
form build_field_catalog1.
  data: fc_tmp type slis_t_fieldcat_alv with header line.
  clear: fieldcat.
  refresh: fieldcat.
  clear: fc_tmp.
  fc_tmp-reptext_ddic    = 'Customer Number'.
  fc_tmp-fieldname  = 'kunnr'.
  fc_tmp-tabname   = 'ITAB'.
  fc_tmp-outputlen  = '8'.
  fc_tmp-col_pos    = 2.
  append fc_tmp to fieldcat.
 endform.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Oct 2005 09:09:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/1101688#M103646</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-17T09:09:22Z</dc:date>
    </item>
    <item>
      <title>Re: ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/1101689#M103647</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Program everything as you would for a normal ALV Grid report, declaring container, instantiating cl_gui_alv_grid etc,...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When calling method 'set_table_for_first_display', use different parameters based on selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF BLK1 = 'X'&lt;/P&gt;&lt;P&gt;CALL METHOD go_grid-&amp;gt;set_table_for_first_display&lt;/P&gt;&lt;P&gt;EXPORTING i_structure_name = 'BLK1STRUCTURE'&lt;/P&gt;&lt;P&gt;CHANGING it_outtab = BLK1TAB.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;CALL METHOD go_grid-&amp;gt;set_table_for_first_display&lt;/P&gt;&lt;P&gt;EXPORTING i_structure_name = 'BLK2STRUCTURE'&lt;/P&gt;&lt;P&gt;CHANGING it_outtab = BLK2TAB.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Oct 2005 13:49:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/1101689#M103647</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-17T13:49:04Z</dc:date>
    </item>
    <item>
      <title>Re: ALV</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/1101690#M103648</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you using function module or OO classes? What you can do is define a field symbol as "FIELD-SYMBOLS: &amp;lt;itab&amp;gt; TYPE ANY TABLE." and assign your internal table based on the block selected on the selection screen as below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  IF not s_matnr[] IS INITIAL.
    ASSIGN i_matnrs[] TO &amp;lt;itab&amp;gt;.
*-- prepare the field catalogue for showing the materials
    PERFORM prepare_fieldcat USING 'M'.
  ELSEif not s_kunnr[] is initial.
    ASSIGN i_kunnrs[] TO &amp;lt;itab&amp;gt;.
*-- prepare the field catalogue for showing the customers
    PERFORM prepare_fieldcat USING 'C'.
  ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your PERFORM prepare_fieldcat, you will always refresh the field catalog and then depending on the flag, prepare the field catalog for showing that internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then call the FM for showing the grid by passing your field symbol.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Oct 2005 14:52:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/1101690#M103648</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-10-17T14:52:38Z</dc:date>
    </item>
  </channel>
</rss>

