‎2007 Feb 12 4:03 PM
Dear All!
Please can you check what is wrong on appending
of internal table III_YMMM_TBL74.
It's going to be overwriting always.
All what I want to do is populating
III_YMMM_TBL74 while is condition
if sy-subrc = 0 AND linp > 1.
is complied
*CODE
TYPES: BEGIN OF YMMM,
MATNR LIKE YMMM_TBL74-MATNR,
VORG_NR LIKE YMMM_TBL74-VORG_NR,
LIFNR LIKE YMMM_TBL74-LIFNR,
NAME1 LIKE YMMM_TBL74-NAME1,
UNGUEL_AB LIKE YMMM_TBL74-UNGUEL_AB,
GUEL_AB LIKE YMMM_TBL74-GUEL_AB,
GUEL_BI LIKE YMMM_TBL74-GUEL_BI,
END OF YMMM.
data I_YMMM_TBL74 type YMMM occurs 0 with header line.
data II_YMMM_TBL74 type YMMM occurs 0 with header line.
data III_YMMM_TBL74 type YMMM occurs 0 with header line.
select * from YMMM_TBL74
INTO CORRESPONDING FIELDS OF table I_YMMM_TBL74.
sort I_YMMM_TBL74 by matnr.
DELETE ADJACENT DUPLICATES FROM I_YMMM_TBL74 COMPARING matnr.
data: linp type i,
fin type i,
rin type i.
LOOP AT I_YMMM_TBL74.
select * from YMMM_TBL74
INTO CORRESPONDING FIELDS OF table II_YMMM_TBL74
WHERE MATNR = I_YMMM_TBL74-MATNR .
DESCRIBE TABLE II_YMMM_TBL74 lines linp .
DESCRIBE TABLE I_YMMM_TBL74 lines fin .
if sy-subrc = 0 AND linp > 1.
III_YMMM_TBL74[] = II_YMMM_TBL74[].
append III_YMMM_TBL74[].
endif.
ENDLOOP.
write:/ ''.
‎2007 Feb 12 4:04 PM
Hi,
Since you have already moved using the = statement with the body operator..You don't have use APPEND again..Just comment the append ..
III_YMMM_TBL74[] = II_YMMM_TBL74[].
*<b>append III_YMMM_TBL74[].</b>
Thanks,
Naren
‎2007 Feb 12 4:09 PM
hi,
Narendran is right append statement is not required ..
regards,
Santosh
‎2007 Feb 13 6:49 PM
sorry but right anser is
if sy-subrc = 0 AND linp > 1.
APPEND LINES OF II_YMMM_TBL74 TO III_YMMM_TBL74.
endif.
Regards
Ilhan