<?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: Function Module versus Object Oriented Programming(OOP's) in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-versus-object-oriented-programming-oop-s/m-p/2267765#M492286</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just to reiterate what others have said,  the use of OO moving foward will become more and more important, notice that with Web Dynpro ABAP, it is all OO, but also understand that function modules still have there place.  For example, the use of function modules and LUW.  Meaning firing a function module in another work process or in an update task.  THis kind of thing is not supported by classes, so if you have such a requirement, then a function module is the way to go.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;RIch Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 24 May 2007 01:42:09 GMT</pubDate>
    <dc:creator>RichHeilman</dc:creator>
    <dc:date>2007-05-24T01:42:09Z</dc:date>
    <item>
      <title>Function Module versus Object Oriented Programming(OOP's)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-versus-object-oriented-programming-oop-s/m-p/2267757#M492278</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi  All,&lt;/P&gt;&lt;P&gt; I was recently thiking about why should i use Function Modules when i can as well work with OOPs concept? Can we do without Function Module? In which scenarios would we prefer a Function Module and why? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly please answer the above questions. I have been confused about ths for quite some time. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: I shall reward all answers which i find helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 May 2007 16:21:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-versus-object-oriented-programming-oop-s/m-p/2267757#M492278</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-22T16:21:08Z</dc:date>
    </item>
    <item>
      <title>Re: Function Module versus Object Oriented Programming(OOP's)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-versus-object-oriented-programming-oop-s/m-p/2267758#M492279</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Gayatri,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you are correct,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but sap is introducing OOPs concepet recently , where as there are lot of pre defined function modules existing from beggining. So instead of writing the code again with OOPs its better to go with the existing function modules rite...&lt;/P&gt;&lt;P&gt;It saves lot of time not only that those are sap provided standard function modules you will not get much problems..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 May 2007 16:30:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-versus-object-oriented-programming-oop-s/m-p/2267758#M492279</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-22T16:30:09Z</dc:date>
    </item>
    <item>
      <title>Re: Function Module versus Object Oriented Programming(OOP's)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-versus-object-oriented-programming-oop-s/m-p/2267759#M492280</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;Go through this link,&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5954f411d194a60000e8353423/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5954f411d194a60000e8353423/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Azaz Ali.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 May 2007 17:07:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-versus-object-oriented-programming-oop-s/m-p/2267759#M492280</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-22T17:07:05Z</dc:date>
    </item>
    <item>
      <title>Re: Function Module versus Object Oriented Programming(OOP's)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-versus-object-oriented-programming-oop-s/m-p/2267760#M492281</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Gayatri&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I am in need of a functionality where I believe the SAP standard provides this "service" (either as function module or class method) I look&lt;/P&gt;&lt;P&gt;- first for class methods and&lt;/P&gt;&lt;P&gt;- then for function modules&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why? In many cases the classes are more powerful and versatile then the corresponding function modules.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will give you an example: for reading timesheet data (table CATSDB) we can use either&lt;/P&gt;&lt;P&gt;- BAPI &amp;lt;b&amp;gt;BAPI_CATIMESHEETRECORD_GETLIST&amp;lt;/b&amp;gt; or the &lt;/P&gt;&lt;P&gt;- class &amp;lt;b&amp;gt;CL_DBSEL_CATS&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Selection Criteria&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;The BAPI allows the following selection criteria:&lt;/P&gt;&lt;P&gt;- FROMDATE, TODATE, employees&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The CONSTRUCTOR method of class CL_DBSEL_CATS has the following interface:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;IM_CALLING_PROGRAM	Calling Program
IM_AUTHORITY_CHECK_TYPE	Authorization Check R=Reporting, E=Change, D=Approve
IM_FIELD_SELECTION	Field Names for DB Seln. Corresponds to GET CATSDB FIELDS ..
IM_SELECTION_CRITERIA	Selection Criteria for CATSDB Selection
IM_FREE_SELECTIONS	Free Selections for Database Fields
IM_BADI	BADI for Customer Enhancements&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thus, we can either define multiple selection criteria of our own (using parameters IM_SELECTION_CRITERIA and IM_FREE_SELECTIONS) or we can "link" the selection screen of a report to this class (IM_CALLING_PROGRAM).&lt;/P&gt;&lt;P&gt;In addition, parameter IM_BADI further allows us to modify the selection if necessary.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Authorization Checks&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;The BAPI strictly checks for 'Reporting' authorization whereas the class allows us to define different authorization levels (using parameter IM_AUTHORITY_CHECK_TYPE: Authorization Check R=Reporting, E=Change, D=Approve)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Messages&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;If the user does not have 'Reporting' authorization the BAPI simply skips the record:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;...
  LOOP AT ICATSDB.
    MOVE SY-TABIX TO L_TABIX.
    CALL FUNCTION 'CATS_CHECK_AUTHORITY'
         EXPORTING
              PERNR           = ICATSDB-PERNR
              DATE            = ICATSDB-WORKDATE
              ACTION          = 'R'
         EXCEPTIONS
              PERNR_NOT_FOUND = 1
              INVALID_ACTION  = 2
              NO_AUTHORITY    = 3
              OTHERS          = 4.
    IF SY-SUBRC &amp;lt;&amp;gt; 0.
      CONTINUE.
    ENDIF.
...&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In contrast, method GET_REJECT_COUNT returns the Number of Records Skipped Due to Authorization Problems.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope you will understand now why it is worth to spend some time and search for the most appropriate classes to realize out applications.&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>Tue, 22 May 2007 20:26:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-versus-object-oriented-programming-oop-s/m-p/2267760#M492281</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2007-05-22T20:26:25Z</dc:date>
    </item>
    <item>
      <title>Re: Function Module versus Object Oriented Programming(OOP's)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-versus-object-oriented-programming-oop-s/m-p/2267761#M492282</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Uwe, &lt;/P&gt;&lt;P&gt; Thanks for the reply. IT has definetely helped me a lot. &lt;/P&gt;&lt;P&gt;  Form what you have written.. Classes are definetley more powerful than FM. &lt;/P&gt;&lt;P&gt;  Does this mean that Function Modules will be redundant going forward? or are there palces we would still need Function Modules ? &lt;/P&gt;&lt;P&gt; If yes, can you please kindly let me know in which scenarios? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Soumya.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 May 2007 04:41:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-versus-object-oriented-programming-oop-s/m-p/2267761#M492282</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-23T04:41:25Z</dc:date>
    </item>
    <item>
      <title>Re: Function Module versus Object Oriented Programming(OOP's)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-versus-object-oriented-programming-oop-s/m-p/2267762#M492283</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;If you are writing any custom functionality for your requirement, the existing methods not enough to give solutions, in that case, you will introduce FM, in that you can use classes and methods.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ramki.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 May 2007 06:06:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-versus-object-oriented-programming-oop-s/m-p/2267762#M492283</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-23T06:06:33Z</dc:date>
    </item>
    <item>
      <title>Re: Function Module versus Object Oriented Programming(OOP's)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-versus-object-oriented-programming-oop-s/m-p/2267763#M492284</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Soumya,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please try to understand that apparently Function Groups and classes are somewhat similar. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Function Groups - &amp;gt; Data + Function Modules&lt;/P&gt;&lt;P&gt;Class                -&amp;gt;   Data + Methods&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Both support encapsulation i.e. data(if defined as private in class) can only be accessed by the methods / function modules of class/function group.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the area of use of class and function group is different. If you need to simulate a real life scenario where in you require to create several runtime instances of a real world entity, then we cannot use Function groups and have to use classes beacuse class has the property of mutiple instantiation. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if you need to deal with only one instance then you can use function group.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is very important to design an object oriented solution and see if it is at all required before writng a piece of code in object oriented manner.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Award points if found useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Indrajit.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 May 2007 08:48:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-versus-object-oriented-programming-oop-s/m-p/2267763#M492284</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-23T08:48:41Z</dc:date>
    </item>
    <item>
      <title>Re: Function Module versus Object Oriented Programming(OOP's)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-versus-object-oriented-programming-oop-s/m-p/2267764#M492285</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OO is really easy.&lt;/P&gt;&lt;P&gt; All you need to do in your program is just instantiate the object (assuming an Instance type method / attribute) and then you've got ALL the data. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you need extra methods  / attributes you can just define a subclass inheriting EVERYTHING from the main class. So you only need to add your method / attribute coding.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example say I've got a class ZCL_SALES_ORDER &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Build the following via SE24&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;class ZCL_SALES_ORDER definition&lt;/P&gt;&lt;P&gt;  public&lt;/P&gt;&lt;P&gt;  final&lt;/P&gt;&lt;P&gt;  create public .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;"&lt;/STRONG&gt; public components of class ZCL_SALES_ORDER&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;"&lt;/STRONG&gt; do not include other source files here!!!&lt;/P&gt;&lt;P&gt;public section.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  types:&lt;/P&gt;&lt;P&gt;    begin of s_material,&lt;/P&gt;&lt;P&gt;     matnr    type vbap-matnr,&lt;/P&gt;&lt;P&gt;     arktx    type vbap-matkl,&lt;/P&gt;&lt;P&gt;     kwmeng   type vbap-kwmeng,&lt;/P&gt;&lt;P&gt;     vrkme    type vbap-vrkme,&lt;/P&gt;&lt;P&gt;     netwr    type vbap-netwr,&lt;/P&gt;&lt;P&gt;     end of s_material .&lt;/P&gt;&lt;P&gt;  types:&lt;/P&gt;&lt;P&gt;    begin of s_partner,&lt;/P&gt;&lt;P&gt;        vbeln type vbpa-vbeln,&lt;/P&gt;&lt;P&gt;        parvw type vbpa-parvw,&lt;/P&gt;&lt;P&gt;        kunnr type vbpa-kunnr,&lt;/P&gt;&lt;P&gt;        lifnr type vbpa-lifnr,&lt;/P&gt;&lt;P&gt;        pernr type vbpa-pernr,&lt;/P&gt;&lt;P&gt;        parnr type vbpa-parnr,&lt;/P&gt;&lt;P&gt;        adrnr type vbpa-adrnr,&lt;/P&gt;&lt;P&gt;        name1 type sadr-name1,&lt;/P&gt;&lt;P&gt;        stras type sadr-stras,&lt;/P&gt;&lt;P&gt;        pstlz type sadr-pstlz,&lt;/P&gt;&lt;P&gt;        ort01 type sadr-ort01,&lt;/P&gt;&lt;P&gt;    end of s_partner .&lt;/P&gt;&lt;P&gt;  types:&lt;/P&gt;&lt;P&gt;    begin of s_prices,&lt;/P&gt;&lt;P&gt;      kschl  type konv-kschl,&lt;/P&gt;&lt;P&gt;      kbetr  type konv-kbetr,&lt;/P&gt;&lt;P&gt;      krech  type konv-krech,&lt;/P&gt;&lt;P&gt;      kpein  type konv-kpein,&lt;/P&gt;&lt;P&gt;      kmein  type konv-kmein,&lt;/P&gt;&lt;P&gt;      kwert  type konv-kwert,&lt;/P&gt;&lt;P&gt;      vtext type t685t-vtext,&lt;/P&gt;&lt;P&gt;      end of s_prices .&lt;/P&gt;&lt;P&gt;  types:&lt;/P&gt;&lt;P&gt;    begin of s_texts,&lt;/P&gt;&lt;P&gt;      tdid type stxh-tdid,&lt;/P&gt;&lt;P&gt;      lines   type lines,&lt;/P&gt;&lt;P&gt;      end of s_texts .&lt;/P&gt;&lt;P&gt;  types:&lt;/P&gt;&lt;P&gt;    begin of s_textids,&lt;/P&gt;&lt;P&gt;      tdid  type stxh-tdid,&lt;/P&gt;&lt;P&gt;      end of s_textids .&lt;/P&gt;&lt;P&gt;  types:&lt;/P&gt;&lt;P&gt;    begin of s_matord,&lt;/P&gt;&lt;P&gt;     matnr    type vbap-matnr,&lt;/P&gt;&lt;P&gt;     arktx    type vbap-arktx,&lt;/P&gt;&lt;P&gt;     kunnr    type vapma-kunnr,&lt;/P&gt;&lt;P&gt;     vbeln    type vapma-vbeln,&lt;/P&gt;&lt;P&gt;     posnr    type vapma-posnr,&lt;/P&gt;&lt;P&gt;     audat    type vapma-audat,&lt;/P&gt;&lt;P&gt;     auart    type vapma-auart,&lt;/P&gt;&lt;P&gt;     kwmeng   type vbap-kwmeng,&lt;/P&gt;&lt;P&gt;     vrkme    type vbap-vrkme,&lt;/P&gt;&lt;P&gt;     netwr    type vbap-netwr,&lt;/P&gt;&lt;P&gt;    end of s_matord .&lt;/P&gt;&lt;P&gt;  types:&lt;/P&gt;&lt;P&gt;    zdog type standard table of vbap .&lt;/P&gt;&lt;P&gt;  types:&lt;/P&gt;&lt;P&gt;    zprices type standard table of s_prices .&lt;/P&gt;&lt;P&gt;  types:&lt;/P&gt;&lt;P&gt;    zmat type standard table of s_material .&lt;/P&gt;&lt;P&gt;  types:&lt;/P&gt;&lt;P&gt;    zpartner type standard table of s_partner .&lt;/P&gt;&lt;P&gt;  types:&lt;/P&gt;&lt;P&gt;    zlines type standard table of tline .&lt;/P&gt;&lt;P&gt;  types:&lt;/P&gt;&lt;P&gt;    ztexts type standard table of s_texts .&lt;/P&gt;&lt;P&gt;  types:&lt;/P&gt;&lt;P&gt;    zvbfa type standard table of vbfa .&lt;/P&gt;&lt;P&gt;  types:&lt;/P&gt;&lt;P&gt;    zmatord type standard table of s_matord .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  data V_VBELN type VBAK-VBELN .&lt;/P&gt;&lt;P&gt;  data PARTNERS type ZPARTNER .&lt;/P&gt;&lt;P&gt;  data MATERIALS type ZMAT .&lt;/P&gt;&lt;P&gt;  data POSITIONS type ZDOG .&lt;/P&gt;&lt;P&gt;  data DOCFLOW type ZVBFA .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  methods CONSTRUCTOR&lt;/P&gt;&lt;P&gt;    importing&lt;/P&gt;&lt;P&gt;      !VBELN type VBAK-VBELN .&lt;/P&gt;&lt;P&gt;  methods DISPLAY .&lt;/P&gt;&lt;P&gt;  methods GET_SALES_HEADER_TEXTS&lt;/P&gt;&lt;P&gt;    importing&lt;/P&gt;&lt;P&gt;      !VBELN type VBAP-VBELN&lt;/P&gt;&lt;P&gt;      !POSNR type VBAP-POSNR&lt;/P&gt;&lt;P&gt;    exporting&lt;/P&gt;&lt;P&gt;      !TEXTS type ZTEXTS .&lt;/P&gt;&lt;P&gt;  class-methods GET_CONDITIONS&lt;/P&gt;&lt;P&gt;    importing&lt;/P&gt;&lt;P&gt;      !VBELN type VBAK-VBELN&lt;/P&gt;&lt;P&gt;      !POSNR type VBAP-POSNR&lt;/P&gt;&lt;P&gt;    exporting&lt;/P&gt;&lt;P&gt;      !PRICES type ZPRICES .&lt;/P&gt;&lt;P&gt;  class-methods GET_ORDERS_FOR_MATERIAL&lt;/P&gt;&lt;P&gt;    importing&lt;/P&gt;&lt;P&gt;      !MATERIAL type VAPMA-MATNR&lt;/P&gt;&lt;P&gt;    exporting&lt;/P&gt;&lt;P&gt;      !MATORD type ZMATORD .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Methods&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Constructor   (Fills the attributes on instantiation)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;method CONSTRUCTOR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;we can fill the (instance) attributes in this method.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Demo Get line items and partners&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data S_PARTNERS type S_PARTNER .&lt;/P&gt;&lt;P&gt;  data S_NR type VBPA-KUNNR .&lt;/P&gt;&lt;P&gt;  data S_ADRNR type KNA1-ADRNR .&lt;/P&gt;&lt;P&gt;  data S_ADDR1 type ADDR1_SEL .&lt;/P&gt;&lt;P&gt;  data OLD_FORMAT type VBADR .&lt;/P&gt;&lt;P&gt;  data KNVK_WA type KNVK .&lt;/P&gt;&lt;P&gt;  data S_SADR type SADR .&lt;/P&gt;&lt;P&gt;  data POS type VBAP .&lt;/P&gt;&lt;P&gt;  data DOCTYP type VBUK-VBTYP .&lt;/P&gt;&lt;P&gt;  data VBCO6 type VBCO6 .&lt;/P&gt;&lt;P&gt;  data MAT type S_MATERIAL .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;v_vbeln = vbeln.&lt;/P&gt;&lt;P&gt;select * from vbap&lt;/P&gt;&lt;P&gt;into table positions&lt;/P&gt;&lt;P&gt;where vbeln = v_vbeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at positions into pos..&lt;/P&gt;&lt;P&gt;move-corresponding pos to mat.&lt;/P&gt;&lt;P&gt;append mat to materials.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Document flow&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    clear vbco6.&lt;/P&gt;&lt;P&gt;     vbco6-vbeln  = V_vbeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;         CALL FUNCTION 'RV_ORDER_FLOW_INFORMATION'&lt;/P&gt;&lt;P&gt;           EXPORTING&lt;/P&gt;&lt;P&gt;             COMWA               = vbco6&lt;/P&gt;&lt;P&gt;           IMPORTING&lt;/P&gt;&lt;P&gt;            BELEGTYP_BACK       = doctyp&lt;/P&gt;&lt;P&gt;           TABLES&lt;/P&gt;&lt;P&gt;             VBFA_TAB            = docflow&lt;/P&gt;&lt;P&gt;           EXCEPTIONS&lt;/P&gt;&lt;P&gt;             NO_VBFA             = 1&lt;/P&gt;&lt;P&gt;             NO_VBUK_FOUND       = 2&lt;/P&gt;&lt;P&gt;             OTHERS              = 3 .&lt;/P&gt;&lt;P&gt;                   .&lt;/P&gt;&lt;P&gt;         IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;         ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from vbpa&lt;/P&gt;&lt;P&gt;into corresponding fields of table partners&lt;/P&gt;&lt;P&gt;where vbeln = v_vbeln.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;get address numbers&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at partners into s_partners.&lt;/P&gt;&lt;P&gt;if  s_partners-pernr is initial.&lt;/P&gt;&lt;P&gt;clear s_nr.&lt;/P&gt;&lt;P&gt;clear s_adrnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; if not s_partners-kunnr is initial.&lt;/P&gt;&lt;P&gt;  s_nr = s_partners-kunnr.&lt;/P&gt;&lt;P&gt;  select single adrnr from kna1&lt;/P&gt;&lt;P&gt;into s_adrnr&lt;/P&gt;&lt;P&gt;where kunnr eq s_partners-kunnr.&lt;/P&gt;&lt;P&gt;s_partners-adrnr = s_adrnr.&lt;/P&gt;&lt;P&gt; endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; if not s_partners-lifnr is initial.&lt;/P&gt;&lt;P&gt;  s_nr = s_partners-lifnr.&lt;/P&gt;&lt;P&gt;   select single adrnr from lfa1&lt;/P&gt;&lt;P&gt;into s_adrnr&lt;/P&gt;&lt;P&gt;where lifnr eq s_partners-lifnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; endif.&lt;/P&gt;&lt;P&gt;if s_partners-parvw = 'EK'.&lt;/P&gt;&lt;P&gt; s_nr = s_partners-adrnr.&lt;/P&gt;&lt;P&gt; s_adrnr = s_partners-adrnr.&lt;/P&gt;&lt;P&gt; endif.&lt;/P&gt;&lt;P&gt; if not s_partners-pernr is initial.&lt;/P&gt;&lt;P&gt;  s_nr = s_partners-pernr.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;if not s_adrnr is initial.&lt;/P&gt;&lt;P&gt;s_addr1-addrnumber = s_adrnr.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'ADDR_GET'&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    ADDRESS_SELECTION             = s_addr1&lt;/P&gt;&lt;P&gt;  IMPORTING&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    SADR                          = s_sadr.&lt;/P&gt;&lt;P&gt;          .&lt;/P&gt;&lt;P&gt;IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;move-corresponding s_sadr to s_partners.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;modify partners from s_partners.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;get address from personnel number&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Note this way of retrieving the address is likely to be&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;deprecated in the future&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;You should really get it via the appropriate infotype&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;and new BAS services.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear old_format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'VIEW_VBADR'&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    NRART                     = 'PE'&lt;/P&gt;&lt;P&gt;   PARTNERNUMMER              =  s_partners-pernr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IMPORTING&lt;/P&gt;&lt;P&gt;    ADRESSE                   = OLD_FORMAT&lt;/P&gt;&lt;P&gt;  EXCEPTIONS&lt;/P&gt;&lt;P&gt;    ERROR                     = 1&lt;/P&gt;&lt;P&gt;    OTHERS                    = 2&lt;/P&gt;&lt;P&gt;          .&lt;/P&gt;&lt;P&gt;IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;  move-corresponding old_format to s_partners.&lt;/P&gt;&lt;P&gt;  modify partners from s_partners.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endmethod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*	method Display&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;method DISPLAY.&lt;/P&gt;&lt;P&gt;set parameter id 'AUN'  field v_vbeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call transaction 'VA03' and skip first screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endmethod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*	method Get sales order texts&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;method GET_SALES_HEADER_TEXTS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types:&lt;/P&gt;&lt;P&gt;       t_stxh  type standard table of stxh.&lt;/P&gt;&lt;P&gt;data: spras type THEAD-TDSPRAS,&lt;/P&gt;&lt;P&gt;       t_lines type standard table of tline,&lt;/P&gt;&lt;P&gt;       s_lines type tline,&lt;/P&gt;&lt;P&gt;      name  type thead-tdname,&lt;/P&gt;&lt;P&gt;       s_textid type stxh-tdid,&lt;/P&gt;&lt;P&gt;      t_textid type table of s_textids,&lt;/P&gt;&lt;P&gt;      t_texts type table of s_texts,&lt;/P&gt;&lt;P&gt;      q_texts type s_texts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      object  type THEAD-TDOBJECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    field-symbols &amp;lt;g_texts&amp;gt; type any.&lt;/P&gt;&lt;P&gt;     assign q_texts to &amp;lt;g_texts&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      object = 'VBBP'.  "Item text"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   clear name.&lt;/P&gt;&lt;P&gt;if not posnr is initial.&lt;/P&gt;&lt;P&gt; concatenate v_vbeln posnr into name.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;      name = v_vbeln.&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; select tdid from stxh&lt;/P&gt;&lt;P&gt;   into  table t_textid&lt;/P&gt;&lt;P&gt;   where tdobject = object&lt;/P&gt;&lt;P&gt;   and tdname  = name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;spras = 'N'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at t_textid into s_textid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'READ_TEXT'&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    ID                            = s_textid&lt;/P&gt;&lt;P&gt;    LANGUAGE                      = spras&lt;/P&gt;&lt;P&gt;    NAME                          = name&lt;/P&gt;&lt;P&gt;    OBJECT                        =  object&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;           LINES                   =  t_lines.&lt;/P&gt;&lt;P&gt;          .&lt;/P&gt;&lt;P&gt;IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  loop at t_lines into s_lines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  q_texts-tdid = s_textid.&lt;/P&gt;&lt;P&gt;  q_texts-lines = s_lines-tdline.&lt;/P&gt;&lt;P&gt;  append q_texts to t_texts.&lt;/P&gt;&lt;P&gt;&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;texts[] = t_texts[].&lt;/P&gt;&lt;P&gt;endmethod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*	Method get_conditions ( pricing )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;method GET_CONDITIONS.&lt;/P&gt;&lt;P&gt;data: t_prices type standard table of s_prices,&lt;/P&gt;&lt;P&gt;      l_prices type s_prices.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; data g_knumv type vbak-knumv.&lt;/P&gt;&lt;P&gt; select single knumv&lt;/P&gt;&lt;P&gt;    into g_knumv&lt;/P&gt;&lt;P&gt;    from vbak&lt;/P&gt;&lt;P&gt;    where vbeln eq vbeln.&lt;/P&gt;&lt;P&gt;select kschl kbetr  krech kpein kmein kwert&lt;/P&gt;&lt;P&gt; into corresponding fields of table t_prices&lt;/P&gt;&lt;P&gt;  from konv&lt;/P&gt;&lt;P&gt;        where knumv = g_knumv&lt;/P&gt;&lt;P&gt;          and kposn eq posnr.&lt;/P&gt;&lt;P&gt;loop at t_prices into l_prices.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select single vtext into l_prices-vtext&lt;/P&gt;&lt;P&gt;from t685t&lt;/P&gt;&lt;P&gt;where kappl = 'V'&lt;/P&gt;&lt;P&gt; and spras eq sy-langu&lt;/P&gt;&lt;P&gt; and  kschl = l_prices-kschl.&lt;/P&gt;&lt;P&gt; modify t_prices from l_prices index sy-tabix.&lt;/P&gt;&lt;P&gt; endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;prices[] = t_prices[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endmethod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*	Method get_orders_for_material&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;method GET_ORDERS_FOR_MATERIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: t_matord type standard table of s_matord,&lt;/P&gt;&lt;P&gt;      l_matord type s_matord.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select a&lt;SUB&gt;matnr a&lt;/SUB&gt;auart a&lt;SUB&gt;vbeln a&lt;/SUB&gt;posnr a&lt;SUB&gt;audat a&lt;/SUB&gt;kunnr&lt;/P&gt;&lt;P&gt;       b&lt;SUB&gt;arktx b&lt;/SUB&gt;kwmeng b&lt;SUB&gt;vrkme b&lt;/SUB&gt;netwr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       into corresponding fields of table t_matord&lt;/P&gt;&lt;P&gt;       from ( vapma as a&lt;/P&gt;&lt;P&gt;              inner join vbap as b&lt;/P&gt;&lt;P&gt;              on a&lt;SUB&gt;vbeln eq b&lt;/SUB&gt;vbeln&lt;/P&gt;&lt;P&gt;              and a&lt;SUB&gt;posnr eq b&lt;/SUB&gt;posnr )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       where a~matnr eq material.&lt;/P&gt;&lt;P&gt;       matord[] = t_matord[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endmethod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now once the order is instantiated everything is available as per this demo program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;program ZCLASSSALESORD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Demo calling  sales order class&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;parameters : p_vbeln like vbap-vbeln obligatory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data :   obj type ref to zcl_sales_order. "Ref to class&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types: begin of s_texts,&lt;/P&gt;&lt;P&gt;      tdid type stxh-tdid,&lt;/P&gt;&lt;P&gt;      lines   type lines,&lt;/P&gt;&lt;P&gt;      end of s_texts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    begin of s_prices,&lt;/P&gt;&lt;P&gt;      kschl  type konv-kschl,&lt;/P&gt;&lt;P&gt;      kbetr  type konv-kbetr,&lt;/P&gt;&lt;P&gt;      krech  type konv-krech,&lt;/P&gt;&lt;P&gt;      kpein  type konv-kpein,&lt;/P&gt;&lt;P&gt;      kmein  type konv-kmein,&lt;/P&gt;&lt;P&gt;      kwert  type konv-kwert,&lt;/P&gt;&lt;P&gt;      vtext type t685t-vtext,&lt;/P&gt;&lt;P&gt;      end of s_prices .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      t_lines type standard table of s_texts,&lt;/P&gt;&lt;P&gt;      t_prices type standard table of s_prices,&lt;/P&gt;&lt;P&gt;      s_lines type s_texts,&lt;/P&gt;&lt;P&gt;      s_vbap type vbap,&lt;/P&gt;&lt;P&gt;      objtyp type thead-tdobject,&lt;/P&gt;&lt;P&gt;      ziid type stxh-tdid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    field-symbols: &amp;lt;g_partners&amp;gt; type table,&lt;/P&gt;&lt;P&gt;                   &amp;lt;g_positions&amp;gt; type table,&lt;/P&gt;&lt;P&gt;                   &amp;lt;g_lines&amp;gt; type table,&lt;/P&gt;&lt;P&gt;                   &amp;lt;g_materials&amp;gt; type table,&lt;/P&gt;&lt;P&gt;                   &amp;lt;g_documents&amp;gt;  type table,&lt;/P&gt;&lt;P&gt;                   &amp;lt;g_prices&amp;gt; type table,&lt;/P&gt;&lt;P&gt;                   &amp;lt;g_salesdoc&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Instantiate our Sales order from parameter&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;create object obj exporting vbeln = p_vbeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;access the attributes in the sales order class&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;to access attributes in class just code  oref-&amp;gt;attribute&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;  assign obj-&amp;gt;partners to &amp;lt;g_partners&amp;gt;.   "Partner addresses&lt;/P&gt;&lt;P&gt;  assign obj-&amp;gt;positions to &amp;lt;g_positions&amp;gt;.  "Line items&lt;/P&gt;&lt;P&gt;  assign obj-&amp;gt;v_vbeln to &amp;lt;g_salesdoc&amp;gt;.     "Sales Doc number&lt;/P&gt;&lt;P&gt;  assign obj-&amp;gt;materials to &amp;lt;g_materials&amp;gt;.  "Material list&lt;/P&gt;&lt;P&gt;  assign obj-&amp;gt;docflow to &amp;lt;g_documents&amp;gt;.  "Document flow&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Now test get long text from line item&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;   loop at &amp;lt;g_positions&amp;gt;  into s_vbap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;assign t_lines to &amp;lt;g_lines&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call method obj-&amp;gt;get_sales_header_texts&lt;/P&gt;&lt;P&gt;     exporting&lt;/P&gt;&lt;P&gt;                vbeln = p_vbeln&lt;/P&gt;&lt;P&gt;                posnr = s_vbap-posnr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      importing&lt;/P&gt;&lt;P&gt;                texts = &amp;lt;g_lines&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          loop at &amp;lt;g_lines&amp;gt; into s_lines.&lt;/P&gt;&lt;P&gt;          write : /  s_lines-tdid, s_lines-lines(80).&lt;/P&gt;&lt;P&gt;&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;&lt;/P&gt;&lt;P&gt;   assign t_prices to &amp;lt;g_prices&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    call method obj-&amp;gt;get_conditions&lt;/P&gt;&lt;P&gt;       exporting&lt;/P&gt;&lt;P&gt;               vbeln = p_vbeln&lt;/P&gt;&lt;P&gt;                posnr = s_vbap-posnr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            importing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            prices =  &amp;lt;g_prices&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;break-point 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's a lot easier in any case to code in an ABAP this sort of stuff&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &amp;lt;b&amp;gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Instantiate our Sales order from parameter&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;data : obj type ref to zcl_sales_order. "Ref to class&lt;/P&gt;&lt;P&gt;create object obj exporting vbeln = p_vbeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;attributes of Sales Order class&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;assign obj-&amp;gt;partners to &amp;lt;g_partners&amp;gt;.   "Partner addresses&lt;/P&gt;&lt;P&gt;  assign obj-&amp;gt;positions to &amp;lt;g_positions&amp;gt;.  "Line items&lt;/P&gt;&lt;P&gt;  assign obj-&amp;gt;v_vbeln to &amp;lt;g_salesdoc&amp;gt;.     "Sales Doc number&lt;/P&gt;&lt;P&gt;  assign obj-&amp;gt;materials to &amp;lt;g_materials&amp;gt;.  "Material list&lt;/P&gt;&lt;P&gt;  assign obj-&amp;gt;docflow to &amp;lt;g_documents&amp;gt;.  "Document flow&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rather than mess around with function modules.  The code within the method is totally separate from the caller as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I have several sales orders (multiple instances) I can still use the same code by just instantiating the sales order class (create object xxx). Then to get attributes / methods I can use exactly the same code on the new object. (Multiple instances).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Function modules are not designed to be handled by multiple instances. Function modules are OK when you are dealing with a single instance and the code isn't too complex. Also for a while SAP has a load of function modules for which classes aren't available yet --but this will change in the near future.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now if I need some other data -- for example say Invoices for orders I can just add a method using most of the data I've already got from the existing class (Inheritance). In other words a new class can refer to to an existing class as a "Super Class".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Polymorphism is also another extremely powerful OO concept where you can have identically named methods which behave differently in different classes. &lt;/P&gt;&lt;P&gt;In other words you can have the same method in different child classes but each with a different implementation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Both the above concepts allow for code re-use and drastically cut development time provided the class structure has been properly thought out and implemented. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also the scope for programming errors is very much reduced. Coding time is cut significantly as you now only need to worry about the actual business function. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now all you need to do in the application program is to instantiate an object, define some event handlers, get the attributes / call any relevant methods and produce any required output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using a Function Module I'd probably have to re-read a whole slew of data I've already got from the Sales Order Attributes anyway.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Business objects -- transaction SWO1) were a sort of start to OO abap but genuine classes are the way forward --even in workflow scenarios (rel 6.40 and up).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you've ever used SWO1 in TEST mode you can see that Business objects also had a load of useful functionality but weren't actually used so much in  ordinary ABAP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OO actually deprecates a lot of the business object stuff so any workflow guys out there you had better get used to OO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SE24 in test mode gives a similar output to SWO1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There's so many advantages to using classes that I'm surprised how a lot of shops still won't allow this sort of stuff into production yet even on releases &amp;gt;= 6.40 (Probably old IBM mainframe COBOL programmers).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;jimbo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 May 2007 23:08:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-versus-object-oriented-programming-oop-s/m-p/2267764#M492285</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-23T23:08:12Z</dc:date>
    </item>
    <item>
      <title>Re: Function Module versus Object Oriented Programming(OOP's)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-versus-object-oriented-programming-oop-s/m-p/2267765#M492286</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just to reiterate what others have said,  the use of OO moving foward will become more and more important, notice that with Web Dynpro ABAP, it is all OO, but also understand that function modules still have there place.  For example, the use of function modules and LUW.  Meaning firing a function module in another work process or in an update task.  THis kind of thing is not supported by classes, so if you have such a requirement, then a function module is the way to go.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;RIch Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2007 01:42:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-versus-object-oriented-programming-oop-s/m-p/2267765#M492286</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2007-05-24T01:42:09Z</dc:date>
    </item>
    <item>
      <title>Re: Function Module versus Object Oriented Programming(OOP's)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-versus-object-oriented-programming-oop-s/m-p/2267766#M492287</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks evryone for the replies. I am much better understanding now!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2007 04:58:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-versus-object-oriented-programming-oop-s/m-p/2267766#M492287</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-24T04:58:06Z</dc:date>
    </item>
    <item>
      <title>Re: Function Module versus Object Oriented Programming(OOP's)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-versus-object-oriented-programming-oop-s/m-p/2267767#M492288</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Uwe Schieferstein,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am really impressed with your answer for the post "Function Module versus Object Oriented Programming(OOP's)".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this answer you have mentioned following example which says&lt;/P&gt;&lt;P&gt;for reading timesheet data (table CATSDB), we can use either&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;BAPI BAPI_CATIMESHEETRECORD_GETLIST or the&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;class CL_DBSEL_CATS.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Well I am totally new to ABAP, so i surprised how can we find a particular BAPI or a CLASS for our relative work?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you help in this matter that how can I find any BAPI or CLASS in effectively fast manner?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;VIKRANT&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Apr 2008 11:37:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-versus-object-oriented-programming-oop-s/m-p/2267767#M492288</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-24T11:37:10Z</dc:date>
    </item>
  </channel>
</rss>

