2007 Apr 05 12:08 PM
Hi
Here I am giving the scenorio.
I am expecting the sample code:
Hi,
This is how you can get to Manager info in SAP,
The table name in SAP is ZPSDSALREP and fields are ZZSALESREP, ZSUPERVISOR,ZZTERRMGR
ZPSDSALREP table will relates an Employee to his Supervisor through sales hierarchy ( for Ex: a REP will report to DM and DM reports to RM and RM reports to AR1 )
Once you find the Supervisor Code then get Employee ID for the Supervisor Code.
For EX:
From Orders table you get the Employee ID (REP) and then get ZSUPERVISOR ( District code for DM ) for the employee from ZPSDSALREP table.
From ZSUPERVISOR (District code for DM) get the Employee ID by placing condition on ZZTERRMGR field.
Once you get the Employee id then get employee email address from SAP table KNA1.
Points are assured for correct answers.
Regards,
Sreeram
2007 Apr 05 12:32 PM
Hi,
Since you are using tall the Custom tables, it is not that easy to write the code:
see the sample:
select ZSUPERVISOR from ZPSDSALREP into v_sup where ZZSALESREP = kunnr (Employee ID (REP) from order).
From ZSUPERVISOR (District code for DM) get the Employee ID by placing condition on ZZTERRMGR field.
get the supervisor ID from Code and get his manager ID.
Once you get the Employee id then get employee email address from SAP table <b>ADR6</b> (not from KNA1) passing ADDRNUMBER addressnumber field.
reward if useful
regards,
Anji
2007 Apr 05 12:32 PM
Hi,
Since you are using tall the Custom tables, it is not that easy to write the code:
see the sample:
select ZSUPERVISOR from ZPSDSALREP into v_sup where ZZSALESREP = kunnr (Employee ID (REP) from order).
From ZSUPERVISOR (District code for DM) get the Employee ID by placing condition on ZZTERRMGR field.
get the supervisor ID from Code and get his manager ID.
Once you get the Employee id then get employee email address from SAP table <b>ADR6</b> (not from KNA1) passing ADDRNUMBER addressnumber field.
reward if useful
regards,
Anji
2007 May 23 8:51 AM