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: 

doubt in using for all entries

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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.

14 REPLIES 14

Former Member
0 Kudos

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

amit

0 Kudos

May be u can try after deleting duplicates from all entries table.

Former Member
0 Kudos

hi

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.

Former Member
0 Kudos

hi

Do not use the operators LIKE, BETWEEN, and IN in comparisons using internal table fields.

may be a reson.

check for further clarification

<a href="http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3a1f358411d1829f0000e829fbfe/frameset.htm">http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3a1f358411d1829f0000e829fbfe/frameset.htm</a>

regards

shiba dutta

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

<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.

Former Member
0 Kudos

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.

0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

hi

did you ommit the between clause? if not please try to do that and try to visit the link given by my previous reply

regards

shiba dutta

0 Kudos

i think ...

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 <b>S_WERKS</b> AND

VDATUM <b>BETWEEN</b> STQ_DATE AND EN1_DATE.

i thin it should be something like itab-swerks and try to use "in" insted of between