Application Development and Automation 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: 
Read only

Dump error on collect statement

Former Member
0 Likes
1,614

Hi Experts,

Please have a look on the below code and advice me as, I am getting dump error for huge data's.

LOOP AT IT_QALS INTO WA_QALS.
        COLLECT WA_QUALITY INTO IT_QUALITY.
  ENDLOOP.

  LOOP AT IT_EKPO INTO WA_EKPO.
   READ TABLE IT_QUALITY INTO WA_QUALITY WITH KEY EBELN = WA_EKPO-EBELN
                                                  EBELP = WA_EKPO-EBELP
                                                  MATNR = WA_EKPO-MATNR
                                                  WERK  = WA_EKPO-WERKS.
    IF SY-SUBRC = 0.
      MOVE WA_QUALITY-LOSMENGE TO WA_EKPO-LOSMENGE.
      MOVE WA_QUALITY-LMENGE01 TO WA_EKPO-LMENGE01.
      MOVE WA_QUALITY-LMENGE02 TO WA_EKPO-LMENGE02.
      MOVE WA_QUALITY-LMENGE03 TO WA_EKPO-LMENGE03.
      MOVE WA_QUALITY-LMENGE04 TO WA_EKPO-LMENGE04.
      MOVE WA_QUALITY-LMENGE05 TO WA_EKPO-LMENGE05.
      MOVE WA_QUALITY-LMENGE06 TO WA_EKPO-LMENGE06.
      MODIFY IT_EKPO FROM WA_EKPO.
    ENDIF.
  ENDLOOP.

Thanks

Karthik

Edited by: Karthik R on Apr 8, 2009 2:49 PM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,375

Hi Karthik,

To increase the performance you can use the 'transporting comp1 comp2....' addition to the modify statement, as this will only modify the corresponding fields. Also if the fields of the structures 'WA_QUALITY' & 'WA_EKPO' are similar try moving all the fields at a time, so that the performance of the program will increase.

Regards

Sankar

14 REPLIES 14
Read only

Former Member
0 Likes
1,375

There is a small error in the statement COLLECT

LOOP AT IT_QALS INTO WA_QALS.

Use COLLECT WA_QALS INTO IT_QUALITY, if structures WA_QALS and WA_QUALITY are same

otherwise, use move corresponding statement to copy the structure WA_QALS into WA_QUALITY

and followed by COLLECT WA_QUALITY INTO IT_QUALITY.

ENDLOOP.

Read only

0 Likes
1,375

Hi Lakshmi,

thanks a lot !!

But now, I am getting dump error in...

LOOP AT IT_EKPO INTO WA_EKPO.
READ TABLE IT_QUALITY INTO WA_QUALITY WITH KEY

Please advice if I need to change any thing in this.

Karthik

Read only

Former Member
0 Likes
1,375

Hi,

check your code,

LOOP AT IT_QALS INTO WA_QALS.

--> COLLECT WA_QUALITY INTO IT_QUALITY.

ENDLOOP.

LOOP AT IT_QALS INTO WA_QALS.

--> COLLECT WA_QALS INTO IT_QUALITY.

ENDLOOP.

Read only

Former Member
0 Likes
1,375

Hi, Karthik,

Try the collect statement for the required fields only intead of the whole qals table.....

I also did the same way its working.....

Please revert if any issue...

Read only

0 Likes
1,375

Hi Mujib,

You are correct !! also I did'nt put binary search that's why I got dump..any way thanks for

you information.

Karthik

Read only

RahulKeshav
Active Contributor
0 Likes
1,375

Hi KR,

Please check your code...

its

LOOP AT IT_QALS INTO WA_QALS.

COLLECT WA_QUALITY INTO IT_QUALITY.

ENDLOOP.

it has to be .....

LOOP AT IT_QALS INTO WA_QALS.

COLLECT WA_QALS INTO IT_QALS.

ENDLOOP.

thnx

Rohit

Read only

Former Member
0 Likes
1,376

Hi Karthik,

To increase the performance you can use the 'transporting comp1 comp2....' addition to the modify statement, as this will only modify the corresponding fields. Also if the fields of the structures 'WA_QUALITY' & 'WA_EKPO' are similar try moving all the fields at a time, so that the performance of the program will increase.

Regards

Sankar

Read only

0 Likes
1,375

Hi Sankar,

I need to move wa_qals to wa_quality as they are of different structure.

So I need to use the below code. But my problem is collect statement is ok now

but in read statement I am getting dump. Please advice...

LOOP AT IT_QALS INTO WA_QALS.
    MOVE WA_QALS-MATNR     TO   WA_QUALITY-MATNR.
    MOVE WA_QALS-WERK      TO   WA_QUALITY-WERK.
    MOVE WA_QALS-EBELP     TO   WA_QUALITY-EBELP.
    MOVE WA_QALS-EBELN     TO   WA_QUALITY-EBELN.
    MOVE WA_QALS-LOSMENGE  TO   WA_QUALITY-LOSMENGE.
    COLLECT WA_QUALITY INTO IT_QUALITY.
  ENDLOOP.

LOOP AT IT_EKPO INTO WA_EKPO.
   READ TABLE IT_QUALITY INTO WA_QUALITY WITH KEY EBELN = WA_EKPO-EBELN
                                                  EBELP = WA_EKPO-EBELP
                                                  MATNR = WA_EKPO-MATNR
                                                  WERK  = WA_EKPO-WERKS.
    IF SY-SUBRC = 0.
      MOVE WA_QUALITY-LOSMENGE TO WA_EKPO-LOSMENGE.
      MODIFY IT_EKPO FROM WA_EKPO.
    ENDIF.
  ENDLOOP.

Thanks

Karthik

Read only

0 Likes
1,375

hi,

sort the table with required fields .

and use the addition 'binary search' in read statement.

Regards,

R K.

Read only

0 Likes
1,375

Hi Karthik,

Use SORT statement with the fields same as the fields used in the READ TABLE statement and then use BINARY SEARCH option in READ TABLE.

Regards,

Sankar

Read only

0 Likes
1,375

Hi R K,

Wow....its working can u please advice me is it mandatory to put binary Search when

ever we use read statement.

Thanks

Karthik

Read only

Former Member
0 Likes
1,375

Hi,

Use COLLECT statement like this

COLLECT WA_QALS INTO IT_QUALITY

Regards,

Jyothi CH.

Read only

SujeetMishra
Active Contributor
0 Likes
1,375

Hello Karthik,

LOOP AT IT_QALS INTO WA_QALS.

COLLECT WA_QUALITY INTO IT_QUALITY.

ENDLOOP.

above statement is wrong.

you are looping at it_qals and collecting wa_quality..??

better you collect WA_EKPO in your second loop, if field you want to collect is same in this.

Have a Nice Day,

Cheers,

Sujeet

Read only

0 Likes
1,375

Hi Sujeet,

I cannot collect wa_ekpo as some of the data in wa_ekpo should not collect.

Thanks

Karthik