<?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 IDOC data split by dynamic structure in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/idoc-data-split-by-dynamic-structure/m-p/11121068#M1904720</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a specific program, I want to split a string (EDID4-SDATA)&amp;nbsp; with a dynamic structure.&lt;/P&gt;&lt;P&gt;The structure should not be defined with Data instruction. Because&amp;nbsp; the name of this structure (existing in dictionnary) is save in a table EDID4 field&lt;/P&gt;&lt;P&gt;SEGNAM. This structure can be any IDOC segment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So my first solution is to declare (with data instruction)&amp;nbsp; all segments as structure that I use in this program. &lt;/P&gt;&lt;P&gt;And define the string EDID4-SDATA as a field symbol.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am looking for another solution which avoid to create all segment as structure in data paragraph.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Stéphane&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Jun 2015 16:00:18 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2015-06-10T16:00:18Z</dc:date>
    <item>
      <title>IDOC data split by dynamic structure</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/idoc-data-split-by-dynamic-structure/m-p/11121068#M1904720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a specific program, I want to split a string (EDID4-SDATA)&amp;nbsp; with a dynamic structure.&lt;/P&gt;&lt;P&gt;The structure should not be defined with Data instruction. Because&amp;nbsp; the name of this structure (existing in dictionnary) is save in a table EDID4 field&lt;/P&gt;&lt;P&gt;SEGNAM. This structure can be any IDOC segment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So my first solution is to declare (with data instruction)&amp;nbsp; all segments as structure that I use in this program. &lt;/P&gt;&lt;P&gt;And define the string EDID4-SDATA as a field symbol.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am looking for another solution which avoid to create all segment as structure in data paragraph.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Stéphane&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jun 2015 16:00:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/idoc-data-split-by-dynamic-structure/m-p/11121068#M1904720</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-06-10T16:00:18Z</dc:date>
    </item>
    <item>
      <title>Re: IDOC data split by dynamic structure</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/idoc-data-split-by-dynamic-structure/m-p/11121069#M1904721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you aware of RTTI/RTTC classes that can be used to create structure dynamically?&lt;/P&gt;&lt;P&gt;Have a look at below snippet. Once field symbol has the data, you can access specific field using &lt;EM&gt;assign component ... of structure&lt;/EM&gt; statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;DATA: lo_segment_type&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TYPE REF TO cl_abap_structdescr,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lo_segment_data&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TYPE REF TO data,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ls_edid4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TYPE edid4.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;FIELD-SYMBOLS &amp;lt;ls_segment_data&amp;gt; TYPE any.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;SELECT SINGLE * FROM edid4 INTO ls_edid4.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;IF sy-subrc EQ 0.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp; lo_segment_type ?= cl_abap_structdescr=&amp;gt;describe_by_name( ls_edid4-segnam ).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp; CREATE DATA lo_segment_data TYPE HANDLE lo_segment_type.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp; ASSIGN lo_segment_data-&amp;gt;* TO &amp;lt;ls_segment_data&amp;gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp; IF &amp;lt;ls_segment_data&amp;gt; IS ASSIGNED.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ls_segment_data&amp;gt; = ls_edid4-sdata.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp; ENDIF.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp; BREAK-POINT.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;ENDIF.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jun 2015 05:00:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/idoc-data-split-by-dynamic-structure/m-p/11121069#M1904721</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-06-11T05:00:55Z</dc:date>
    </item>
  </channel>
</rss>

