2007 Jul 16 5:34 PM
hi
i have to collect data from pa0001 by useing emp number and get the value of stell(job)
next from hrp1001 table i have to get data of sclass and sobid by entering sclass otype and stell
next from hrp1000 table i have get value of stext by entering the values of otype and sobid
plz tel me how can i solve this
2007 Jul 16 5:38 PM
2007 Jul 16 5:40 PM
2007 Jul 16 7:11 PM
If u want to do this opeartion for a single pernr..
then
1. USE FM.. HR_READ_INFOTYPE to read from PA0001
2. Use FM RH_STRUC_GET and pass otype, plvar, objid, and WEGID = SCLAS + RELAT.
3. To get text from HRP1000, use FM... RH_READ_OBJECT pass otype and objid
Reward if useful... and Plz ask 1 question per post as per the rules of the community..:)
Regards
Prax
2007 Jul 17 1:57 PM
<b>Create one function Z module with the import ansd export parameters as below and you logic is also there using hrp1001 ...etc .</b>
FUNCTION ZGILL_APPROVER.
*"----------------------------------------------------------------------
*"*"Local interface:
*" IMPORTING
*" REFERENCE(PERNR) TYPE PERSNO
*" EXPORTING
*" REFERENCE(NAME) TYPE PAD_CNAME
*" EXCEPTIONS
*" NO_DATA
*"----------------------------------------------------------------------
DATA: ls_sobid1 TYPE sobid,
ls_sobid2 TYPE sobid,
ls_sobid3 TYPE sobid,
vorna type PAD_VORNA,
nachn type PAD_NACHN.
SELECT SINGLE sobid FROM hrp1001 INTO ls_sobid1
WHERE otype = 'P'
and plvar = '01'
AND objid = pernr
AND endda >= sy-datum
AND begda <= sy-datum
AND rsign = 'B'
AND relat = '008'.
IF sy-subrc EQ 0.
SELECT SINGLE sobid FROM hrp1001 INTO ls_sobid2
WHERE otype = 'S'
and plvar = '01'
AND objid = ls_sobid1
AND endda >= sy-datum
AND begda <= sy-datum
AND rsign = 'A'
AND relat = '002'.
IF sy-subrc EQ 0.
SELECT SINGLE sobid FROM hrp1001 INTO ls_sobid3
WHERE otype = 'S'
and plvar = '01'
AND objid = ls_sobid2
AND endda >= sy-datum
AND begda <= sy-datum
AND rsign = 'A'
AND relat = '008'.
IF sy-subrc EQ 0.
SELECT SINGLE vorna nachn from pa0002 INTO (vorna , nachn)
WHERE pernr = ls_sobid3
AND endda >= sy-datum
AND begda <= sy-datum.
IF sy-subrc EQ 0.
Concatenate vorna nachn into name separated by SPACE.
condense name.
else.
Raise NO_DATA.
endif.
else.
Raise NO_DATA.
endif.
else.
Raise NO_DATA.
endif.
else.
RAISE no_data.
endif.
ENDFUNCTION.
reward points if it is usefull ......
Girish