2007 Jun 13 1:42 PM
im trying to read data from infotype 0002 by using hr_raed_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
im trying to read data from infotype 0002 by using hr_raed_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:49 PM
Try declaring a variable for your pernr value you are passing into the function module.
For example:
data: l_pernr like p0002-pernr.
move: '10' to l_pernr.
then use the pernr variable for your FM Call.
Best Regards,
Chris
2007 Jun 13 1:50 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
2007 Jun 13 2:07 PM
just copy & paste it will work
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 usefull .
Girish
| User | Count |
|---|---|
| 5 | |
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |