<?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: Sample ALV Report in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sample-alv-report/m-p/1467610#M220102</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See Demo program BCALV_GRID_DEMO in se38&lt;/P&gt;&lt;P&gt;Its helpful to you&lt;/P&gt;&lt;P&gt;Reward if Helpful&lt;/P&gt;&lt;P&gt;Regard&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 25 Aug 2006 06:26:33 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-08-25T06:26:33Z</dc:date>
    <item>
      <title>Sample ALV Report</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sample-alv-report/m-p/1467608#M220100</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI All,&lt;/P&gt;&lt;P&gt;      Pls send me a simple ALV Report.As my requirment is In select-option I'm passing two field &amp;amp; In O/P I've to get 8 fields as ALV grid display.One of the field In O/P should display in dicending order.&lt;/P&gt;&lt;P&gt;Pls send me sample report as I'm very new to ALV.&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;Singha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Aug 2006 06:16:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sample-alv-report/m-p/1467608#M220100</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-25T06:16:40Z</dc:date>
    </item>
    <item>
      <title>Re: Sample ALV Report</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sample-alv-report/m-p/1467609#M220101</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try to go through programs starting with BCALV* or &lt;/P&gt;&lt;P&gt;transaction DWDM to explore and find one suitable for &lt;/P&gt;&lt;P&gt;your requirements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;Eswar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Aug 2006 06:22:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sample-alv-report/m-p/1467609#M220101</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-25T06:22:21Z</dc:date>
    </item>
    <item>
      <title>Re: Sample ALV Report</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sample-alv-report/m-p/1467610#M220102</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See Demo program BCALV_GRID_DEMO in se38&lt;/P&gt;&lt;P&gt;Its helpful to you&lt;/P&gt;&lt;P&gt;Reward if Helpful&lt;/P&gt;&lt;P&gt;Regard&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Aug 2006 06:26:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sample-alv-report/m-p/1467610#M220102</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-25T06:26:33Z</dc:date>
    </item>
    <item>
      <title>Re: Sample ALV Report</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sample-alv-report/m-p/1467611#M220103</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 am giving u code for a sample ALV with explanation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT z_alv_simple_example_with_itab .&lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;*Simple example to use ALV and to define the ALV data in an internal&lt;/P&gt;&lt;P&gt;*table&lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Martin Schlegel, BearingPoint, December 2004&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Thanks to Madhusudhan Sonee and Rama Krishna Kommineni for testing&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;and feedback&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;*For a very long time, people gave me the feeling that ALV is a&lt;/P&gt;&lt;P&gt;*complicated tool that is difficult to understand and to use.&lt;/P&gt;&lt;P&gt;*Lately I had to use it and I discovered that ALV is easy to use and&lt;/P&gt;&lt;P&gt;*saves a lot of work:&lt;/P&gt;&lt;P&gt;*ALV will generate the column headings on its own, so one does not need&lt;/P&gt;&lt;P&gt;*to work on headlines and transalation.&lt;/P&gt;&lt;P&gt;*ALV allows the user to select the columns he wants to see, so the user&lt;/P&gt;&lt;P&gt;*does not need to contact a developer for every change he likes to have.&lt;/P&gt;&lt;P&gt;*ALV allows the user to create his own sums, so &amp;#133;&lt;/P&gt;&lt;P&gt;*ALV has a simple way to work with internal tables.&lt;/P&gt;&lt;P&gt;*If you really want to save time, use ALV instead of write!&lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*Please take 30 minutes to explore the following example and see how&lt;/P&gt;&lt;P&gt;*easy it is to use ALV!&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*data definition&lt;/P&gt;&lt;P&gt;INCLUDE &amp;lt;icon&amp;gt;.&lt;/P&gt;&lt;P&gt;TABLES:&lt;/P&gt;&lt;P&gt;marav. "Table MARA and table MAKT&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Data to be displayed in ALV&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Using the following syntax, REUSE_ALV_FIELDCATALOG_MERGE can auto-&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;matically determine the fieldstructure from this source program&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt;BEGIN OF imat OCCURS 100,&lt;/P&gt;&lt;P&gt;ios(4) TYPE c,&lt;/P&gt;&lt;P&gt;matnr LIKE marav-matnr, "Material number&lt;/P&gt;&lt;P&gt;maktx LIKE marav-maktx, "Material short text&lt;/P&gt;&lt;P&gt;matkl LIKE marav-matkl, "Material group (so you can test to make&lt;/P&gt;&lt;P&gt;                        " intermediate sums)&lt;/P&gt;&lt;P&gt;ntgew LIKE marav-ntgew, "Net weight, numeric field (so you can test to&lt;/P&gt;&lt;P&gt;                        "make sums)&lt;/P&gt;&lt;P&gt;gewei LIKE marav-gewei, "weight unit (just to be complete)&lt;/P&gt;&lt;P&gt;END OF imat.&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Other data needed&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;field to store report name&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;DATA i_repid LIKE sy-repid.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;field to check table length&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;DATA i_lines LIKE sy-tabix.&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Data for ALV display&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;TYPE-POOLS: slis.&lt;/P&gt;&lt;P&gt;DATA int_fcat TYPE slis_t_fieldcat_alv.&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;SELECT-OPTIONS:&lt;/P&gt;&lt;P&gt;s_matnr FOR marav-matnr MATCHCODE OBJECT mat1.&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;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;read data into table imat&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  SELECT * FROM marav&lt;/P&gt;&lt;P&gt;  INTO CORRESPONDING FIELDS OF TABLE imat&lt;/P&gt;&lt;P&gt;  WHERE  matnr IN s_matnr.&lt;/P&gt;&lt;P&gt;  LOOP AT imat.&lt;/P&gt;&lt;P&gt;    IF imat-matnr+0(1) = 'M'.&lt;/P&gt;&lt;P&gt;      MOVE icon_green_light TO imat-ios.&lt;/P&gt;&lt;P&gt;      MODIFY imat.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;    IF imat-matnr+0(1) = 'Z'.&lt;/P&gt;&lt;P&gt;      MOVE icon_red_light TO imat-ios.&lt;/P&gt;&lt;P&gt;      MODIFY imat.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Check if material was found&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CLEAR i_lines.&lt;/P&gt;&lt;P&gt;  DESCRIBE TABLE imat LINES i_lines.&lt;/P&gt;&lt;P&gt;  IF i_lines LT 1.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Using hardcoded write here for easy upload&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    WRITE: / 'No materials found.'.&lt;/P&gt;&lt;P&gt;    EXIT.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;END-OF-SELECTION.&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Now, we start with ALV&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&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;To use ALV, we need a DDIC-structure or a thing called Fieldcatalogue.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;The fieldcatalouge can be generated by FUNCTION&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;'REUSE_ALV_FIELDCATALOG_MERGE' from an internal table from any&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;report source, including this report.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;The only problem one might have is that the report and table names&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;need to be in capital letters. (I had it &lt;SPAN __jive_emoticon_name="sad"&gt;&lt;/SPAN&gt; )&lt;/P&gt;&lt;/LI&gt;&lt;/UL&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Store report name&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  i_repid = sy-repid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create Fieldcatalogue from internal table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      i_program_name         = i_repid&lt;/P&gt;&lt;P&gt;      i_internal_tabname     = 'IMAT'  "capital letters!&lt;/P&gt;&lt;P&gt;      i_inclname             = i_repid&lt;/P&gt;&lt;P&gt;    CHANGING&lt;/P&gt;&lt;P&gt;      ct_fieldcat            = int_fcat&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;*explanations:&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   I_PROGRAM_NAME is the program which calls this function&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   I_INTERNAL_TABNAME is the name of the internal table which you want&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                      to display in ALV&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   I_INCLNAME is the ABAP-source where the internal table is defined&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;              (DATA....)&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     CT_FIELDCAT contains the Fieldcatalouge that we need later for&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     ALV display&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    WRITE: /&lt;/P&gt;&lt;P&gt;    'Returncode',&lt;/P&gt;&lt;P&gt;    sy-subrc,&lt;/P&gt;&lt;P&gt;    'from FUNCTION REUSE_ALV_FIELDCATALOG_MERGE'.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*This was the fieldcatlogue&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;And now, we are ready to display our list&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&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;Call for ALV list display&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'&lt;/P&gt;&lt;P&gt;       EXPORTING&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          I_CALLBACK_PROGRAM = 'Z_ALV_SIMPLE_EXAMPLE_WITH_ITAB'&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;            i_callback_program = i_repid&lt;/P&gt;&lt;P&gt;            it_fieldcat        = int_fcat&lt;/P&gt;&lt;P&gt;            i_save             = 'A'&lt;/P&gt;&lt;P&gt;       TABLES&lt;/P&gt;&lt;P&gt;            t_outtab           = imat&lt;/P&gt;&lt;P&gt;       EXCEPTIONS&lt;/P&gt;&lt;P&gt;            program_error      = 1&lt;/P&gt;&lt;P&gt;            OTHERS             = 2.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*explanations:&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   I_CALLBACK_PROGRAM is the program which calls this function&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   IT_FIELDCAT (just made by REUSE_ALV_FIELDCATALOG_MERGE) contains&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                now the data definition needed for display&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   I_SAVE allows the user to save his own layouts&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     T_OUTTAB contains the data to be displayed in ALV&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    WRITE: /&lt;/P&gt;&lt;P&gt;    'Returncode',&lt;/P&gt;&lt;P&gt;    sy-subrc,&lt;/P&gt;&lt;P&gt;    'from FUNCTION REUSE_ALV_LIST_DISPLAY'.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will help you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Aug 2006 06:54:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sample-alv-report/m-p/1467611#M220103</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-25T06:54:51Z</dc:date>
    </item>
    <item>
      <title>Re: Sample ALV Report</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sample-alv-report/m-p/1467612#M220104</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;report  z_alv_data_display                      .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Table declaration&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tables :&lt;/P&gt;&lt;P&gt;         bsis,&lt;/P&gt;&lt;P&gt;         bsas.&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Declaration of the Internal Table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : begin of itab occurs 100,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; belnr like bsas-belnr, "  Accounting document number&lt;/P&gt;&lt;P&gt; bldat like bsas-bldat, "  Document date&lt;/P&gt;&lt;P&gt; budat like bsas-budat, "  Posting date&lt;/P&gt;&lt;P&gt; hkont like bsas-hkont, "  GL account&lt;/P&gt;&lt;P&gt; dmbtr like bsas-dmbtr, "  Amount in local currency&lt;/P&gt;&lt;P&gt; xblnr like bsas-xblnr, "  Reference document number&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; end of itab.&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Other data needed&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;field to store report name&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data i_repid like sy-repid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;field to check table length&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data i_lines like sy-tabix.&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Data for ALV display&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;type-pools: slis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: int_fcat type slis_t_fieldcat_alv,&lt;/P&gt;&lt;P&gt;      is_layout type slis_fieldcat_alv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:  wa_fieldcat like line of int_fcat.&lt;/P&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;*Selection Screen Declaration&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;selection-screen: begin of block b1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;parameters :  ddate like bsas-bldat,&lt;/P&gt;&lt;P&gt;              glact like bsas-hkont.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;selection-screen:end of block b1.&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;*Select the document date, amount, document no  from the table bsas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  select      bldat&lt;/P&gt;&lt;P&gt;              dmbtr&lt;/P&gt;&lt;P&gt;              belnr&lt;/P&gt;&lt;P&gt;              budat&lt;/P&gt;&lt;P&gt;              hkont&lt;/P&gt;&lt;P&gt;              xblnr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;              from bsas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                into (itab-bldat,&lt;/P&gt;&lt;P&gt;                      itab-dmbtr,&lt;/P&gt;&lt;P&gt;                      itab-belnr,&lt;/P&gt;&lt;P&gt;                      itab-budat,&lt;/P&gt;&lt;P&gt;                      itab-hkont,&lt;/P&gt;&lt;P&gt;                      itab-xblnr)&lt;/P&gt;&lt;P&gt;                     where bldat eq ddate and hkont eq glact.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      append itab.&lt;/P&gt;&lt;P&gt;    endselect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  select      bldat&lt;/P&gt;&lt;P&gt;              dmbtr&lt;/P&gt;&lt;P&gt;              belnr&lt;/P&gt;&lt;P&gt;              budat&lt;/P&gt;&lt;P&gt;              hkont&lt;/P&gt;&lt;P&gt;              xblnr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;              from bsis&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                into (itab-bldat,&lt;/P&gt;&lt;P&gt;                      itab-dmbtr,&lt;/P&gt;&lt;P&gt;                      itab-belnr,&lt;/P&gt;&lt;P&gt;                      itab-budat,&lt;/P&gt;&lt;P&gt;                      itab-hkont,&lt;/P&gt;&lt;P&gt;                      itab-xblnr)&lt;/P&gt;&lt;P&gt;                     where bldat eq ddate and hkont eq glact.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    append itab.&lt;/P&gt;&lt;P&gt;  endselect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Check if material was found&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  clear i_lines.&lt;/P&gt;&lt;P&gt;  describe table itab lines i_lines.&lt;/P&gt;&lt;P&gt;  if i_lines lt 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Using hardcoded write here for easy upload&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    write: /&lt;/P&gt;&lt;P&gt;    'No DATA found.'.&lt;/P&gt;&lt;P&gt;    exit.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end-of-selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;Store report name&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;  i_repid = sy-repid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*This was the fieldcatlogue&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;to display the list of data&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  is_layout-col_pos = 1.&lt;/P&gt;&lt;P&gt;  is_layout-fieldname = 'BELNR'.&lt;/P&gt;&lt;P&gt;  is_layout-tabname   = 'ITAB'.&lt;/P&gt;&lt;P&gt;  is_layout-seltext_l  = 'Document No'.&lt;/P&gt;&lt;P&gt;  append is_layout to int_fcat.&lt;/P&gt;&lt;P&gt;  clear is_layout.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  is_layout-col_pos = 2.&lt;/P&gt;&lt;P&gt;  is_layout-fieldname = 'BLDAT'.&lt;/P&gt;&lt;P&gt;  is_layout-tabname   = 'ITAB'.&lt;/P&gt;&lt;P&gt;  is_layout-seltext_l  = 'Document Dt'.&lt;/P&gt;&lt;P&gt;  append is_layout to int_fcat.&lt;/P&gt;&lt;P&gt;  clear is_layout.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  is_layout-col_pos = 3.&lt;/P&gt;&lt;P&gt;  is_layout-fieldname = 'BUDAT'.&lt;/P&gt;&lt;P&gt;  is_layout-tabname   = 'ITAB'.&lt;/P&gt;&lt;P&gt;  is_layout-seltext_l  = 'Posting Dt'.&lt;/P&gt;&lt;P&gt;  append is_layout to int_fcat.&lt;/P&gt;&lt;P&gt;  clear is_layout.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  is_layout-col_pos = 4.&lt;/P&gt;&lt;P&gt;  is_layout-fieldname = 'HKONT'.&lt;/P&gt;&lt;P&gt;  is_layout-tabname   = 'ITAB'.&lt;/P&gt;&lt;P&gt;  is_layout-seltext_l  = 'GL Act No'.&lt;/P&gt;&lt;P&gt;  append is_layout to int_fcat.&lt;/P&gt;&lt;P&gt;  clear is_layout.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  is_layout-col_pos = 5.&lt;/P&gt;&lt;P&gt;  is_layout-fieldname = 'DMBTR'.&lt;/P&gt;&lt;P&gt;  is_layout-tabname   = 'ITAB'.&lt;/P&gt;&lt;P&gt;  is_layout-seltext_l  = 'Amt(Lcl Curncy)'.&lt;/P&gt;&lt;P&gt;  append is_layout to int_fcat.&lt;/P&gt;&lt;P&gt;  clear is_layout.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  is_layout-col_pos = 6.&lt;/P&gt;&lt;P&gt;  is_layout-fieldname = 'XBLNR'.&lt;/P&gt;&lt;P&gt;  is_layout-tabname   = 'ITAB'.&lt;/P&gt;&lt;P&gt;  is_layout-seltext_l  = 'Reference'.&lt;/P&gt;&lt;P&gt;  append is_layout to int_fcat.&lt;/P&gt;&lt;P&gt;  clear is_layout.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&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;Call for ALV list display&lt;/P&gt;&lt;/LI&gt;&lt;/UL&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           I_CALLBACK_PROGRAM = 'Z_ALV_SIMPLE_EXAMPLE_WITH_ITAB'&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;            i_callback_program = i_repid&lt;/P&gt;&lt;P&gt;            it_fieldcat        = int_fcat[]&lt;/P&gt;&lt;P&gt;            i_save             = 'A'&lt;/P&gt;&lt;P&gt;       tables&lt;/P&gt;&lt;P&gt;            t_outtab           = itab[]&lt;/P&gt;&lt;P&gt;       exceptions&lt;/P&gt;&lt;P&gt;            program_error      = 1&lt;/P&gt;&lt;P&gt;            others             = 2.&lt;/P&gt;&lt;P&gt;  if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    write: /&lt;/P&gt;&lt;P&gt;    'Returncode',&lt;/P&gt;&lt;P&gt;    sy-subrc,&lt;/P&gt;&lt;P&gt;    'from FUNCTION REUSE_ALV_LIST_DISPLAY'.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Feb 2007 12:08:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sample-alv-report/m-p/1467612#M220104</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-15T12:08:57Z</dc:date>
    </item>
    <item>
      <title>Re: Sample ALV Report</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sample-alv-report/m-p/1467613#M220105</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;good&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;go to SE38 give BCALV* and put F4,you ll find lots of example related to AVL,test them and ust them accordingly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;mrutyun^&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Feb 2007 12:49:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sample-alv-report/m-p/1467613#M220105</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-15T12:49:34Z</dc:date>
    </item>
  </channel>
</rss>

