Application Development 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: 

urgent plz help

Former Member
0 Kudos
168

hello friends,

i need to generate an abap query, in which

two fields from the table vbrp must be compared for each line item,

if in any line item they dont match, then i have to

show those documents where they didnot match.

can any plz shortly tell how to do.

can any one plz help.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
121

do we need to use vbrk here,

out of ignorence i am asking , why do we need to use vbrk,

15 REPLIES 15

Former Member
0 Kudos
121

create an internal table of type VBRP : t_vbrp

data: t_vbrp type standard table of VBRP initial size 0,

wa_vbrp like line of t_vbrp.

select * from vbrp into table t_vbrp where ....... if u have some condition..

then

Loop at t_vbrp into wa_vbrp.

check wa_vbrp-fld1 ne wa_vbrp-fld2.

write:/ wa_vbrp.

endloop.

Regards

Prax

Former Member
0 Kudos
121

no no my friend,

i need to do this using only abap query.

any help.

0 Kudos
121

Same..

Message was edited by:

Prax

Former Member
0 Kudos
121

thanks prax,

but where do i insert this code, i am not that strong in abapqueries.

0 Kudos
121

What u r talking about Query using TCODE : SQ03/ SQ01 or simpe ABAP query using SELECT statement.. plz tell

Regards

Prax

Former Member
0 Kudos
121

no i was reffering to sq01

0 Kudos
121

Then it will be better if u go through some documentation first..

the link given by Amit may help u. or u can search in

http://help.sap.com

Regards

Prax

Former Member
0 Kudos
121

prax i followed those links,

i created , user group, infoset,

and in sq01 i am unable to go ahead,

where to compare these two.

Former Member
0 Kudos
121

someone plz help

0 Kudos
121

Hi,

I am able to Run thru the sq01 and also execute the query with VBRK and VBRP. I am trying to find abt comparing fields of VBRP. Can you tell which fields of VBRp You need to compare with VBRP.

Thanks,

Vamshi.

Former Member
0 Kudos
121

thanks vamshi,

i need to compare kzwI2 and kzwI4 fields in vbrp table.

if you can put down the code i can check with my code, to know wether mine works.

thanks again.

i was thinking like this:

select kzwI2 kzwI4 into table in_vbrp where kzwi2 <> kzwi4.

if sy-subrc = 0.

loop at in_vbrp.

write:\ in_vbrp.

endloop.

endif.

will this work.

Former Member
0 Kudos
122

do we need to use vbrk here,

out of ignorence i am asking , why do we need to use vbrk,

0 Kudos
121

We need not use VBRK. We can define two aliases for the same table VBRP as a and VBRP as B.

Thanks,

Vamshi.

0 Kudos
121

Follow the SDN link which Amit has send you. Abap Query by Author(s): Lakshmi Sailaja Nalam. PDF document.

Follow the steps and you will be able to create the abap query. instead of using VBRK and VBRP, Click the Aliases button on the application tool bar, name table VBRP as A and Againg VBRP as B.

Then click on th insert button on the application tool bar. This popup will ask for a table name. Give it as A once. call it again and provide b as tablename.

then u can see both the tables on the screen. Then use the join between which ever fields you want.

Again follow the steps from the document.

Thanks,

Vamshi.