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: 

plz help me HR ABAP

Former Member
0 Kudos
133

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

4 REPLIES 4

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos
91

Do not post more than 1 thread per question. Thanks.

Regards,

Rich Heilman

0 Kudos
91

That-a-boy...

Get 'em, Rich

Former Member
0 Kudos
91

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

Former Member
0 Kudos
91

<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