Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Save to My Library
Look up keyword
Like this
1Activity
0 of .
Results for:
No results containing your search query
P. 1
How to Get an Employee Manager

How to Get an Employee Manager

Ratings: (0)|Views: 23 |Likes:
Published by Vijay Vegesana

More info:

Published by: Vijay Vegesana on Sep 21, 2012
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOCX, PDF, TXT or read online from Scribd
See more
See less

03/20/2014

pdf

text

original

 
Create a zfuction module and follow the below steps. 
 
 
FUNCTIONZ_GET_MANAGER.
*"----------------------------------------------------------------------
 
*"*"Local Interface:
 
*" IMPORTING 
 
*" REFERENCE(PERNR) TYPE PERNR_D 
 
*" EXPORTING 
 
*" REFERENCE(M_PERNR) TYPE PERNR_D 
 
*" REFERENCE(UNAME) TYPE SY-UNAME 
 
*" REFERENCE(E_MAIL) TYPE SRM_EMAIL_ADDR
 
*"----------------------------------------------------------------------
 DATA: V_HRP1001TYPEHRP1001, V_POSTYPEHRP1001-OBJID,V_ORGLIKEV_POS,I_P0105TYPE TABLE OFPA0105WITH HEADERLINE. SELECT SINGLE*FROMHRP1001INTOV_HRP1001 WHEREOTYPEEQ'P 'AND  OBJIDEQPERNRAND  PLVAREQ'01'AND  RSIGNEQ'B'AND  RELATEQ'008'AND  BEGDA <= SY-DATUMAND ENDDA >= SY-DATUM.V_POS = V_HRP1001-SOBID.SELECT SINGLE*FROMHRP1001INTOV_HRP1001 WHEREOTYPEEQ'S 'AND  OBJIDEQV_POSAND  PLVAREQ'01'AND  RSIGNEQ'A'AND  RELATEQ'003'AND  BEGDA <= SY-DATUMAND ENDDA >= SY-DATUM.V_ORG = V_HRP1001-SOBID.
*check if this person is a manager 
 SELECT SINGLE*FROMHRP1001INTOV_HRP1001 WHEREOTYPEEQ'S 'AND  OBJIDEQV_POSAND  PLVAREQ'01'AND  RSIGNEQ'A'AND  RELATEQ'012'AND  BEGDA <= SY-DATUMAND ENDDA >= SY-DATUM.
 
 IFSY-SUBRCEQ0.  SELECT SINGLE*FROMHRP1001INTOV_HRP1001 WHEREOTYPEEQ'O 'AND  OBJIDEQV_ORGAND  PLVAREQ'01'AND  RSIGNEQ'A'AND  RELATEQ'002'AND  BEGDA <= SY-DATUMAND ENDDA >= SY-DATUM.MOVEV_HRP1001-SOBIDTOV_ORG. ENDIF.
*end of check
 SELECT SINGLE*FROMHRP1001INTOV_HRP1001 WHEREOTYPEEQ'O 'AND  OBJIDEQV_ORGAND  PLVAREQ'01'AND  RSIGNEQ'B'AND  RELATEQ'012'AND  BEGDA <= SY-DATUMAND ENDDA >= SY-DATUM.V_POS = V_HRP1001-SOBID.SELECT SINGLE*FROMHRP1001INTOV_HRP1001 WHEREOTYPEEQ'S 'AND  OBJIDEQV_POSAND  PLVAREQ'01'AND  RSIGNEQ'A'AND  RELATEQ'008'AND  BEGDA <= SY-DATUMAND ENDDA >= SY-DATUM.M_PERNR = V_HRP1001-SOBID.SELECT*FROMPA0105INTO TABLEI_P0105 WHEREPERNREQM_PERNRAND  BEGDA <= SY-DATUMAND ENDDA >= SY-DATUMAND ( SUBTYEQ'0001'ORSUBTYEQ'0010'). READ TABLEI_P0105WITH KEYSUBTY ='0001'. IFSY-SUBRCEQ0.  MOVEI_P0105-USRIDTOUNAME. ENDIF.

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->