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

ABAP Code

Former Member
0 Likes
649

Hi,

How can I retrieve all entries EXCEPT 01, 03, 05 and 06 from table USRSYSACTT using ABAP assuming this (USRSYSACTT) table has the following entries:

AGR_NAME TEXT LANGU

-


-


-


01. ROLE1 XXX DE

02. ROLE1 XXX EN

03. ROLE1 XXX Z1

04. ROLE2 XXX EN

05. ROLE2 XXX RU

06. ROLE2 XXX JA

07. ROLE3 XXX DE

08. ROLE4 XXX FR

09. ROLE5 XXX EN

10. ROLE6 XXX Z1

Thanks,

Tarun

4 REPLIES 4
Read only

matt
Active Contributor
0 Likes
590

Either

SELECT * FROM USRSYSACTT INTO lt_table
    WHERE AGR_NAME NE '01' AND AGR_NAME NE '03' AND AGR_NAME NE '05'
           AGR_NAME NE '06'.

or

SELECT * FROM USRSYSACTT INTO lt_table.
DELETE FROM lt_table WHERE AGR_NAME EQ '01'... etc. 

The latter may be faster.

matt

Read only

Former Member
0 Likes
590

Hi,

And what if this (USRSYSACTT) table has thousands of such roles (AGR_NAME), etc.

Thanks,

Tarun

Read only

Former Member
0 Likes
590

Populate what ever values U don't want in a range ..

and use this in select ... as

if r_AGR_NAME is the range ...

R_AGR_NAME-sign = 'E'.

R_AGR_NAME-option = 'EQ'.

R_AGR_NAME-low = '01'.

append R_AGR_NAME.

similarly populate other values ...

select * from USRSYSACTT into table it_USRSYSACTT

where AGR_NAME in R_AGR_NAME.

Read only

Former Member
0 Likes
590

Hi,

Basically, I want all roles with LANGU as 'EN' except the dupilcate (AGR_NAME) ones and also, I want all the roles not having LANGU as 'EN' (except, of course, the duplicate ones)

For example, I want ROLE2 out of the following roles:

ROLE1 'DE'

ROLE1 'EN'

And I also want

ROLE2 'DE'

ROLE3 'FR'

Thanks,

Tarun