<?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: Fetching segment content in IDOC in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-segment-content-in-idoc/m-p/2894359#M680302</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;read SDATA (segment data) into the structure of the same type as the idoc segement and use the field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the field number and the idoc type are to be determined dynamically then you have to use field-symbols and use assign component statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Aj&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Abhishek Jolly&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 12 Oct 2007 20:49:51 GMT</pubDate>
    <dc:creator>former_member195698</dc:creator>
    <dc:date>2007-10-12T20:49:51Z</dc:date>
    <item>
      <title>Fetching segment content in IDOC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-segment-content-in-idoc/m-p/2894357#M680300</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;My idoc segment contains total 16 fields but in those 16 fields I want to pick seventh field value. In the table edid4 the SDATA field contains mixing of all 16 fields data so how to pick seventh field data in that.&lt;/P&gt;&lt;P&gt;Please help me. I will give points.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2007 11:11:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-segment-content-in-idoc/m-p/2894357#M680300</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-12T11:11:30Z</dc:date>
    </item>
    <item>
      <title>Re: Fetching segment content in IDOC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-segment-content-in-idoc/m-p/2894358#M680301</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;yes u can get like this..say for example i have a segment which has 5 fields..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1&amp;gt;matnr (18 character)&lt;/P&gt;&lt;P&gt;2&amp;gt;maktx (40 characters)&lt;/P&gt;&lt;P&gt;3&amp;gt;matkl (9 characters)&lt;/P&gt;&lt;P&gt;4&amp;gt;field1 (5 characters)&lt;/P&gt;&lt;P&gt;5&amp;gt;field2 (2 characters)..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if i want third field value i can do this..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;v_matkl = i_edidd-sdata+58(9).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;58 because,ur matnr has 18 chars and maktx has 40 chars....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try this..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nagaraj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2007 11:27:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-segment-content-in-idoc/m-p/2894358#M680301</guid>
      <dc:creator>former_member404244</dc:creator>
      <dc:date>2007-10-12T11:27:32Z</dc:date>
    </item>
    <item>
      <title>Re: Fetching segment content in IDOC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-segment-content-in-idoc/m-p/2894359#M680302</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;read SDATA (segment data) into the structure of the same type as the idoc segement and use the field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the field number and the idoc type are to be determined dynamically then you have to use field-symbols and use assign component statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Aj&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Abhishek Jolly&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2007 20:49:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-segment-content-in-idoc/m-p/2894359#M680302</guid>
      <dc:creator>former_member195698</dc:creator>
      <dc:date>2007-10-12T20:49:51Z</dc:date>
    </item>
    <item>
      <title>Re: Fetching segment content in IDOC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-segment-content-in-idoc/m-p/2894360#M680303</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;Try IDOC_READ_COMPLETELY to read segment and values based on IDoc number. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sri&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2007 23:08:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-segment-content-in-idoc/m-p/2894360#M680303</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-12T23:08:07Z</dc:date>
    </item>
    <item>
      <title>Re: Fetching segment content in IDOC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-segment-content-in-idoc/m-p/2894361#M680304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Babji,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best way would be declare a variable of type segment and then move data from SDATA to segement variable. So var-field7 ( where as field7--&amp;gt; Sevent field name)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using this technic you can always read correct field value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will help. Let me know if you need more details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nilesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2007 23:26:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-segment-content-in-idoc/m-p/2894361#M680304</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-12T23:26:17Z</dc:date>
    </item>
    <item>
      <title>Re: Fetching segment content in IDOC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-segment-content-in-idoc/m-p/2894362#M680305</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Babji, YOu can use the function modules: &lt;/P&gt;&lt;P&gt;1) EDI_DOCUMENT_OPEN_FOR_READ&lt;/P&gt;&lt;P&gt;2) EDI_SEGMENTS_GET_ALL and&lt;/P&gt;&lt;P&gt;3) EDI_DOCUMENT_CLOSE_READ&lt;/P&gt;&lt;P&gt;in the same order:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sample code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'EDI_DOCUMENT_OPEN_FOR_READ'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      DOCUMENT_NUMBER = P_DOCNUM&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;      IDOC_CONTROL    = F_IDOC_CONTROL&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      OTHERS          = 01.&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;    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;P&gt;            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4&lt;/P&gt;&lt;P&gt;            RAISING ERROR_OPENING_IDOC.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Read IDOC data segments&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL FUNCTION 'EDI_SEGMENTS_GET_ALL'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      DOCUMENT_NUMBER = P_DOCNUM&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      IDOC_CONTAINERS = T_IDOC_DATA&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      OTHERS          = 01.&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;    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;P&gt;            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4&lt;/P&gt;&lt;P&gt;            RAISING ERROR_READING_IDOC.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Close IDOC&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL FUNCTION 'EDI_DOCUMENT_CLOSE_READ'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      DOCUMENT_NUMBER = P_DOCNUM&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;      IDOC_CONTROL    = F_IDOC_CONTROL&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      OTHERS          = 01.&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;    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;P&gt;            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4&lt;/P&gt;&lt;P&gt;            RAISING ERROR_CLOSING_IDOC.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you can use teh T_idoc_data intermal table to read the element in the segment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi Kanth Talagana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 13 Oct 2007 02:22:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-segment-content-in-idoc/m-p/2894362#M680305</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-13T02:22:46Z</dc:date>
    </item>
  </channel>
</rss>

