<?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: Getting metadata for FMs where data structure elements also have structure in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-metadata-for-fms-where-data-structure-elements-also-have-structure/m-p/7350490#M1540561</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Ulf&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One possible option is to recursively loop over the records of the FIELDS table which have a "non-flat" ABAPTYPE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 22 Oct 2010 12:11:21 GMT</pubDate>
    <dc:creator>uwe_schieferstein</dc:creator>
    <dc:date>2010-10-22T12:11:21Z</dc:date>
    <item>
      <title>Getting metadata for FMs where data structure elements also have structure</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-metadata-for-fms-where-data-structure-elements-also-have-structure/m-p/7350489#M1540560</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;I'm sorry if this is a double post, but I added this initially to a thread that was already set to answered, and I'm not sure of the protocol - if there will be any further responses if that is the case, so I'm opening this new threas as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've been using RFC_GET_FUNCTION_INTERFACE and RFC_GET_STRUCTURE_DEFINITION successfully for a number of years, but now I have a problem. Some FMs, like /POSDW/CREATE_TRANSACTIONS_EXT, have parameters that have structures, whose elements also have structure. But RFC_GET_STRUCTURE_DEFINITION does not give a handle to get the structure of a returned data element.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anybody know how I can work around this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Oct 2010 10:10:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/getting-metadata-for-fms-where-data-structure-elements-also-have-structure/m-p/7350489#M1540560</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-22T10:10:52Z</dc:date>
    </item>
    <item>
      <title>Re: Getting metadata for FMs where data structure elements also have structure</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-metadata-for-fms-where-data-structure-elements-also-have-structure/m-p/7350490#M1540561</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Ulf&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One possible option is to recursively loop over the records of the FIELDS table which have a "non-flat" ABAPTYPE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Oct 2010 12:11:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/getting-metadata-for-fms-where-data-structure-elements-also-have-structure/m-p/7350490#M1540561</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2010-10-22T12:11:21Z</dc:date>
    </item>
    <item>
      <title>Re: Getting metadata for FMs where data structure elements also have structure</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-metadata-for-fms-where-data-structure-elements-also-have-structure/m-p/7350491#M1540562</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;I think you can use the code similar to the one below...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;some of the things not covered in this are&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. all types for which   CALL FUNCTION 'RFC_GET_NAMETAB' is not returning result, you can call CALL FUNCTION 'RFC_GET_STRUCTURE_DEFINITION' directly. I have not covered that in this code. Hope this is helps in resolving your issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, the code is not optimized. So there is some scope for optimization of this code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  ZTEST_GET_SREUCTURE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : PARAMS	type table of	RFC_FUNINT,&lt;/P&gt;&lt;P&gt;      ls_params like line of params.&lt;/P&gt;&lt;P&gt;data: NAMETAB	type table of	X031L,&lt;/P&gt;&lt;P&gt;      ls_NAMETAB like line of NAMETAB.&lt;/P&gt;&lt;P&gt;data: FIELDS  type table of RFC_FIELDS,&lt;/P&gt;&lt;P&gt;      ls_fields like line of fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'RFC_GET_FUNCTION_INTERFACE'&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    FUNCNAME                      = 'fm_test_fm'&lt;/P&gt;&lt;P&gt;  TABLES&lt;/P&gt;&lt;P&gt;    PARAMS                        = PARAMS&lt;/P&gt;&lt;P&gt;          .&lt;/P&gt;&lt;P&gt;IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at params into ls_params.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'RFC_GET_NAMETAB'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      TABNAME                     = LS_PARAMS-TABNAME&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      NAMETAB                     = NAMETAB&lt;/P&gt;&lt;P&gt;            .&lt;/P&gt;&lt;P&gt;  IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;  loop at NAMETAB into ls_NAMETAB.&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'RFC_GET_STRUCTURE_DEFINITION'&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    TABNAME                     = LS_NAMETAB-ROLLNAME&lt;/P&gt;&lt;P&gt;  TABLES&lt;/P&gt;&lt;P&gt;    FIELDS                      = FIELDS&lt;/P&gt;&lt;P&gt;         .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    loop at fields into ls_fields.&lt;/P&gt;&lt;P&gt;      write: ls_fields-FIELDNAME.&lt;/P&gt;&lt;P&gt;    endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Oct 2010 08:31:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/getting-metadata-for-fms-where-data-structure-elements-also-have-structure/m-p/7350491#M1540562</guid>
      <dc:creator>former_member266380</dc:creator>
      <dc:date>2010-10-25T08:31:43Z</dc:date>
    </item>
    <item>
      <title>Re: Getting metadata for FMs where data structure elements also have structure</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-metadata-for-fms-where-data-structure-elements-also-have-structure/m-p/7350492#M1540563</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I should say that I'm calling these RFC functions from the RFC C library with an external program, so I'm not looking to exeute this in an ABAP environment - although the principles are similar.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The last answer, the use of RFC_GET_NAMETAB, gives me the necessary structure reference that RFC_GET_STRUCTURE_DEFINITION does not, thanks for that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The solution is still rather complex.  I need to use RFC_GET_STRUCTURE_DEFINITION to get the structure initially - this is because the table reference found in RFC_GET_FUNCTION_INTERFACE only works with RFC_GET_STRUCTURE_DEFINITION and not RFC_GET_NAMETAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then if I find a secondary structure, then I need to use the table name returned by RFC_GET_STRUCTURE_DEFINITION for an element (which is the parent table name) to input to RFC_GET_NAMETAB.  Then the roll name is the name of the secondary structure.  This can be input to RFC_GET_STRUCTURE_DEFINITION, etc.,  and it all can be made to work recursively.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe there is a function somewhere that could be used to cross-reference the table names in a better way, but this works OK for now.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Oct 2010 10:37:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/getting-metadata-for-fms-where-data-structure-elements-also-have-structure/m-p/7350492#M1540563</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-28T10:37:14Z</dc:date>
    </item>
  </channel>
</rss>

