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

SAP ABAP QUERY

Former Member
0 Likes
1,532
  • SAP Managed Tags

HI Gurus,

Pls share code for this

Write a select query list all Manager Id & Manager names who have at least One ‘MALE’ employee and one ‘FEMALE’ employee reporting to them.\

NOTE its has to be acheived through query no by using read,collect, delete .. etc.

There are 2 tables

ZGGL_MANAGER (Manager table)

PRIMARYKEY MANAGER_ID MANAGER_NAME

Table: ZGGL_EMPLOYEE

MANAGER_ID EMPLOYEE_ID GENDER_ID EMPLOYEE_NAME

HI Gurus,

Pls share code for this

Write a select query list all Manager Id & Manager names who have at least One ‘MALE’ employee and one ‘FEMALE’ employee reporting to them.\

NOTE its has to be acheived through query no by using read,collect, delete .. etc.

There are 2 tables

ZGGL_MANAGER (Manager table)

PRIMARYKEY MANAGER_ID MANAGER_NAME

Table: ZGGL_EMPLOYEE

MANAGER_ID EMPLOYEE_ID GENDER_ID EMPLOYEE_NAME

2 REPLIES 2
Read only

0 Likes
952
  • SAP Managed Tags

Hi did you get answer of this question?

Read only

ThorstenHoefer
Active Contributor
0 Likes
952
  • SAP Managed Tags

Hi rahul.singh311,

try this:

select m~manager_id
    , m~manager_name
from ZGGL_MANAGER as m
where exists ( select 1   " or @abap_true ?
                 from ZGGL_EMPLOYEE as e1
                  where e1~manager_id = m~manager_id
                    and e1~gender = 'M' )
and exists ( select 1  " or @abap_true ?
                 from ZGGL_EMPLOYEE as e2
                  where e2~manager_id = m~manager_id
                    and e2~gender = 'F' )