<?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: IDOC segment handling with OOP in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/idoc-segment-handling-with-oop/m-p/5586281#M1273738</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
Would the approach of creating a class per each segment type with methods "Append", "Modify", "Delete" be feasible?
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Yes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The reason for it would be to track all the changes to the data &lt;/P&gt;&lt;P&gt;in the ORDERS IDOC in different user-exits by "Where-Used".&lt;/P&gt;&lt;P&gt;What do you mean by this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 21 May 2009 16:00:27 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-05-21T16:00:27Z</dc:date>
    <item>
      <title>IDOC segment handling with OOP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/idoc-segment-handling-with-oop/m-p/5586280#M1273737</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Let's say we have the following simplified ORDERS05 IDOC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ORDERS05 Purchasing/Sales&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Header &lt;/P&gt;&lt;P&gt;E1EDK01 IDoc: Document header general data&lt;/P&gt;&lt;P&gt;E1EDK14 IDoc: Document Header Organizational Data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rows ( Items )&lt;/P&gt;&lt;P&gt;E1EDP01 IDoc: Document Item General Data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And would like to create it using certain data.&lt;/P&gt;&lt;P&gt;Would the approach of creating a class per each segment type with methods "Append", "Modify", "Delete" be feasible?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, if we want to construct ORDERS05 IDOC, we call:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;ycl_e1edk01-&amp;gt;append( ls_e1edk01 ).
ycl_e1edk14-&amp;gt;append( ls_e1edk14 ).
ycl_e1edp01-&amp;gt;append( ls_e1edp01 ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If we would like to modify the data in E1EDK01 segment, of the IDOC, we would call:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;ycl_e1edk01-&amp;gt;modify( ls_e1edk01 ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The reason for it would be to track all the changes to the data &lt;/P&gt;&lt;P&gt;in the ORDERS IDOC in different user-exits by "Where-Used".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 May 2009 15:55:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/idoc-segment-handling-with-oop/m-p/5586280#M1273737</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-21T15:55:14Z</dc:date>
    </item>
    <item>
      <title>Re: IDOC segment handling with OOP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/idoc-segment-handling-with-oop/m-p/5586281#M1273738</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
Would the approach of creating a class per each segment type with methods "Append", "Modify", "Delete" be feasible?
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Yes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The reason for it would be to track all the changes to the data &lt;/P&gt;&lt;P&gt;in the ORDERS IDOC in different user-exits by "Where-Used".&lt;/P&gt;&lt;P&gt;What do you mean by this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 May 2009 16:00:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/idoc-segment-handling-with-oop/m-p/5586281#M1273738</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-21T16:00:27Z</dc:date>
    </item>
    <item>
      <title>Re: IDOC segment handling with OOP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/idoc-segment-handling-with-oop/m-p/5586282#M1273739</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you planning to use "Where-Used" for your IDoc segment classes / methods to track where in the user-exits they are used?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This may work if you are the only ABAP-er in your SAP shop. If you have more than one developer then how do you enforce that your class is being used in the user-exits?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 May 2009 12:55:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/idoc-segment-handling-with-oop/m-p/5586282#M1273739</guid>
      <dc:creator>former_member207438</dc:creator>
      <dc:date>2009-05-22T12:55:24Z</dc:date>
    </item>
    <item>
      <title>Re: IDOC segment handling with OOP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/idoc-segment-handling-with-oop/m-p/5586283#M1273740</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Be sure that, if the solution for this whole thing will be nice and usable, I will surely enforce it &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 May 2009 13:07:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/idoc-segment-handling-with-oop/m-p/5586283#M1273740</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-22T13:07:30Z</dc:date>
    </item>
    <item>
      <title>Re: IDOC segment handling with OOP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/idoc-segment-handling-with-oop/m-p/5586284#M1273741</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Creating individual classes would not be a good design. You should create a single class with different mehtods to achieve the functionality&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Couple of months ago I was also thinking to use OO ABAP for the IDoc Processing (but I am not able to put this design into action).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Design would be:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
PROCESS_SEGMENTS  Public 
  Changing IA_EDIDD type EDIDD   (Current work area)
  Changing IT_EDIDD type EDIDD   (Actual Idoc internal table)
  Importing IF_TYPE type CHAR1  (Type of processing A - Append, M - Modify, D - Delete)
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Individual private methods for processing individual Segments:&lt;/P&gt;&lt;P&gt;E.g. PROCESS_E1EDK01, PROCESS_E1EDK14 etc. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Call this private methods from the public method PROCESS_SEGMENTS. You can try to do it dyanmically to avoid future changes (following [Open-Closed Principle|/people/naimesh.patel/blog/2009/05/20/object-oriented-design-principles-oodp-open-closed-principleocp]) like this: &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  concatenate 'PROCESS_' ia_edidd-segnam into lf_method.
  call method me-&amp;gt;(lf_method).
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Naimesh Patel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 May 2009 13:17:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/idoc-segment-handling-with-oop/m-p/5586284#M1273741</guid>
      <dc:creator>naimesh_patel</dc:creator>
      <dc:date>2009-05-22T13:17:18Z</dc:date>
    </item>
  </channel>
</rss>

