Skip to Content

query not working

Hi all,

I am working in 4.6c, i have written a select query as below but it is not populating the internal table.please help . urgent.

SELECT lifnr

name1

brsch

INTO CORRESPONDING FIELDS OF TABLE vend_det

FROM lfa1

FOR ALL ENTRIES IN po_hdr

WHERE lifnr = po_hdr-lifnr

AND brsch = 1.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 25, 2006 at 11:26 AM

    Hi Satya,

    get all the lifnrs into IT_lifnr.

    delete adjacent duplicates from it_lifnr.

    if not it_lifnr[] is initial.

    select lifnr

    name1

    into table vend_Det

    from lfa1

    for all entries in it_lifnr

    where lifnr = it_lifnr-lifnr

    and brsch = '0001'.

    endif.

    this should work.

    -Anu

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 25, 2006 at 11:21 AM

    I tried even this, but it is not populating the internal table. the required vendor number(LIFNR) is present in the PO_HDR internal table but i dont know why it is not populating the <b>vend_det</b> internal table.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      for that combination of LIFNR and BRSCH chk if it exits in LFA1,

      also while checking if the internal table used for for all entries is initial or not , check the whole body , i.e give square brackets

  • author's profile photo Former Member
    Former Member
    Posted on Oct 25, 2006 at 11:17 AM
    try this..., change the ones in bold
    
    <b>if not po_hdr[] is initial.</b>
    
    SELECT lifnr
    name1
    brsch
    INTO CORRESPONDING FIELDS OF TABLE vend_det
    FROM lfa1
    FOR ALL ENTRIES IN po_hdr
    WHERE lifnr = po_hdr-lifnr
    AND brsch = <b>'0001'</b>. 
    <b>
    endif.</b>
    Add a comment
    10|10000 characters needed characters exceeded

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.