<?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 Dynamic structure creation in SAP ABAP using classes in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation-in-sap-abap-using-classes/m-p/12501266#M2003226</link>
    <description>&lt;P&gt;Hi Experts,&lt;/P&gt;
  &lt;P&gt;I need to create dynamic structure and internal table to append the records to the corresponding internal table. I am using get( ) from class CL_ABAP_STRUCTDESCR. But not getting the required result.&lt;/P&gt;
  &lt;P&gt;Can anyone suggest what should be the approach for the same.&lt;/P&gt;
  &lt;P&gt;Thanks and Regards,&lt;/P&gt;
  &lt;P&gt;Aditya Mane&lt;/P&gt;</description>
    <pubDate>Wed, 09 Mar 2022 05:07:49 GMT</pubDate>
    <dc:creator>former_member4082</dc:creator>
    <dc:date>2022-03-09T05:07:49Z</dc:date>
    <item>
      <title>Dynamic structure creation in SAP ABAP using classes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation-in-sap-abap-using-classes/m-p/12501266#M2003226</link>
      <description>&lt;P&gt;Hi Experts,&lt;/P&gt;
  &lt;P&gt;I need to create dynamic structure and internal table to append the records to the corresponding internal table. I am using get( ) from class CL_ABAP_STRUCTDESCR. But not getting the required result.&lt;/P&gt;
  &lt;P&gt;Can anyone suggest what should be the approach for the same.&lt;/P&gt;
  &lt;P&gt;Thanks and Regards,&lt;/P&gt;
  &lt;P&gt;Aditya Mane&lt;/P&gt;</description>
      <pubDate>Wed, 09 Mar 2022 05:07:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation-in-sap-abap-using-classes/m-p/12501266#M2003226</guid>
      <dc:creator>former_member4082</dc:creator>
      <dc:date>2022-03-09T05:07:49Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic structure creation in SAP ABAP using classes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation-in-sap-abap-using-classes/m-p/12501267#M2003227</link>
      <description>&lt;P&gt;Could you post your code ? (using the [CODE] button)&lt;/P&gt;</description>
      <pubDate>Wed, 09 Mar 2022 06:21:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation-in-sap-abap-using-classes/m-p/12501267#M2003227</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2022-03-09T06:21:50Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic structure creation in SAP ABAP using classes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation-in-sap-abap-using-classes/m-p/12501268#M2003228</link>
      <description>&lt;P&gt;Your code is missing&lt;/P&gt;&lt;P&gt;+&lt;/P&gt;&lt;P&gt;What result do you get and what do you expect?&lt;/P&gt;</description>
      <pubDate>Wed, 09 Mar 2022 07:08:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation-in-sap-abap-using-classes/m-p/12501268#M2003228</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2022-03-09T07:08:18Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic structure creation in SAP ABAP using classes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation-in-sap-abap-using-classes/m-p/12501269#M2003229</link>
      <description>&lt;P&gt;Here is an example for dynamically creating a work area and internal table and then using that for a dynamic SELECT. I hope it helps. &lt;/P&gt;REPORT  zema_dynamic_itab.&lt;BR /&gt;&lt;BR /&gt;DATA:&lt;BR /&gt;  lo_itab  TYPE REF TO cl_abap_tabledescr,&lt;BR /&gt;  lo_struc TYPE REF TO cl_abap_structdescr,&lt;BR /&gt;  lo_data  TYPE REF TO cl_abap_datadescr,&lt;BR /&gt;  lo_type  TYPE REF TO cl_abap_typedescr,&lt;BR /&gt;  gt_keys  TYPE string_table.&lt;BR /&gt;&lt;BR /&gt;DATA: lt_dfies TYPE TABLE OF dfies,&lt;BR /&gt;      ls_dfies LIKE LINE OF lt_dfies.&lt;BR /&gt;&lt;BR /&gt;DATA: lt_comp TYPE abap_component_tab,&lt;BR /&gt;      ls_comp LIKE LINE OF lt_comp.&lt;BR /&gt;&lt;BR /&gt;PARAMETERS:&lt;BR /&gt;  p_tab TYPE ddobjname DEFAULT 'ICLITEM'.&lt;BR /&gt;&lt;BR /&gt;START-OF-SELECTION.&lt;BR /&gt;  CALL FUNCTION 'DDIF_NAMETAB_GET'&lt;BR /&gt;    EXPORTING&lt;BR /&gt;      tabname   = p_tab&lt;BR /&gt;    TABLES&lt;BR /&gt;      dfies_tab = lt_dfies&lt;BR /&gt;    EXCEPTIONS&lt;BR /&gt;      not_found = 1&lt;BR /&gt;      OTHERS    = 2.&lt;BR /&gt;&lt;BR /&gt;  LOOP AT lt_dfies INTO ls_dfies&lt;BR /&gt;     WHERE keyflag IS NOT INITIAL.&lt;BR /&gt;    APPEND ls_dfies-fieldname TO gt_keys.&lt;BR /&gt;&lt;BR /&gt;    ls_comp-name = ls_dfies-fieldname.&lt;BR /&gt;&lt;BR /&gt;    CALL METHOD cl_abap_datadescr=&amp;gt;describe_by_name&lt;BR /&gt;      EXPORTING&lt;BR /&gt;        p_name         = ls_dfies-rollname&lt;BR /&gt;      RECEIVING&lt;BR /&gt;        p_descr_ref    = lo_type&lt;BR /&gt;      EXCEPTIONS&lt;BR /&gt;        type_not_found = 1&lt;BR /&gt;        OTHERS         = 2.&lt;BR /&gt;&lt;BR /&gt;    ls_comp-type ?= lo_type.&lt;BR /&gt;&lt;BR /&gt;    APPEND ls_comp TO lt_comp.&lt;BR /&gt;  ENDLOOP.&lt;BR /&gt;&lt;BR /&gt;  TRY.&lt;BR /&gt;      CALL METHOD cl_abap_structdescr=&amp;gt;create&lt;BR /&gt;        EXPORTING&lt;BR /&gt;          p_components = lt_comp&lt;BR /&gt;        RECEIVING&lt;BR /&gt;          p_result     = lo_struc.&lt;BR /&gt;&lt;BR /&gt;    CATCH cx_sy_struct_creation .&lt;BR /&gt;  ENDTRY.&lt;BR /&gt;&lt;BR /&gt;  TRY.&lt;BR /&gt;*     Create called multiple times for the same structure can cause memory problems. Use get method instead&lt;BR /&gt;      CALL METHOD cl_abap_tabledescr=&amp;gt;get&lt;BR /&gt;        EXPORTING&lt;BR /&gt;          p_line_type  = lo_struc&lt;BR /&gt;        RECEIVING&lt;BR /&gt;          p_result     = lo_itab.&lt;BR /&gt;&lt;BR /&gt;    CATCH cx_sy_table_creation .&lt;BR /&gt;  ENDTRY.&lt;BR /&gt;&lt;BR /&gt;  BREAK-POINT.&lt;BR /&gt;&lt;BR /&gt;  DATA: lo_tab TYPE REF TO data.&lt;BR /&gt;  FIELD-SYMBOLS: &amp;lt;lt_tab&amp;gt; TYPE table.&lt;BR /&gt;&lt;BR /&gt;  CREATE DATA lo_tab TYPE HANDLE lo_itab.&lt;BR /&gt;  ASSIGN lo_tab-&amp;gt;* TO &amp;lt;lt_tab&amp;gt;.&lt;BR /&gt;&lt;BR /&gt;  SELECT (gt_keys) INTO TABLE &amp;lt;lt_tab&amp;gt;&lt;BR /&gt;    FROM (p_tab) UP TO 100 ROWS.&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;&lt;CODE&gt;  BREAK-POINT.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 11 Mar 2022 21:49:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation-in-sap-abap-using-classes/m-p/12501269#M2003229</guid>
      <dc:creator>emanuel_klenner</dc:creator>
      <dc:date>2022-03-11T21:49:03Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic structure creation in SAP ABAP using classes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation-in-sap-abap-using-classes/m-p/12501270#M2003230</link>
      <description>&lt;P&gt;Did you perform a simple search in forum such as &lt;A href="https://launchpad.support.sap.com/#/solutions/scnwiki/?q=%252522CL_ABAP_STRUCTDESCR%252522"&gt;"CL_ABAP_STRUCTDESCR" in wiki part&lt;/A&gt;, you should&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2022 15:09:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-structure-creation-in-sap-abap-using-classes/m-p/12501270#M2003230</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2022-03-14T15:09:58Z</dc:date>
    </item>
  </channel>
</rss>

