Application Development 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: 

fetch infotype data

Karan_Chopra_
Active Participant
0 Kudos

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

PA0001 PA0002 etc

1 ACCEPTED SOLUTION

Karan_Chopra_
Active Participant
0 Kudos

plz help

8 REPLIES 8

Karan_Chopra_
Active Participant
0 Kudos

plz help

0 Kudos

help

Former Member
0 Kudos

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 .

Karan_Chopra_
Active Participant
0 Kudos

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

it gives only few entries like this

Karan_Chopra_
Active Participant
0 Kudos

plz help

0 Kudos

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.

0 Kudos

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>

Karan_Chopra_
Active Participant
0 Kudos

thanx dude u sloved my problem!!!