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

hr_read_infotype

Karan_Chopra_
Active Participant
0 Likes
2,007

CALL FUNCTION 'HR_READ_INFOTYPE'

EXPORTING

pernr = p_pernr

infty = p_infty

TABLES

infty_tab = int_0002.

LOOP AT int_0002.

MOVE-CORRESPONDING int_0002 TO int_zeepersdata_1.

APPEND int_zeepersdata_1.

CLEAR int_zeepersdata_1.

ENDLOOP.

SELECT

inits nachn vorna namzu rufnm midnm

gesch gbdat natio sprsl famst perid

FROM pa0002 INTO CORRESPONDING FIELDS OF TABLE int_zeepersdata

WHERE

pernr = p_pernr.

in int_zeepersdata_1 i dont get correct entries by using FM hr_read_infotype

where as i get correct entries in int_zeepersdata by select statement

plz help as i have to use FM only

Message was edited by:

Karan Chopra

CALL FUNCTION 'HR_READ_INFOTYPE'

EXPORTING

pernr = p_pernr

infty = p_infty

TABLES

infty_tab = int_0002.

LOOP AT int_0002.

MOVE-CORRESPONDING int_0002 TO int_zeepersdata_1.

APPEND int_zeepersdata_1.

CLEAR int_zeepersdata_1.

ENDLOOP.

SELECT

inits nachn vorna namzu rufnm midnm

gesch gbdat natio sprsl famst perid

FROM pa0002 INTO CORRESPONDING FIELDS OF TABLE int_zeepersdata

WHERE

pernr = p_pernr.

in int_zeepersdata_1 i dont get correct entries by using FM hr_read_infotype

where as i get correct entries in int_zeepersdata by select statement

plz help as i have to use FM only

Message was edited by:

Karan Chopra

11 REPLIES 11
Read only

Karan_Chopra_
Active Participant
0 Likes
1,700

plz help

Read only

Former Member
0 Likes
1,700

Hi

First goto SE37

enter the fun module and pass all the parameters

In this case you are missing TCLAS and BEGDA nad ENDDA fields

apss them also

along with PERNR and INFTY

It will give correct results

frst check in SE37 and then use in program

Regards

Anji

Read only

0 Likes
1,700

Here is my code -

It is working fine for me.

data: int_0002 type standard table of prelp with header line.

data: int_0001 type standard table of pa0002 with header line.

parameters: p_pernr type PRELP-PERNR,

p_infty type PRELP-INFTY.

CALL FUNCTION 'HR_READ_INFOTYPE'

EXPORTING

pernr = p_pernr

infty = p_infty

TABLES

infty_tab = int_0002.

SELECT *

fROM pa0002

INTO taBLE int_0001

WHERE

pernr = p_pernr.

check sy-subrc eq 0.

Read only

Karan_Chopra_
Active Participant
0 Likes
1,700

i am gettin correct number of rows but some fields are correct and some are empty where as their value exists

Read only

0 Likes
1,700

How did you declare you r internal table INT_0002?

As the output of the fm is a string, the internal table INT_0002 needs to be declared correctly or the offsets go wrong and the data does not get populated correctly.

Check my code once.

Read only

Karan_Chopra_
Active Participant
0 Likes
1,700

ashish

ur code is correct but i have to use this without using select statement

database shud be hit only in FM

not in my code

can i do that way

otherwise wat is the use of this FM if we have to again select frpm dat pa0002 table

Message was edited by:

Karan Chopra

Read only

0 Likes
1,700

I know, that's hte reason i want you to see the declaration of INT_0002 in my program. check in your program how did you declare it? And see in debug if values are getting populated correctly. You can also do "Single Test" on the fm in SE37 and see once.

data: int_0002 type standard table of prelp with header line.

parameters: p_pernr type PRELP-PERNR,

p_infty type PRELP-INFTY.

CALL FUNCTION 'HR_READ_INFOTYPE'

EXPORTING

pernr = p_pernr

infty = p_infty

TABLES

infty_tab = int_0002.

Read only

Karan_Chopra_
Active Participant
0 Likes
1,700

then i my code

SELECT

inits nachn vorna namzu rufnm midnm

gesch gbdat natio sprsl famst perid

FROM pa0002 INTO CORRESPONDING FIELDS OF TABLE int_zeepersdata

WHERE

pernr = p_pernr.

this can be done directly

here i havent used dat FM...for this internal table

Read only

Karan_Chopra_
Active Participant
0 Likes
1,700

is this FM only used for checking authority

or to fetch every field of particular table

Read only

0 Likes
1,700

CALL FUNCTION 'HR_READ_INFOTYPE' is used to read HR data related to HR infotypes. It DOES NOT fetch all fields. To be on safer side it is better to write your select in a custom function module and use that in your program. (as you are not allowed to use SELECT in your program).

Read only

Karan_Chopra_
Active Participant
0 Likes
1,700

u mean i hav to use select query in the end

this FM is mainly used for authority check

thanx ashish 4 ur help