Application Development and Automation 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: 
Read only

sample code

Former Member
0 Likes
371

My requirement is by passing project id to PROJ Table based on that we fetch on field that field is (object relation field)

Employee Number Is one of the parameter.

By using that data I will fetch data of manager id ,manager name ,Manager Email id

Can any one give me the sample code for this

Thanks&regads,

kishore

2 REPLIES 2
Read only

Former Member
0 Likes
345

parameters : pernr like pa0001-pernr.

DATA: ls_sobid1 TYPE sobid,

ls_sobid2 TYPE sobid,

ls_sobid3 TYPE sobid,

vorna type PAD_VORNA,

nachn type PAD_NACHN,

usrid like pa0105-usrid.

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.

select single USRID into v_usrid from pa0105

where pernr = ls_sobid3

AND endda >= sy-datum

AND begda <= sy-datum.

*ls_sobid3 is the managers pernr

*vorna nachn cintains the name of the manager

*usrid holds the managers mail ID

endif

endif

endif.

Read only

Former Member
0 Likes
345

Hi,

tables proj.

types : begin of it_proj,

fi type proj-vernr,

f2 type proj-verna,

f3 type proj-(mailid data element name)

parameters : id type pspid,

empno type i.

data it_proj type it-proj.

select <f1> < f2> < f3> from proj into it_proj

where <f4> = empno.

write : it_proj-f1,

it_proj-f2,

it_proj-f3.

where f1 = manager id(vernr) ,

f2 = manager name(verna),

f3 = Manager Email id

regards,

vineela.