‎2008 Mar 24 5:10 AM
Hi All,
I am modifying a standard report RHXTEILN and i need to add two new fields to that report one is "Manager Name" of the employee and the other is "Instructor Name" of the course which he attended. Could any one help me out by giving the hints or the function modules which we can use to retrive these fields.
Regards,
Rajashekhar.
‎2008 Mar 24 12:26 PM
Hi,
By the way do you have the SAP standard TABLE-FIELD of these fields you mentioned?
‎2008 Mar 24 12:32 PM
Go thru the code for getting the Manager's name ..
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',
AND SCLAS = 'S'.
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'
AND sclas = 'O'.
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.
Endif.
To get Instructor : use FM : LSO_CRP_REC_INSTRUCTOR