<?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: alv in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/2037072#M418516</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;ex:&lt;/P&gt;&lt;P&gt;Please note that structure ZSTOCK is a custom table and iline looks as follow :- &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: iline type table of zstock with header line. &lt;/P&gt;&lt;P&gt;data: gt_fieldcat         type slis_t_fieldcat_alv. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  perform setup-fieldcatalog using gt_fieldcat[]. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form setup-fieldcatalog using &lt;U&gt;fieldcat type slis&lt;/U&gt;t_fieldcat_alv. &lt;/P&gt;&lt;P&gt;  data: ls_fieldcat type slis_fieldcat_alv. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  call function 'REUSE_ALV_FIELDCATALOG_MERGE' &lt;/P&gt;&lt;P&gt;       exporting &lt;/P&gt;&lt;P&gt;            i_internal_tabname = 'ILINE' &lt;/P&gt;&lt;P&gt;            i_structure_name   = 'ZSTOCK' &lt;/P&gt;&lt;P&gt;       changing &lt;/P&gt;&lt;P&gt;            ct_fieldcat        = _fieldcat. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  loop at &lt;U&gt;fieldcat into ls&lt;/U&gt;fieldcat. &lt;/P&gt;&lt;P&gt;    case ls_fieldcat-fieldname. &lt;/P&gt;&lt;P&gt;      when 'DEPT'. &lt;/P&gt;&lt;P&gt;        ls_fieldcat-no_out    = 'X'. &lt;/P&gt;&lt;P&gt;       when 'DESCR'. &lt;/P&gt;&lt;P&gt;        ls_fieldcat-no_out    = 'X'. &lt;/P&gt;&lt;P&gt;      when 'GOOD_PRD'. &lt;/P&gt;&lt;P&gt;        ls_fieldcat-do_sum    = 'X'. &lt;/P&gt;&lt;P&gt;    endcase. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    modify &lt;U&gt;fieldcat from ls&lt;/U&gt;fieldcat. &lt;/P&gt;&lt;P&gt;  endloop. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                    " FIELDCATALOG &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;one more:&lt;/P&gt;&lt;P&gt;&lt;A href="http://sap.ittoolbox.com/code/archives.asp?i=10&amp;amp;d=2835&amp;amp;a=s" target="test_blank"&gt;http://sap.ittoolbox.com/code/archives.asp?i=10&amp;amp;d=2835&amp;amp;a=s&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**reward if helpful&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;madhu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 20 Mar 2007 12:45:57 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-03-20T12:45:57Z</dc:date>
    <item>
      <title>alv</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/2037069#M418513</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;i want solution for this question&lt;/P&gt;&lt;P&gt;i m having a no.of fields in a report and i m using alv report &lt;/P&gt;&lt;P&gt;how can i use the function module&lt;/P&gt;&lt;P&gt;REUSE_ALV_FIELDCATALOG_MERGE.&lt;/P&gt;&lt;P&gt;to display all these fields in the o/p.&lt;/P&gt;&lt;P&gt;its urgent&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Mar 2007 12:39:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/2037069#M418513</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-20T12:39:35Z</dc:date>
    </item>
    <item>
      <title>Re: alv</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/2037070#M418514</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;this function modue will automatically create the fieldcatalog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:FIELDCAT1 TYPE SLIS_T_FIELDCAT_ALV.&lt;/P&gt;&lt;P&gt;&lt;/P&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               = SY-REPID&lt;/P&gt;&lt;P&gt;   I_INTERNAL_TABNAME           = 'ITAB'(this will contain all the fields u want to  display)&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  I_STRUCTURE_NAME             = 'ITAB'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  I_CLIENT_NEVER_DISPLAY       = 'X'&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;   I_INCLNAME                   = SY-REPID&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  I_BYPASSING_BUFFER           =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  I_BUFFER_ACTIVE              =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CHANGING&lt;/P&gt;&lt;P&gt;    CT_FIELDCAT                  = FIELDCAT1.&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;bharat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Mar 2007 12:43:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/2037070#M418514</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-20T12:43:51Z</dc:date>
    </item>
    <item>
      <title>Re: alv</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/2037071#M418515</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;&lt;A href="http://www.sap-img.com/fu015.htm" target="test_blank"&gt;http://www.sap-img.com/fu015.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="230524"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;*data definition

tables:
marav. "Table MARA and table MAKT

*---------------------------------------------------------------------*
* Data to be displayed in ALV
* Using the following syntax, REUSE_ALV_FIELDCATALOG_MERGE can auto-
* matically determine the fieldstructure from this source program
Data:
begin of imat occurs 100,
matnr like marav-matnr, "Material number
maktx like marav-maktx, "Material short text
matkl like marav-matkl, "Material group (so you can test to make
                        " intermediate sums)
ntgew like marav-ntgew, "Net weight, numeric field (so you can test to
                        "make sums)
gewei like marav-gewei, "weight unit (just to be complete)
end of imat.

*---------------------------------------------------------------------*
* Other data needed
* field to store report name
data i_repid like sy-repid.
* field to check table length
data i_lines like sy-tabix.

*---------------------------------------------------------------------*
* Data for ALV display
TYPE-POOLS: SLIS.
data int_fcat type SLIS_T_FIELDCAT_ALV.

*---------------------------------------------------------------------*
select-options:
s_matnr for marav-matnr matchcode object MAT1.

*---------------------------------------------------------------------*
start-of-selection.

* read data into table imat
  select * from marav
  into corresponding fields of table imat
  where
  matnr in s_matnr.

* Check if material was found
  clear i_lines.
  describe table imat lines i_lines.
  if i_lines lt 1.
*   Using hardcoded write here for easy upload
    write: /
    'No materials found.'.
    exit.
  endif.

end-of-selection.
*---------------------------------------------------------------------*
*
* Now, we start with ALV
*
*---------------------------------------------------------------------*
*
*
* To use ALV, we need a DDIC-structure or a thing called Fieldcatalogue.
* The fieldcatalouge can be generated by FUNCTION
* 'REUSE_ALV_FIELDCATALOG_MERGE' from an internal table from any
* report source, including this report.
* The only problem one might have is that the report and table names
* need to be in capital letters. (I had it :-( )
*
*
*---------------------------------------------------------------------*

* Store report name
  i_repid = sy-repid.

* Create Fieldcatalogue from internal table
  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
       EXPORTING
            I_PROGRAM_NAME         = i_repid
            I_INTERNAL_TABNAME     = 'IMAT'  "capital letters!
            I_INCLNAME             = i_repid
       CHANGING
            CT_FIELDCAT            = int_fcat
       EXCEPTIONS
            INCONSISTENT_INTERFACE = 1
            PROGRAM_ERROR          = 2
            OTHERS                 = 3.
*explanations:
*    I_PROGRAM_NAME is the program which calls this function
*
*    I_INTERNAL_TABNAME is the name of the internal table which you want
*                       to display in ALV
*
*    I_INCLNAME is the ABAP-source where the internal table is defined
*               (DATA....)
*      CT_FIELDCAT contains the Fieldcatalouge that we need later for
*      ALV display


  IF SY-SUBRC &amp;lt;&amp;gt; 0.
    write: /
    'Returncode',
    sy-subrc,
    'from FUNCTION REUSE_ALV_FIELDCATALOG_MERGE'.
  ENDIF.

*This was the fieldcatlogue
*---------------------------------------------------------------------*
*
* And now, we are ready to display our list

* Call for ALV list display
  CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
       EXPORTING
*            I_CALLBACK_PROGRAM = 'Z_ALV_SIMPLE_EXAMPLE_WITH_ITAB'
            I_CALLBACK_PROGRAM = i_repid
            IT_FIELDCAT        = int_fcat
            I_SAVE             = 'A'
       TABLES
            T_OUTTAB           = imat
       EXCEPTIONS
            PROGRAM_ERROR      = 1
            OTHERS             = 2.
*
*explanations:
*    I_CALLBACK_PROGRAM is the program which calls this function
*
*    IT_FIELDCAT (just made by REUSE_ALV_FIELDCATALOG_MERGE) contains
*                 now the data definition needed for display
*
*    I_SAVE allows the user to save his own layouts
*
*      T_OUTTAB contains the data to be displayed in ALV


  IF SY-SUBRC &amp;lt;&amp;gt; 0.
    write: /
    'Returncode',
    sy-subrc,
    'from FUNCTION REUSE_ALV_LIST_DISPLAY'.
  ENDIF.
&lt;/CODE&gt;&lt;/PRE&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>Tue, 20 Mar 2007 12:44:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/2037071#M418515</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-20T12:44:51Z</dc:date>
    </item>
    <item>
      <title>Re: alv</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/2037072#M418516</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;ex:&lt;/P&gt;&lt;P&gt;Please note that structure ZSTOCK is a custom table and iline looks as follow :- &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: iline type table of zstock with header line. &lt;/P&gt;&lt;P&gt;data: gt_fieldcat         type slis_t_fieldcat_alv. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  perform setup-fieldcatalog using gt_fieldcat[]. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form setup-fieldcatalog using &lt;U&gt;fieldcat type slis&lt;/U&gt;t_fieldcat_alv. &lt;/P&gt;&lt;P&gt;  data: ls_fieldcat type slis_fieldcat_alv. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  call function 'REUSE_ALV_FIELDCATALOG_MERGE' &lt;/P&gt;&lt;P&gt;       exporting &lt;/P&gt;&lt;P&gt;            i_internal_tabname = 'ILINE' &lt;/P&gt;&lt;P&gt;            i_structure_name   = 'ZSTOCK' &lt;/P&gt;&lt;P&gt;       changing &lt;/P&gt;&lt;P&gt;            ct_fieldcat        = _fieldcat. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  loop at &lt;U&gt;fieldcat into ls&lt;/U&gt;fieldcat. &lt;/P&gt;&lt;P&gt;    case ls_fieldcat-fieldname. &lt;/P&gt;&lt;P&gt;      when 'DEPT'. &lt;/P&gt;&lt;P&gt;        ls_fieldcat-no_out    = 'X'. &lt;/P&gt;&lt;P&gt;       when 'DESCR'. &lt;/P&gt;&lt;P&gt;        ls_fieldcat-no_out    = 'X'. &lt;/P&gt;&lt;P&gt;      when 'GOOD_PRD'. &lt;/P&gt;&lt;P&gt;        ls_fieldcat-do_sum    = 'X'. &lt;/P&gt;&lt;P&gt;    endcase. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    modify &lt;U&gt;fieldcat from ls&lt;/U&gt;fieldcat. &lt;/P&gt;&lt;P&gt;  endloop. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                    " FIELDCATALOG &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;one more:&lt;/P&gt;&lt;P&gt;&lt;A href="http://sap.ittoolbox.com/code/archives.asp?i=10&amp;amp;d=2835&amp;amp;a=s" target="test_blank"&gt;http://sap.ittoolbox.com/code/archives.asp?i=10&amp;amp;d=2835&amp;amp;a=s&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**reward if helpful&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;madhu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Mar 2007 12:45:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/2037072#M418516</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-20T12:45:57Z</dc:date>
    </item>
    <item>
      <title>Re: alv</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/2037073#M418517</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Mallika Rao,&lt;/P&gt;&lt;P&gt;when you are using &lt;/P&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 = SY-REPID&lt;/P&gt;&lt;P&gt;I_INTERNAL_TABNAME = 'ITAB'(this will contain tha data u want to display)&lt;/P&gt;&lt;P&gt; I_STRUCTURE_NAME = 'DATADictionary STRUCTURE' You need to create a Structure in data dictonary(Mandatory) with the same fields what you want to display on report out put.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Mar 2007 13:42:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/2037073#M418517</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-20T13:42:36Z</dc:date>
    </item>
  </channel>
</rss>

