2007 Oct 03 2:46 PM
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
2007 Oct 03 2:53 PM
2007 Oct 03 2:55 PM
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
2007 Oct 03 3:06 PM
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.
2007 Oct 03 3:10 PM
i am gettin correct number of rows but some fields are correct and some are empty where as their value exists
2007 Oct 03 3:12 PM
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.
2007 Oct 03 3:32 PM
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
2007 Oct 03 3:34 PM
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.
2007 Oct 03 3:36 PM
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
2007 Oct 03 3:50 PM
is this FM only used for checking authority
or to fetch every field of particular table
2007 Oct 03 3:57 PM
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).
2007 Oct 03 4:04 PM
u mean i hav to use select query in the end
this FM is mainly used for authority check
thanx ashish 4 ur help