Skip to Content
0
Former Member
Mar 22, 2009 at 06:37 PM

need help

14 Views

Hi Friends -

I have to copy and enhance this RHXHAP_APP_DOC_PREPARE report in such a way that it shd create appraisal document for range of employee too right now this report creates based on org unit,

I have add few code but it create only for those employees for which it found manager , it would go one level up and search for superviosr and make him appraiser what shd i do for that ?

code sample is below.

if pchobjid[] is initial .

  • Logic to pick emp related org and position and then check if he is manager

**if he is then his direct org can be sent else their other 'O' with A002 shd send.

select pernr orgeh plans from pa0001 into corresponding fields of table ito where pernr in s_pernr.

loop at ito into wa_t.

select otype objid subty sclas sobid from hrp1001 into corresponding fields of table it_hr where

otype = 'O' and

objid = wa_t-orgeh and

endda GE sy-datum and

subty = 'B012' and

sclas = 'S' and

sobid = wa_t-plans .

if sy-subrc = 0.

refresh it_hr[].

select otype objid subty

sclas sobid from hrp1001 into corresponding fields of table it_hr

where otype = 'O' and

objid = wa_t-orgeh and

subty = 'A002' and

sclas = 'O'.

if sy-subrc = 0.

loop at it_hr.

select otype objid subty sclas sobid

from hrp1001 into corresponding fields of table it_hr2

where otype = 'O' and

objid = it_hr-sobid and

subty = 'B012' and

sclas = 'S'.

if sy-subrc = 0.

loop at it_hr2.

select otype objid subty sclas sobid

from hrp1001 into corresponding fields of table it_hr3

where otype = 'S' and

objid = it_hr2-sobid and

endda GE sy-datum and

subty = 'A008' and

sclas = 'P'.

endloop.

if sy-subrc = 0.

pchobjid-sign = 'I'.

pchobjid-option = 'EQ'.

pchobjid-low = it_hr-sobid .

pchobjid-high = '00000000'.

append pchobjid.

endif.

endif.

endloop.

endif.

else.

pchobjid-sign = 'I'.

pchobjid-option = 'EQ'.

pchobjid-low = wa_t-orgeh .

pchobjid-high = '00000000'.

append pchobjid.

endif.

endloop.

endif.

SUBMIT zrhhap_app_doc_prepare_org AND RETURN

WITH pchplvar = pchplvar

WITH pchotype = pchotype

WITH pchobjid IN pchobjid

WITH template = template

WITH pchbegda = pchbegda

WITH pchendda = pchendda

  • WITH lastdoc = lastdoc

WITH skipprep = rad1

WITH test_run = s_test

WITH p_pernr IN s_pernr.

Any info will be appreciated ,

Regards

Meeta