<?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: Creating TYPES structure without nesting in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-types-structure-without-nesting/m-p/12475288#M2001365</link>
    <description>&lt;PRE&gt;&lt;CODE&gt;TYPES: BEGIN OF ty_custom_tab.&lt;BR /&gt;         include TYPE tab1,         &lt;BR /&gt;TYPES : field1   TYPE tab2-field1,       &lt;BR /&gt;       END OF ty_custom_tab.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;this one works ? (not tested)&lt;/P&gt;</description>
    <pubDate>Tue, 01 Mar 2022 06:48:33 GMT</pubDate>
    <dc:creator>FredericGirod</dc:creator>
    <dc:date>2022-03-01T06:48:33Z</dc:date>
    <item>
      <title>Creating TYPES structure without nesting</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-types-structure-without-nesting/m-p/12475287#M2001364</link>
      <description>&lt;P&gt;I am having a requirement to create an internal table which should have a structure containing all fields of one internal table (like BSEG, AUSP) and few fields from another table like (MARC-WERKS).&lt;BR /&gt;When I use something like &lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;TYPES: BEGIN OF ty_custom_tab, 
       include TYPE tab1,         
       field1   TYPE tab2-field1,       
       END OF ty_custom_tab.&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;The above code creates a nested structure in the internal table with two columns:&lt;/P&gt;
  &lt;P&gt;1. The INCLUDE structure&lt;/P&gt;
  &lt;P&gt;2. the field&lt;/P&gt;
  &lt;P&gt;Reading this data table is quite cumbersome. &lt;/P&gt;
  &lt;P&gt;Is there anyway this can be simplified. Tab1 contains a lot of fields. So listing them all in the TYPES declaration is not a good idea.&lt;/P&gt;
  &lt;P&gt;I want he include structure in the exploded view (tab1-fld1, tab1-fld2....................tab1-fldn, tab2-fld1).&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2022 06:38:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-types-structure-without-nesting/m-p/12475287#M2001364</guid>
      <dc:creator>pnamin77</dc:creator>
      <dc:date>2022-03-01T06:38:11Z</dc:date>
    </item>
    <item>
      <title>Re: Creating TYPES structure without nesting</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-types-structure-without-nesting/m-p/12475288#M2001365</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;TYPES: BEGIN OF ty_custom_tab.&lt;BR /&gt;         include TYPE tab1,         &lt;BR /&gt;TYPES : field1   TYPE tab2-field1,       &lt;BR /&gt;       END OF ty_custom_tab.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;this one works ? (not tested)&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2022 06:48:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-types-structure-without-nesting/m-p/12475288#M2001365</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2022-03-01T06:48:33Z</dc:date>
    </item>
    <item>
      <title>Re: Creating TYPES structure without nesting</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-types-structure-without-nesting/m-p/12475289#M2001366</link>
      <description>&lt;P&gt;Thanks  &lt;SPAN class="mention-scrubbed"&gt;frdric.girod&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;I tried this but it doesn't make any difference.&lt;/P&gt;&lt;P&gt;The INCLUDE (Flat structure) is still there.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2022 07:02:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-types-structure-without-nesting/m-p/12475289#M2001366</guid>
      <dc:creator>pnamin77</dc:creator>
      <dc:date>2022-03-01T07:02:37Z</dc:date>
    </item>
    <item>
      <title>Re: Creating TYPES structure without nesting</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-types-structure-without-nesting/m-p/12475290#M2001367</link>
      <description>&lt;P&gt;I figured it out.&lt;/P&gt;&lt;P&gt;Did some fiddling around and this is the code that works&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE&gt;TYPES: BEGIN OF ty_custom_tab.&lt;BR /&gt;         INCLUDE STRUCTURE tab1,         &lt;BR /&gt;TYPES : field1   TYPE tab2-field1,       &lt;BR /&gt;       END OF ty_custom_tab.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The above code works.&lt;/P&gt;&lt;P&gt;Reference link: &lt;A href="https://answers.sap.com/questions/5241369/include-a-structure-in-a-types-declaration.html"&gt;here&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2022 07:12:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-types-structure-without-nesting/m-p/12475290#M2001367</guid>
      <dc:creator>pnamin77</dc:creator>
      <dc:date>2022-03-01T07:12:43Z</dc:date>
    </item>
    <item>
      <title>Re: Creating TYPES structure without nesting</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-types-structure-without-nesting/m-p/12475291#M2001368</link>
      <description>&lt;P&gt;You are using "INCLUDE STRUCTURE tab1" which means that tab1 is a data object. You should &lt;STRONG&gt;prefer&lt;/STRONG&gt; (not mandatory) referring to a data type as far as possible e.g. "INCLUDE TYPE type_of_tab1".&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2022 08:53:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-types-structure-without-nesting/m-p/12475291#M2001368</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2022-03-01T08:53:43Z</dc:date>
    </item>
    <item>
      <title>Re: Creating TYPES structure without nesting</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-types-structure-without-nesting/m-p/12475292#M2001369</link>
      <description>&lt;P&gt;If tab1 is a structured data type, this code works (same as Frederic but comma after tab1 replaced with dot):&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TYPES: BEGIN OF ty_custom_tab.
         include TYPE tab1.        
TYPES : field1   TYPE tab2-field1,       
       END OF ty_custom_tab.&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;If tab1 is a structured data object, you should use:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TYPES: BEGIN OF ty_custom_tab.
         include STRUCTURE tab1.        
TYPES : field1   TYPE tab2-field1,       
       END OF ty_custom_tab.&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 Mar 2022 08:55:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-types-structure-without-nesting/m-p/12475292#M2001369</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2022-03-01T08:55:57Z</dc:date>
    </item>
    <item>
      <title>Re: Creating TYPES structure without nesting</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-types-structure-without-nesting/m-p/12475293#M2001370</link>
      <description>&lt;P&gt;Sandra is also known as Maitre Capello (french joke) &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2022 09:11:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-types-structure-without-nesting/m-p/12475293#M2001370</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2022-03-01T09:11:24Z</dc:date>
    </item>
    <item>
      <title>Re: Creating TYPES structure without nesting</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-types-structure-without-nesting/m-p/12475294#M2001371</link>
      <description>&lt;P&gt;To be able to easily access both the fields and the structure, I &lt;A href="https://github.com/SAP/styleguides/issues/76"&gt;prefer&lt;/A&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TYPES: BEGIN OF ty_custom_tab,&lt;BR /&gt;         INCLUDE TYPE tab1 AS tab1.&lt;BR /&gt;TYPES:   field1 TYPE tab2-field1,&lt;BR /&gt;        END OF ty_custom_tab.      &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 Mar 2022 09:24:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-types-structure-without-nesting/m-p/12475294#M2001371</guid>
      <dc:creator>nomssi</dc:creator>
      <dc:date>2022-03-01T09:24:57Z</dc:date>
    </item>
    <item>
      <title>Re: Creating TYPES structure without nesting</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-types-structure-without-nesting/m-p/12475295#M2001372</link>
      <description>&lt;P&gt;Thanks  &lt;SPAN class="mention-scrubbed"&gt;sandrarossi&lt;/SPAN&gt;   &lt;SPAN class="mention-scrubbed"&gt;frdric.girod&lt;/SPAN&gt; ,&lt;/P&gt;&lt;P&gt;The ITAB1 in context for me is the table AUSP which is a transparent table (data object). So STRUCTURE worked here instead of TYPE.&lt;/P&gt;&lt;P&gt;If it would have been a STRUCTURE for eg. AUSPDATA, then TYPES would have worked instead.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2022 09:50:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-types-structure-without-nesting/m-p/12475295#M2001372</guid>
      <dc:creator>pnamin77</dc:creator>
      <dc:date>2022-03-01T09:50:52Z</dc:date>
    </item>
    <item>
      <title>Re: Creating TYPES structure without nesting</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-types-structure-without-nesting/m-p/12475296#M2001373</link>
      <description>&lt;P&gt; &lt;SPAN class="mention-scrubbed"&gt;sandra.rossi&lt;/SPAN&gt; &lt;BR /&gt;What would be a data type for a transparent table like MARA?&lt;BR /&gt;If I need to replace STRUCTURE with TYPE&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2022 09:52:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-types-structure-without-nesting/m-p/12475296#M2001373</guid>
      <dc:creator>pnamin77</dc:creator>
      <dc:date>2022-03-01T09:52:45Z</dc:date>
    </item>
    <item>
      <title>Re: Creating TYPES structure without nesting</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-types-structure-without-nesting/m-p/12475297#M2001374</link>
      <description>&lt;P&gt;A transparent table corresponds in ABAP to a structured data type of same name.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TYPES BEGIN OF structured_type.
INCLUDE TYPE mara AS mara. " AS mara to do as Jacques said
TYPES END OF structured_type.
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 Mar 2022 12:38:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-types-structure-without-nesting/m-p/12475297#M2001374</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2022-03-01T12:38:02Z</dc:date>
    </item>
    <item>
      <title>Re: Creating TYPES structure without nesting</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-types-structure-without-nesting/m-p/12475298#M2001375</link>
      <description>&lt;P&gt;This does work, I tried  &lt;SPAN class="mention-scrubbed"&gt;frdric.girod&lt;/SPAN&gt;'s suggestion and the only difference I made was putting that 'AS mara' statement.&lt;/P&gt;&lt;P&gt;I suspected the AS addition would be for Aliasing, though it made a big difference.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2022 13:16:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-types-structure-without-nesting/m-p/12475298#M2001375</guid>
      <dc:creator>pnamin77</dc:creator>
      <dc:date>2022-03-01T13:16:12Z</dc:date>
    </item>
  </channel>
</rss>

