Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Read INFOTYPES

Former Member
0 Likes
2,007

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,227

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

3 REPLIES 3
Read only

Former Member
0 Likes
1,227

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

Read only

Former Member
0 Likes
1,227

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 you’re looking over the code to solve an urgent problem, you want to see a code that’s as fluff free as possible.

At the first glance this function looks similar with SAP’s HR_INFOTYPE_GETDETAIL but there is a major difference. SAP’s 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^

Read only

Former Member
0 Likes
1,228

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