‎2009 Apr 08 10:16 AM
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
‎2009 Apr 08 11:15 AM
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
‎2009 Apr 08 10:23 AM
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.
‎2009 Apr 08 10:47 AM
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 KEYPlease advice if I need to change any thing in this.
Karthik
‎2009 Apr 08 10:23 AM
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.
‎2009 Apr 08 10:26 AM
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...
‎2009 Apr 08 12:09 PM
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
‎2009 Apr 08 10:31 AM
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
‎2009 Apr 08 11:15 AM
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
‎2009 Apr 08 11:27 AM
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
‎2009 Apr 08 11:30 AM
hi,
sort the table with required fields .
and use the addition 'binary search' in read statement.
Regards,
R K.
‎2009 Apr 08 11:34 AM
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
‎2009 Apr 08 12:07 PM
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
‎2009 Apr 08 11:18 AM
Hi,
Use COLLECT statement like this
COLLECT WA_QALS INTO IT_QUALITY
Regards,
Jyothi CH.
‎2009 Apr 08 12:12 PM
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
‎2009 Apr 08 1:22 PM
Hi Sujeet,
I cannot collect wa_ekpo as some of the data in wa_ekpo should not collect.
Thanks
Karthik