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

doubt in using for all entries

friends,

my 1st int. table itab_qmsa contains list of vendor number, audit year, etc. In the select statement i want to fetch all the details from zqalsqave table pertained to all the vendors in itab_qmsa..here itab_qmsa table contains 100 vendors..for each vendor, there are about 1000 records in zqalsqave...i expect the for all entries addition to fetch all the records from zqalsqave for each and every vendor..as this is not in a loop, will the statement correctly identify each and every vendor in the zqalsqave table? i.e. fetch records from zqalsqave for vendor 1 in itab-qmsa, fetch records from zqalsqave for vendor 2 in itab-qmsa, etc like this for all the 100 vendors...the order of the fields in the select statement and my int. table are in the same manner.so i haven't used "corresponding fields of" addition or should i use that? the problem is, it's going to dump after an inevitably long time saying "ABAP/4 processor: DBIF_RSQL_SQL_ERROR" -- SNAP NO NEW ENTRY..where am i wrong?

SELECT PRUEFLOS WERK LIFNR MATNR LMENGEIST LMENGE01 LMENGE02 LMENGE03 LMENGE04 LMENGE05 LMENGE06 LMENGE07 VCODE VDATUM INTO TABLE ITAB_ZQALSQAVE FROM ZQALSQAVE

FOR ALL ENTRIES IN ITAB_QMSA

WHERE LIFNR EQ ITAB_QMSA-LIFNR AND

WERK EQ S_WERKS AND

VDATUM BETWEEN STQ_DATE AND EN1_DATE.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

11 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 11, 2007 at 09:52 AM

    Hi Sathish

    There is no need to use INTO CORRESPONDING FIELDS if you are having the fields in same order in the internal table in which you are fetching it.

    And for your error , first delete the duplicate entries from itab and then use this query. It should work.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 11, 2007 at 10:00 AM

    Hi,

    Please ensure that the field which UR checking is the key field in the table ..

    I mean U have the condition

    WHERE LIFNR EQ ITAB_QMSA-LIFNR

    check if LIFNR is the key field in your table and

    the internal table is sorted by LIFNR.(Better if this is the is the first field in the

    internal table, sort by lifnr and use delete adjacent duplicates ... )

    Also if S_WERKS is a select option use

    WERK IN S_WERKS instead of WERK EQ S_WERKS

    Regards,

    GSR.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      friends

      already all the conditions are given...s_werks is a parameter, itab_qmsa is not initial, lifnr is a key field in the table...not able to figure out? is the bulk chunk of data that's causing the dump? moreover, still my doubt is not cleared...for all entries in itab_qmsa where lifnr eq itab_qmsa-lifnr, will this statement fetch all the records pertained to each and every vendor? hope it should...any color on the dump that am getting would be much appreciated..thank u

  • author's profile photo Former Member
    Former Member
    Posted on Jan 11, 2007 at 09:44 AM

    delete duplicates from itab and then use for all entries clause..

    amit

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 11, 2007 at 09:48 AM

    hi

    my for all entries table contains only unique records..have anyone faced this dump before? pl shed some light

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 11, 2007 at 09:50 AM

    SELECT PRUEFLOS WERK LIFNR MATNR LMENGEIST LMENGE01 LMENGE02 LMENGE03 LMENGE04 LMENGE05 LMENGE06 LMENGE07 VCODE VDATUM INTO TABLE ITAB_ZQALSQAVE FROM ZQALSQAVE

    FOR ALL ENTRIES IN ITAB_QMSA

    WHERE LIFNR EQ ITAB_QMSA-LIFNR AND

    WERK EQ S_WERKS.

    loop at itab_zqalsqave.

    if not itab_zqalsqave-vdatum between stq_date and EN1_date.

    delete from itab_zqalsqave index sy-tabix.

    endif.

    endloop.

    AND

    VDATUM BETWEEN STQ_DATE AND EN1_DATE....This statement takes huge time which will normally cause dump.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 11, 2007 at 09:54 AM
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 11, 2007 at 09:57 AM

    hi

    STQ_DATE AND EN1_DATE...thse two variables hold the start date and end date of a particular month entered in the input..when i am trying to fetch records for a particular month itself, it goes to dump...so, when i attempt to fetch all the records and then delete records not equal to the particular month, i believe it will again go to dump...pl correct me if am wrong..thank u..what is the actual reason for this dump? i believe teh statement to be correct, but the reason why it's going to dump, i don't...pl help

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 11, 2007 at 09:59 AM

    no now you are deleting from your internal table so no data base access is there.

    you can do it in your itab.

    regards

    shiba dutta

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 11, 2007 at 09:59 AM

    <b>if not ITAB_QMSA[] is initial.</b>

    SELECT PRUEFLOS WERK LIFNR MATNR LMENGEIST LMENGE01 LMENGE02 LMENGE03 LMENGE04 LMENGE05 LMENGE06 LMENGE07 VCODE VDATUM INTO <b>correspong fields of</b> TABLE ITAB_ZQALSQAVE FROM ZQALSQAVE

    FOR ALL ENTRIES IN ITAB_QMSA

    WHERE LIFNR EQ ITAB_QMSA-LIFNR AND

    WERK EQ S_WERKS AND

    VDATUM BETWEEN STQ_DATE AND EN1_DATE.

    <b>endif.</b>

    try this qury....now

    Ramesh.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 11, 2007 at 10:12 AM

    satish,

    before select statement use

    If not ITAB_QMSA[] is intial.

    SELECT PRUEFLOS WERK LIFNR MATNR LMENGEIST LMENGE01 LMENGE02 LMENGE03 LMENGE04 LMENGE05 LMENGE06 LMENGE07 VCODE VDATUM INTO TABLE ITAB_ZQALSQAVE FROM ZQALSQAVE

    FOR ALL ENTRIES IN ITAB_QMSA

    WHERE LIFNR EQ ITAB_QMSA-LIFNR AND

    WERK EQ S_WERKS AND

    VDATUM BETWEEN STQ_DATE AND EN1_DATE.

    endif

    If you don't check select stament will extract all the data from ZQALSQAVE.

    Pls. mark if useful

    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.