‎2007 Jun 05 12:54 PM
Hi,
I usually read infotypes with the HR_READ_INFOTYPE function. But I discovered the method 'read' in the class 'IF_HRPA_READ_INFOTYPE' that do the same operation.
Does someone know the differences between two forms of read infotypes? What solution is more efficient and faster ?
Regards
‎2007 Jun 05 1:05 PM
Hi
The Method READ of the Interface 'IF_HRPA_READ_INFOTYPE' is also reads the data of the Infotype.
Some class will implement this interface and we can use that class
This is completely Object oriented concept of ABAP in which this classes and methods are used.
Where as the Fun module HR_READ_IFOTYPE uses the general ABAP without OOPS ABAP.
So we can use any of the above two but to use the first one we have to have some Object oriented concepts knowledge.
Reward points if useful
Regards
Anji
‎2007 Jun 05 1:00 PM
Hi,
Its always preferable and better to goin for OOPS based ABAP.
So use class 'IF_HRPA_READ_INFOTYPE' .
Bcoz ABAP Objects are Reusable and need not require any upgradation later in new versions.
Hope this helps.
****Reward points if helpful
‎2007 Jun 05 1:04 PM
hi
good
HR_READ_INFOTYPE =>
This ABAP function is a wrap for simple HR_READ_INFOTYPE and returns the most recent record in the interval. It can be used in any HR/Payroll ABAP program.
I have included this function module mainly because it is used by z_p_get_manager but also because it is a handy little function that can make your code easier to read. You may argue that it will only eliminate a few lines of code, however most of the HR or Payroll interfaces have to read many infotypes and when youre looking over the code to solve an urgent problem, you want to see a code thats as fluff free as possible.
At the first glance this function looks similar with SAPs HR_INFOTYPE_GETDETAIL but there is a major difference. SAPs function module needs the precise begda and endda for the record you want to read. This function module will give you the most recent record in your begda-endda interval.
http://www.brookshireconsulting.com/sources_get_infotype_line.html
'IF_HRPA_READ_INFOTYPE=>
The system does not handle actual records to access the buffer and write data to it. For this purpose, the system instead always uses containers, which represent the abstraction of a record. In general, containers are seen within the system as instances of class CL_HRPA_INFOTYPE_CONTAINER. A container can hold any or all of the following data:
· Infotype records
· Secondary infotype records, where infotype views are present
· Cost assignment data
· Infotype text data
In this release, infotypes generally must be processed by container IF_HRPA_INFOTYPE_CONTAINER. Some infotypes, however whether specialized infotypes created in this release, or infotypes to be migrated from prior releases are processed by a different container, which will be appropriate under certain limited circumstances. To determine the container that will process your infotype, you may review, if desired, the Classes for Determining Version IDs and Infotype Containers table (T582ITVCLAS), which is introduced in a subsequent topic.
From this point forward, all examples of infotypes are assumed to be processed by container IF_HRPA_INFOTYPE_CONTAINER.
http://help.sap.com/saphelp_erp2005vp/helpdata/en/43/21fa854a032be8e10000000a1553f7/content.htm
thanks
mrutyun^
‎2007 Jun 05 1:05 PM
Hi
The Method READ of the Interface 'IF_HRPA_READ_INFOTYPE' is also reads the data of the Infotype.
Some class will implement this interface and we can use that class
This is completely Object oriented concept of ABAP in which this classes and methods are used.
Where as the Fun module HR_READ_IFOTYPE uses the general ABAP without OOPS ABAP.
So we can use any of the above two but to use the first one we have to have some Object oriented concepts knowledge.
Reward points if useful
Regards
Anji