<?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: ABAP Objects and table processing (with logical databases) in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-objects-and-table-processing-with-logical-databases/m-p/1706846#M309514</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Lee&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I assume that the routines GET_ITnnnn are written by yourself. For reading infotypes ABAP Objects provides us with same very helpful classes as shown below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;* define data
  DATA:
    gif_employee      type ref to if_pt_employee,
    go_employee       type ref to cl_pt_employee,
    gt_infotypes      TYPE tim_tmw_itlist_tab,
    go_control        TYPE REF TO if_pt_td_control,
    go_data           TYPE REF TO if_pt_td_base,
    go_pnnnn          TYPE REF TO if_pt_td_itnnnn,
    gt_p0001          TYPE TIM_P0001_TAB,
    gt_p0002          TYPE TIM_P0002_TAB,
    gt_p0003          TYPE TIM_P0003_TAB.


start-of-selection.

GET pernr.

&amp;lt;b&amp;gt;* Create employee instance&amp;lt;/b&amp;gt;
  gif_employee = cl_pt_employee=&amp;gt;get_employee( pernr ).
  go_employee ?= gif_employee.

&amp;lt;b&amp;gt;* Get master infotypes (0001, 0002)&amp;lt;/b&amp;gt;
  CALL METHOD go_employee-&amp;gt;get_master_data
    EXPORTING
      im_begda = id_fromdate
      im_endda = id_todate
    IMPORTING
*      EX_I0000 =
      EX_I0001 = gt_p0001
      EX_I0002 = gt_p0002
*      EX_I0007 =
*      EX_I0008 =
      .

&amp;lt;b&amp;gt;* Append all other required infotypes to itab&amp;lt;/b&amp;gt;
  APPEND '0003' TO gt_infotypes.

  CALL METHOD go_employee-&amp;gt;get_infotypes
    EXPORTING
      i_itlist      = gt_infotypes
      i_fromdate    = id_fromdate  " start date
      i_todate      = id_todate    " end date
*      I_FILTER      =
      i_noauthcheck = 'X'
    IMPORTING
      e_result      = gt_infty_request
      e_retcd       = gd_retcd.
* Please see documentation of parameter e_retcd...

  
  LOOP AT gt_infty_request INTO go_control.
    go_data = go_control-&amp;gt;data.  &amp;lt;b&amp;gt;" get data object&amp;lt;/b&amp;gt;
 
*   Casting
    TRY.
        go_pnnnn ?= go_data.
 
      CATCH cx_sy_move_cast_error.
        CONTINUE.
    ENDTRY.
 
&amp;lt;b&amp;gt;*   Convert infotype (semi-transparent -&amp;gt; transparent)&amp;lt;/b&amp;gt;
    CALL METHOD cl_hr_pnnnn_type_cast=&amp;gt;prelp_to_pnnnn
      EXPORTING
        prelp = lo_pnnnn-&amp;gt;prelp
      IMPORTING
        pnnnn = gs_p0003.
 
    APPEND gs_p0027 TO gt_p0003.
  ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The class CL_PT_EMPLOYEE provides us already with very easy access to so-called master infotypes (000, 0001, 0002, 0007 and 0008). All other infotypes can be read using method GET_INFOTYPES.&lt;/P&gt;&lt;P&gt;Using these classes we have a very convenient and standardized way of accessing all kinds of infotypes.&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>Sun, 29 Oct 2006 09:40:35 GMT</pubDate>
    <dc:creator>uwe_schieferstein</dc:creator>
    <dc:date>2006-10-29T09:40:35Z</dc:date>
    <item>
      <title>ABAP Objects and table processing (with logical databases)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-objects-and-table-processing-with-logical-databases/m-p/1706845#M309513</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a report that is written right now using procedural abap and a logical database.  The report is structured follows (high level):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
start-of-selection.

get pernr.

  perform get_it0001 using wtab.
  perform get_it0002 using wtab.
  perform get_it0003 using wtab.

  append wtab to itab.

end-of-selection.

  call function 'reuse_alv_grid_display'
    exporting
      i_structure_name       = 'itabstructure'
    tables
      t_outtab               = itab.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So basically I'm going through a bunch of personnel numbers, getting a few infotypes and outputting to ALV.  I don't see where ABAP Objects is going to help me for this particular program.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can somebody show me where OO ABAP would make this easier?  Does it even make sense to use OO when you're processing with a logical database?  (Not just PNP, but any logical database in general).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 29 Oct 2006 02:22:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-objects-and-table-processing-with-logical-databases/m-p/1706845#M309513</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-29T02:22:55Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP Objects and table processing (with logical databases)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-objects-and-table-processing-with-logical-databases/m-p/1706846#M309514</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Lee&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I assume that the routines GET_ITnnnn are written by yourself. For reading infotypes ABAP Objects provides us with same very helpful classes as shown below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;* define data
  DATA:
    gif_employee      type ref to if_pt_employee,
    go_employee       type ref to cl_pt_employee,
    gt_infotypes      TYPE tim_tmw_itlist_tab,
    go_control        TYPE REF TO if_pt_td_control,
    go_data           TYPE REF TO if_pt_td_base,
    go_pnnnn          TYPE REF TO if_pt_td_itnnnn,
    gt_p0001          TYPE TIM_P0001_TAB,
    gt_p0002          TYPE TIM_P0002_TAB,
    gt_p0003          TYPE TIM_P0003_TAB.


start-of-selection.

GET pernr.

&amp;lt;b&amp;gt;* Create employee instance&amp;lt;/b&amp;gt;
  gif_employee = cl_pt_employee=&amp;gt;get_employee( pernr ).
  go_employee ?= gif_employee.

&amp;lt;b&amp;gt;* Get master infotypes (0001, 0002)&amp;lt;/b&amp;gt;
  CALL METHOD go_employee-&amp;gt;get_master_data
    EXPORTING
      im_begda = id_fromdate
      im_endda = id_todate
    IMPORTING
*      EX_I0000 =
      EX_I0001 = gt_p0001
      EX_I0002 = gt_p0002
*      EX_I0007 =
*      EX_I0008 =
      .

&amp;lt;b&amp;gt;* Append all other required infotypes to itab&amp;lt;/b&amp;gt;
  APPEND '0003' TO gt_infotypes.

  CALL METHOD go_employee-&amp;gt;get_infotypes
    EXPORTING
      i_itlist      = gt_infotypes
      i_fromdate    = id_fromdate  " start date
      i_todate      = id_todate    " end date
*      I_FILTER      =
      i_noauthcheck = 'X'
    IMPORTING
      e_result      = gt_infty_request
      e_retcd       = gd_retcd.
* Please see documentation of parameter e_retcd...

  
  LOOP AT gt_infty_request INTO go_control.
    go_data = go_control-&amp;gt;data.  &amp;lt;b&amp;gt;" get data object&amp;lt;/b&amp;gt;
 
*   Casting
    TRY.
        go_pnnnn ?= go_data.
 
      CATCH cx_sy_move_cast_error.
        CONTINUE.
    ENDTRY.
 
&amp;lt;b&amp;gt;*   Convert infotype (semi-transparent -&amp;gt; transparent)&amp;lt;/b&amp;gt;
    CALL METHOD cl_hr_pnnnn_type_cast=&amp;gt;prelp_to_pnnnn
      EXPORTING
        prelp = lo_pnnnn-&amp;gt;prelp
      IMPORTING
        pnnnn = gs_p0003.
 
    APPEND gs_p0027 TO gt_p0003.
  ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The class CL_PT_EMPLOYEE provides us already with very easy access to so-called master infotypes (000, 0001, 0002, 0007 and 0008). All other infotypes can be read using method GET_INFOTYPES.&lt;/P&gt;&lt;P&gt;Using these classes we have a very convenient and standardized way of accessing all kinds of infotypes.&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>Sun, 29 Oct 2006 09:40:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-objects-and-table-processing-with-logical-databases/m-p/1706846#M309514</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2006-10-29T09:40:35Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP Objects and table processing (with logical databases)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-objects-and-table-processing-with-logical-databases/m-p/1706847#M309515</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much Uwe, that was an excellent reply!  I'm going to try using some of those on my next development task.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it true that SAP is in the process of 'objectifying' the collection of logical databases so it leverages ABAP Objects more and more?  Perhaps this is the beginning such a conversion?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again, help much appreciated!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lee&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 29 Oct 2006 12:37:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-objects-and-table-processing-with-logical-databases/m-p/1706847#M309515</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-29T12:37:50Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP Objects and table processing (with logical databases)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-objects-and-table-processing-with-logical-databases/m-p/1706848#M309516</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Lee&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The SAP_BASIS part of SAP is becoming more and more object-oriented. Module that have been developed completely using ABAP-OO are SRM and RE-FX.&lt;/P&gt;&lt;P&gt;The "classical" modules like FI, CO, MM and SD still contain plenty of procedural coding. However, it is really important to start now with ABAP-OO. If you require a certain function do not only check the function library (SE37) but also the class builder (SE24).&lt;/P&gt;&lt;P&gt;For example, if I need to deal with controlling area I will use the methods of class CL_REEXC_CONTROLLING_AREA, message handling is done using CL_RECA_MESSAGE_LIST. Other useful classes are:&lt;/P&gt;&lt;P&gt;- company code =&amp;gt; CL_REEXC_COMPANY_CODE&lt;/P&gt;&lt;P&gt;- texts of objects =&amp;gt; CL_REEX_SERVICES_FICO&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>Sun, 29 Oct 2006 19:12:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-objects-and-table-processing-with-logical-databases/m-p/1706848#M309516</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2006-10-29T19:12:15Z</dc:date>
    </item>
  </channel>
</rss>

