‎2007 Jun 13 1:43 PM
im trying to read data from infotype 0002 by using hr_read_infotype
CALL FUNCTION 'HR_READ_INFOTYPE'
EXPORTING
TCLAS = 'A'
pernr = 10
infty = '0002'
BEGDA = 'sy-datum'
ENDDA = '99991231'
tables
infty_tab = i_0002
EXCEPTIONS
INFTY_NOT_FOUND = 1
OTHERS = 2
i declared internal table using
DATA: i_0002 like P0002 occurs 0 with header line.
but my internal table is not getting populated.
also plz can anyone explain how to use select statements in hr reporting.
thnx
‎2007 Jun 13 1:46 PM
Hi
remove quotes for sy-datum field and see
BEGDA = sy-datum
and give the PERNR number in 8 digits in quotes '00000010'.
You have to use
provide...endprovide statement like select statement
or if you use PNP ldb use
GET PERNR.
rp_provide_from_frst p0000 space pn-begda pn-endda.
if pnp-sw-found EQ '1'.
READ TABLE p0001 WITH KEY pernr = p0000-pernr.
if sy-subrc = 0.
write : p0001-plans. " earliest.
endif.
endif.
rp_provide_from_last p0014 space pn-begda pn-endda.
if pnp-sw-found EQ '1'.
READ TABLE p0014 WITH KEY pernr = p0000-pernr.
if sy-subrc = 0.
write : p0014-LGART. .
endif.
endif.
Reward points for useful Answers
Regards
Anji
Message was edited by:
Anji Reddy Vangala
‎2007 Jun 13 1:46 PM
Hi
remove quotes for sy-datum field and see
BEGDA = sy-datum
and give the PERNR number in 8 digits in quotes '00000010'.
You have to use
provide...endprovide statement like select statement
or if you use PNP ldb use
GET PERNR.
rp_provide_from_frst p0000 space pn-begda pn-endda.
if pnp-sw-found EQ '1'.
READ TABLE p0001 WITH KEY pernr = p0000-pernr.
if sy-subrc = 0.
write : p0001-plans. " earliest.
endif.
endif.
rp_provide_from_last p0014 space pn-begda pn-endda.
if pnp-sw-found EQ '1'.
READ TABLE p0014 WITH KEY pernr = p0000-pernr.
if sy-subrc = 0.
write : p0014-LGART. .
endif.
endif.
Reward points for useful Answers
Regards
Anji
Message was edited by:
Anji Reddy Vangala
‎2007 Jun 13 1:47 PM
hi,
use select querry...........
select * from <b>PA0002</b>
where condition........
Reward points if helpful,
Regards,
Imran
‎2007 Jun 13 2:05 PM
just copy & paste ... i modified you query .. it works now
tables : P0002 .
parameter : s_pernr like P0002-pernr .
DATA : infty_tab TYPE TABLE OF p0002,
wa_infty TYPE p0002.
CALL FUNCTION 'HR_READ_INFOTYPE'
EXPORTING
* TCLAS = 'A'
pernr = s_pernr
infty = '0002'
* BEGDA = '18000101'
* ENDDA = '99991231'
BYPASS_BUFFER = 'X'
* LEGACY_MODE = ' '
* IMPORTING
* SUBRC =
TABLES
infty_tab = infty_tab
* EXCEPTIONS
* INFTY_NOT_FOUND = 1
* OTHERS = 2
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.reward points if it is suefull .
Girish