Skip to Content
author's profile photo Former Member
Former Member

Query for selecting the field of VBRK

Hi All,

I have fetched the Ztable into it_bauch.

In the loop of It_bauch i have to fetch the records of vbrk in which the field of zuonr is wrongly stored in xblnr.

while fetching VBRK the zuonr0(8) should be comapred with it_zbauch-xblnr2(8).

select single * from vbrk where fkart = 'F2'

and fktyp = 'L'

and vbtyp = 'M'

and rfbsk = 'C'

and fksto = space.

  • <b> and ZUONR0(8) = it_wabuch-xblnr2(8).</b>

ZUONR0(8) = it_wabuch-xblnr2(8).</b>

the above line cannot be return so the below code is given whether it would work or not or any other solution kindly do respond

data : begin of it_vbrk occurs 0.

include structure vbrk.

data : end of it_vbrk.

data vbrk_flag type c.

data : begin of wa_vbrk,

zuonr(8) type c,

end of wa_vbrk.

loop at it_bauch.

select single * from vbrk into it_vbrk where fkart = 'F2'

and fktyp = 'L'

and vbtyp = 'M'

and rfbsk = 'C'

and fksto = space.

loop at it_vbrk.

wa_vbrk-zuonr = it_vbrk-ZUONR+0(8).

read table it_wabuch with key xblnr+2(8) = wa_vbrk-zuonr.

if sy-subrc = 0.

clear vbrk_flag.

vbrk_flag = 'X'.

endif.

clear wa_vbrk-zuonr.

endloop.

if vbrl-zuonr = 'X'.

After lot of select querey are there based on above condition would trigger.

endif.

endloop.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Feb 02, 2007 at 03:32 AM

    data : vxblnr(9).

    vxblnr = it_wabuch-xblnr+2(8).

    concatenate vxblnr '%' into vxblnr.

    select single * from vbrk where fkart = 'F2'

    and fktyp = 'L'

    and vbtyp = 'M'

    and rfbsk = 'C'

    and fksto = space.

    and ZUONR like vxblnr.

    regards

    shiba dutta

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      just write ur query as below -

      data d_date(8).

      loop at it_wabuch.

      d_data = it_wabuch-xblnr+2(8).

      select single * from vbrk where fkart = 'F2'

      and fktyp = 'L'

      and vbtyp = 'M'

      and rfbsk = 'C'

      and fksto = space.

      and ZUONR like d_date.

      endloop.

      it will work.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.