<?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: Convert a structure into a table - Function module in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-a-structure-into-a-table-function-module/m-p/5096914#M1182937</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a structure containing: name/city/country/gender&lt;/P&gt;&lt;P&gt;Now i want to convert this structure into a table with the lines:&lt;/P&gt;&lt;P&gt;name&lt;/P&gt;&lt;P&gt;city&lt;/P&gt;&lt;P&gt;country&lt;/P&gt;&lt;P&gt;gender&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use the method DESCRIBE_BY_DATA method of the class cl_abap_structdescr. This will return you a reference to the CL_ABAP_TYPEDESCR class and then you can cast this to an object of the cl_abap_structdescr class and then use the attribute components to get the list of compnents.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Advait&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 09 Feb 2009 19:27:13 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-02-09T19:27:13Z</dc:date>
    <item>
      <title>Convert a structure into a table - Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-a-structure-into-a-table-function-module/m-p/5096907#M1182930</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I heard of a function module which converts a structure into a table.&lt;/P&gt;&lt;P&gt;Afterwards every line of the table represents a field of the converted structure. Does anyone know the name of this function module?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thx&lt;/P&gt;&lt;P&gt;Stephan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Feb 2009 11:31:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-a-structure-into-a-table-function-module/m-p/5096907#M1182930</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-09T11:31:23Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a structure into a table - Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-a-structure-into-a-table-function-module/m-p/5096908#M1182931</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi bro....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;u can use fm&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FICO_CONVERSION_AMTPOS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for ur purpose&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Feb 2009 11:36:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-a-structure-into-a-table-function-module/m-p/5096908#M1182931</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-09T11:36:40Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a structure into a table - Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-a-structure-into-a-table-function-module/m-p/5096909#M1182932</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;  you can check this  MS_GET_MASTERDATA_STRUCT_TABLE&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Viquar Iqbal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Feb 2009 11:37:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-a-structure-into-a-table-function-module/m-p/5096909#M1182932</guid>
      <dc:creator>viquar_iqbal</dc:creator>
      <dc:date>2009-02-09T11:37:43Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a structure into a table - Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-a-structure-into-a-table-function-module/m-p/5096910#M1182933</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Stephen,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use the Method CL_WD_DYNAMIC_TOOL=&amp;gt;CREATE_TABLE_FROM_NODE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;kalyan B&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Feb 2009 11:38:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-a-structure-into-a-table-function-module/m-p/5096910#M1182933</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-09T11:38:47Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a structure into a table - Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-a-structure-into-a-table-function-module/m-p/5096911#M1182934</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Not sure if this is the one you are looking for. &lt;STRONG&gt;REUSE_ALV_FIELDCATALOG_MERGE&lt;/STRONG&gt; . This function takes a structure as an input and returns the field catalogue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Advait&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Feb 2009 12:37:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-a-structure-into-a-table-function-module/m-p/5096911#M1182934</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-09T12:37:38Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a structure into a table - Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-a-structure-into-a-table-function-module/m-p/5096912#M1182935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello again!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No, my problem doesn´t concern field catalogues. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately i have also problems making any of the other function modules work.&lt;/P&gt;&lt;P&gt;MS_GET_MASTERDATA_STRUCT_TABLE seems to fit best for my problem, however as i said i cannot make it run as a have problems with the parameters. Do i have to modify the function modules to work with my wanted structure or is it possible without modifying?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Again for explanation:&lt;/P&gt;&lt;P&gt;I have a structure containing: name/city/country/gender&lt;/P&gt;&lt;P&gt;Now i want to convert this structure into a table with the lines:&lt;/P&gt;&lt;P&gt;name&lt;/P&gt;&lt;P&gt;city&lt;/P&gt;&lt;P&gt;country&lt;/P&gt;&lt;P&gt;gender&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(I need that convertation to be able to loop over the table and define some selectioncriterias.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;greez &lt;/P&gt;&lt;P&gt;Stephan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Feb 2009 16:59:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-a-structure-into-a-table-function-module/m-p/5096912#M1182935</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-09T16:59:57Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a structure into a table - Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-a-structure-into-a-table-function-module/m-p/5096913#M1182936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you do something like this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT zz_temp.

TYPES: BEGIN OF  ty_table,
  tabline(60)  TYPE c.
TYPES: END OF  ty_table.

DATA:
  g_s_tstc  TYPE  tstc,
  g_s_tab   TYPE ty_table,
  g_t_tab   TYPE TABLE OF ty_table,
  g_lines   TYPE i.


FIELD-SYMBOLS: &amp;lt;fs_component&amp;gt; TYPE ANY.


SELECT * FROM tstc
  INTO CORRESPONDING FIELDS OF  g_s_tstc
  WHERE tcode = 'SE38'.
ENDSELECT.


DO.
  ASSIGN COMPONENT sy-index
    OF STRUCTURE g_s_tstc TO &amp;lt;fs_component&amp;gt;.
  IF sy-subrc &amp;lt;&amp;gt; 0.
    EXIT.
  ENDIF.
  g_s_tab-tabline = &amp;lt;fs_component&amp;gt;.
  APPEND g_s_tab TO g_t_tab.
  WRITE:/ g_s_tab-tabline.
ENDDO.

DESCRIBE TABLE g_t_tab LINES g_lines.

WRITE g_lines.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Feb 2009 17:10:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-a-structure-into-a-table-function-module/m-p/5096913#M1182936</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-09T17:10:05Z</dc:date>
    </item>
    <item>
      <title>Re: Convert a structure into a table - Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-a-structure-into-a-table-function-module/m-p/5096914#M1182937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a structure containing: name/city/country/gender&lt;/P&gt;&lt;P&gt;Now i want to convert this structure into a table with the lines:&lt;/P&gt;&lt;P&gt;name&lt;/P&gt;&lt;P&gt;city&lt;/P&gt;&lt;P&gt;country&lt;/P&gt;&lt;P&gt;gender&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use the method DESCRIBE_BY_DATA method of the class cl_abap_structdescr. This will return you a reference to the CL_ABAP_TYPEDESCR class and then you can cast this to an object of the cl_abap_structdescr class and then use the attribute components to get the list of compnents.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Advait&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Feb 2009 19:27:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-a-structure-into-a-table-function-module/m-p/5096914#M1182937</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-09T19:27:13Z</dc:date>
    </item>
  </channel>
</rss>

