<?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 issue in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-issue/m-p/5755863#M1303959</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can not use local structure, You can either use structure or fieldcatalog and If you want to use fieldcatalog comment structure assignment it is not necessary.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL METHOD ref_grid-&amp;gt;set_table_for_first_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_structure_name = 'ZAIL_PA0001STRU'                     &lt;STRONG&gt;" 'USR_STRUC'&lt;/STRONG&gt;     &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;   CHANGING &lt;/P&gt;&lt;P&gt;      IT_FIELDCATALOG = it_fcat &lt;/P&gt;&lt;P&gt;      it_outtab        = t_usr_table ). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL METHOD ref_grid-&amp;gt;set_table_for_first_display( &lt;/P&gt;&lt;P&gt;    EXPORTING &lt;/P&gt;&lt;P&gt;      i_structure_name = 'ZAIL_PA0001STRU'                     &lt;STRONG&gt;" 'USR_STRUC'&lt;/STRONG&gt;     &lt;/P&gt;&lt;P&gt;   CHANGING &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     IT_FIELDCATALOG = it_fcat &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      it_outtab        = t_usr_table ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Gungor Ozcelebi on Jun 30, 2009 5:41 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Gungor Ozcelebi on Jun 30, 2009 5:46 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 30 Jun 2009 15:40:19 GMT</pubDate>
    <dc:creator>former_member194416</dc:creator>
    <dc:date>2009-06-30T15:40:19Z</dc:date>
    <item>
      <title>ALV issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-issue/m-p/5755862#M1303958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to display an output in ALV format. I have called the following method. &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CALL METHOD ref_grid-&amp;gt;set_table_for_first_display( 
    EXPORTING 
      i_structure_name = 'ZAIL_PA0001STRU'                     *" 'USR_STRUC'*     
   CHANGING 
      IT_FIELDCATALOG = it_fcat 
      it_outtab        = t_usr_table ). 
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I use structure &lt;STRONG&gt;ZAIL_PA0001STRU&lt;/STRONG&gt; that is defined in the data dictionary, it displays everything in the table including the title.&lt;/P&gt;&lt;P&gt;However, if I use structure &lt;STRONG&gt;USR_STRUC&lt;/STRONG&gt; that is defined locally, it doesn't display the title of the table even though I have filled&lt;/P&gt;&lt;P&gt;the data into the IT_FIELDCATALOG. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you tell me why and how I can fix this problem? I would like to use the local structure rather than the global one. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks, &lt;/P&gt;&lt;P&gt;AS.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jun 2009 15:28:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-issue/m-p/5755862#M1303958</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-30T15:28:17Z</dc:date>
    </item>
    <item>
      <title>Re: ALV issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-issue/m-p/5755863#M1303959</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can not use local structure, You can either use structure or fieldcatalog and If you want to use fieldcatalog comment structure assignment it is not necessary.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL METHOD ref_grid-&amp;gt;set_table_for_first_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_structure_name = 'ZAIL_PA0001STRU'                     &lt;STRONG&gt;" 'USR_STRUC'&lt;/STRONG&gt;     &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;   CHANGING &lt;/P&gt;&lt;P&gt;      IT_FIELDCATALOG = it_fcat &lt;/P&gt;&lt;P&gt;      it_outtab        = t_usr_table ). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL METHOD ref_grid-&amp;gt;set_table_for_first_display( &lt;/P&gt;&lt;P&gt;    EXPORTING &lt;/P&gt;&lt;P&gt;      i_structure_name = 'ZAIL_PA0001STRU'                     &lt;STRONG&gt;" 'USR_STRUC'&lt;/STRONG&gt;     &lt;/P&gt;&lt;P&gt;   CHANGING &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     IT_FIELDCATALOG = it_fcat &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      it_outtab        = t_usr_table ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Gungor Ozcelebi on Jun 30, 2009 5:41 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Gungor Ozcelebi on Jun 30, 2009 5:46 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jun 2009 15:40:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-issue/m-p/5755863#M1303959</guid>
      <dc:creator>former_member194416</dc:creator>
      <dc:date>2009-06-30T15:40:19Z</dc:date>
    </item>
    <item>
      <title>Re: ALV issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-issue/m-p/5755864#M1303960</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anna&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Gungor Ozcelebi   is right.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here u can indicate a dictionary structure only, if you don't want to define a structure in dictionary, u need to transfer the definition of local structure by IT_FIELDCATALOG parameters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem could be there isn't a fast way to fill the catalog table for a local structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There's the fm REUSE_ALV_FIELDCATALOG_MERGE but it works for ALV by fm so not for OOP, this fm can fill the catalog table reading the definition of a structure in a program, so a tip can be to use this fm and then to transfer the data from IT_CATALOG (defined as type SLIS_T_FIELDCAT_ALV) to IT_FIELDCATALOG (defined as LVC_T_FCAT).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The main fields have the same name so you can use MOVE-CORRESPONDING statament&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT IT_CATALOG.
   MOVE-CORRESPONDING IT_CATALOG TO IT_FIELDCATALOG.
   APPEND IT_FIELDCATALOG.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another solution can be to transfer the dictionary field as reference to  IT_FIELDCATALOG, that works if the field of local strcture is defined as dictionary field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TYPES: BEGIN OF MY_STRUCT.
               BUKRS TYPE BKPF-BUKRS,
               VBELN TYPE VBAP-VBELN,
            END   OF MY_STRUCT.

DATA: MY_TAB TYPE TABLE OF MY_STRUCT.
DATA: IT_FIELDCATALOG TYPE LVC_T_FCAT,
            WT_FIELDCATALOG TYPE LVC_S_FCAT.


WT_FIELDCATALOG-FIELDNAME = 'BUKRS'.
WT_FIELDCATALOG-TABNAME   = 'MY_TAB'.
WT_FIELDCATALOG-REF_FIELD  = 'BUKRS'.
WT_FIELDCATALOG-REF_TABLE = 'BKPF'.
APPEND WT_FIELDCATALOG TO IT_FIELDCATALOG.

WT_FIELDCATALOG-FIELDNAME = 'VBELN'.
WT_FIELDCATALOG-TABNAME   = 'MY_TAB'.
WT_FIELDCATALOG-REF_FIELD  = 'VBELN'.
WT_FIELDCATALOG-REF_TABLE = 'VBAP'.
APPEND WT_FIELDCATALOG TO IT_FIELDCATALOG.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jun 2009 15:58:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-issue/m-p/5755864#M1303960</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-30T15:58:24Z</dc:date>
    </item>
    <item>
      <title>Re: ALV issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-issue/m-p/5755865#M1303961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks to Gungor and Max.&lt;/P&gt;&lt;P&gt;My question has been resolved.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jul 2009 15:02:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-issue/m-p/5755865#M1303961</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-02T15:02:00Z</dc:date>
    </item>
  </channel>
</rss>

