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

fetch infotype data

Karan_Chopra_
Active Participant
0 Likes
932

is there any function from which i can fetch any number of fields of infotype tables

PA0001 PA0002 etc

1 ACCEPTED SOLUTION
Read only

Karan_Chopra_
Active Participant
0 Likes
887

plz help

8 REPLIES 8
Read only

Karan_Chopra_
Active Participant
0 Likes
887

plz help

Read only

0 Likes
887

help

Read only

Former Member
0 Likes
887

Hi Karan,

Use the function module

HR_READ_INFOTYPE

Example:

data: itab_0001 like p0001 occurs 0 with header line.

data: itab_0002 like p0002 occurs 0 with header line.

CALL FUNCTION 'HR_READ_INFOTYPE'

EXPORTING

  • TCLAS = 'A'

PERNR = pernr "pass pernr here

INFTY = '0001'

  • BEGDA = '18000101'

  • ENDDA = '99991231'

BYPASS_BUFFER = 'X'

TABLES

INFTY_TAB = itab_0001

EXCEPTIONS

INFTY_NOT_FOUND = 1

OTHERS = 2 .

CALL FUNCTION 'HR_READ_INFOTYPE'

EXPORTING

  • TCLAS = 'A'

PERNR = pernr "pass pernr here

INFTY = '0002'

  • BEGDA = '18000101'

  • ENDDA = '99991231'

BYPASS_BUFFER = 'X'

TABLES

INFTY_TAB = itab_0002

EXCEPTIONS

INFTY_NOT_FOUND = 1

OTHERS = 2 .

Read only

Karan_Chopra_
Active Participant
0 Likes
887

i have used this FM but all the entries are not coming correct

it gives only few entries like this

Read only

Karan_Chopra_
Active Participant
0 Likes
888

plz help

Read only

0 Likes
887

Thats the best one to READ data. You may also check following -

HR_ECM_READ_INFOTYPE

BAPI_PERSDATA_GETDETAIL

Apart from this you may use Logical Database to read Infotypes.

Or Class like this -

CALL METHOD read_infotype->read

EXPORTING

tclas = tclas_employee

pernr = pernr

infty = infty

subty = subty

objps = objps

sprps = sprps

begda = begda

endda = endda

no_auth_check = no_auth_check

IMPORTING

infotype_tab = infotype_tab_prel

missing_auth = missing_auth.

Regards,

Amit

Rerward all helpful replies.

Read only

0 Likes
887

Hi,

I think you might have declared in the following way

data: itab_0001 like pa0001 occurs 0 with header line.

data: itab_0002 like pa0002 occurs 0 with header line.

The correct way of declaration is

<b>data: itab_0001 like p0001 occurs 0 with header line.

data: itab_0002 like p0002 occurs 0 with header line.</b>

Read only

Karan_Chopra_
Active Participant
0 Likes
887

thanx dude u sloved my problem!!!