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

problem in abap query

Former Member
0 Likes
487

hello friends,

i was try to get all the line items in vbrp table where two fields donnot match

ie.

display all the document numbers where fields kzwi2 not equal to kzwi4.

in order to do this i thougt of creating 2 aliases a and b for the table vbrp in sq02.

and then thought of joining them,

but i created alis but its not appearing there are the screen, i dont know how to handle this.

does any body have correct idea.

thank you.

4 REPLIES 4
Read only

jayanthi_jayaraman
Active Contributor
0 Likes
464

Hi,

Try

data itab type standard table of vbrp.

select * from vbrp into table itab where kzwi2 not in ( select kzwi4 from vbrp ).

Read only

Former Member
0 Likes
464

Hi, sanjana...

i'm rather new in ABAP but in my case i usually use

select all data from vbrp (better to supply other parameter than field kzwi2 and field kzwi4 in where clause to get better performance)

and used

loop at itab_vbrp into wa_vbrp

if wa_vbrp-kzwi2 <> wa_vbrp-kzwi4

delete from itab_vbrp

thanks,

hope it helps...

Read only

Former Member
0 Likes
464

thank you very much friends,

but i know this code to put in reports,

but my problem is to do this in abap query, sq01

if at all i can insert this code some where in abap uery, how and where do i insert inthe infoset,

can any one plz tell shortly,

thank you.

Read only

Former Member
0 Likes
464

hello friends,

plz reply,

i was thinking of doing like this,

in the infoset create two aliases a and b of vbrp, and then, do the join on these two aliases,

but when i was createing theses aliases, they are not appearing , dont know,

can any one plz help.

tha nk you.