<?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: Dynamically determine line type in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-determine-line-type/m-p/12443085#M1998845</link>
    <description>&lt;PRE&gt;&lt;CODE&gt;data o_struct_descr TYPE REF TO cl_abap_structdescr.
o_struct_descr ?= cl_abap_typedescr=&amp;gt;describe_by_data( ls_text ).
data(structure_fields) = o_struct_descr-&amp;gt;get_components( ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;something like that could works&lt;/P&gt;</description>
    <pubDate>Tue, 22 Jun 2021 07:38:13 GMT</pubDate>
    <dc:creator>FredericGirod</dc:creator>
    <dc:date>2021-06-22T07:38:13Z</dc:date>
    <item>
      <title>Dynamically determine line type</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-determine-line-type/m-p/12443084#M1998844</link>
      <description>&lt;P&gt;I have a field ls_text type any.&lt;/P&gt;
  &lt;P&gt;Sometimes ls_text will contain 'ID12243 Glenn Anjikovic' i.e. (userid, first name, lastname), &lt;/P&gt;
  &lt;P&gt;other times ls_text will have 'XYZCompany Los Angeles USA' i.e. (Company name, City, Country).&lt;/P&gt;
  &lt;P&gt;Is there any way to determine the fields in the structure during runtime? There could be more possibilities than just the 2 listed above.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jun 2021 07:24:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-determine-line-type/m-p/12443084#M1998844</guid>
      <dc:creator>former_member201275</dc:creator>
      <dc:date>2021-06-22T07:24:13Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically determine line type</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-determine-line-type/m-p/12443085#M1998845</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;data o_struct_descr TYPE REF TO cl_abap_structdescr.
o_struct_descr ?= cl_abap_typedescr=&amp;gt;describe_by_data( ls_text ).
data(structure_fields) = o_struct_descr-&amp;gt;get_components( ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;something like that could works&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jun 2021 07:38:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-determine-line-type/m-p/12443085#M1998845</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2021-06-22T07:38:13Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically determine line type</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-determine-line-type/m-p/12443086#M1998846</link>
      <description>&lt;P&gt;Whilst Frederic's code fragment goes the right way, I would like to share a link to a previous post:&lt;/P&gt;&lt;P&gt;&lt;A href="https://answers.sap.com/questions/952106/how-to-get-datatype-of-fields-in-dynamic-structure.html" target="_blank"&gt;Answer To: How to get datatype of fields in dynamic structures (2005)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;(https://answers.sap.com/questions/952106/how-to-get-datatype-of-fields-in-dynamic-structure.html)&lt;/P&gt;&lt;P&gt;In there, you find an expanded code segment that can easily be completed into a small report, which will accept the name of a structure and print properties of each field, identified dynamically at run-time.&lt;/P&gt;&lt;P&gt;My own added value is a friendly reminder to Unicode. Since release NW 6.10 Unicode has been an option, but with NW 7.x and S/4HANA it's become mandatory. &lt;/P&gt;&lt;P&gt;The name of your field "ls_text" suggests that your various structures contain only character-like fields, e.g. 'C','N','D' or 'T'; in this case you're fine. Structures with number-like types, e.g. 'P', 'I' or 'F', or byte-like types, e.g. 'X', require consideration of fragment view and alignment gaps. Have a look at the following link:&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.sap.com/viewer/cfae740a0a21455dbe6e510c2d86e36a/LATEST/en-US/623f2cadb35311d5993800508b6b8b11.html" target="_blank"&gt;SAP Help: ABAP and Unicode&lt;/A&gt;&lt;/P&gt;&lt;P&gt;(https://help.sap.com/viewer/cfae740a0a21455dbe6e510c2d86e36a/LATEST/en-US/623f2cadb35311d5993800508b6b8b11.html)&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jun 2021 09:43:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamically-determine-line-type/m-p/12443086#M1998846</guid>
      <dc:creator>UBrand251</dc:creator>
      <dc:date>2021-06-22T09:43:49Z</dc:date>
    </item>
  </channel>
</rss>

