‎2007 Mar 28 2:40 PM
I have this code:
REPORT Z99BW047.
tables : Z99BW69,Z99BW92.
DATA: begin of ITAB1 occurs 0.
INCLUDE STRUCTURE Z99BW69.
DATA: end of ITAB1.
DATA: begin of ITAB2 occurs 0.
INCLUDE STRUCTURE Z99BW69.
DATA: end of ITAB2.
Seleccionamos los PC en una table interna
select *
from Z99BW69
INTO CORRESPONDING FIELDS OF TABLE ITAB1
where VGART ='PC'.
**aND BLDAT ='20060320'
*and MATNR = '000000000000000021'
*and BUKRS ='S00'
*and POPER = '003'.
*ordenamos la tabla interna para hacer el AT NEW.
sort itab1 by MANDT BUKRS MATNR POPER BLDAT BELNR.
*Cojemos solo aquellos valors que cambien con el AT NEW.
LOOP AT ITAB1.
AT NEW POPER.
read table itab1 index sy-tabix.
append itab1 to itab2.
ENDAT.
ENDLOOP.
break-point.
delete from Z99BW92.
LOOP AT ITAB2.
read table itab2 index sy-tabix.
INSERT Z99BW92 FROM TABLE ITAB2 ACCEPTING DUPLICATE KEYS.
ENDLOOP.
break-point.
ANd I define Z99BW92 with this keys:
MANDT CLNT
BUKRS CHAR
MATNR CHAR
POPER NUMC
BLDAT DATS
CK_BELNR CHAR
CK_KJAHR NUMC
CK_MLPOS NUMC
BDATJ NUMC
CURTP CHAR
CPUDT DATS
TCODE CHAR
But in the final LOOP, if I dont write ACCEPTING DUPLICATE KEYS, the program create a dump in the second register. And the registers are diferents!!!!!
And If I write ACCEPTING DUPLICATE KEYS, the program goes to slow !!
I dont understand anything....
thanks
‎2007 Mar 28 2:44 PM
‎2007 Mar 28 2:44 PM
‎2007 Mar 28 2:45 PM
‎2007 Mar 28 2:47 PM