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

Need sample code

sreeramkumar_madisetty
Active Contributor
0 Likes
394

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
371

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

2 REPLIES 2
Read only

Former Member
0 Likes
372

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

Read only

sreeramkumar_madisetty
Active Contributor
0 Likes
371

Hi

It's Answered.