‎2007 Aug 27 5:40 AM
Hi all,
I have one final internal table with data like :
matnr lbkum 101
10000 -
11
10001 -
12
10001 2344 -
10001 1234 -
what should i do to get below output.
matnr lbkum 101
10000 2344 11
10001 1234 12
plz help me.
‎2007 Aug 27 5:43 AM
Hi,
If you make matnr as the key of your internal table and use COLLECT statement then this can be achevied.
DATA: itab type table <table_type> with key matnr with header line.
LOOP AT ITAB.
COLLECT ITAB.
ENDLOOP.
Else you can also think of using
AT NEW.
But COLLECT will sum all other fields of the internal table based on the key of the internal table which is MATNR in your case.
Regards,
Sesh
‎2007 Aug 27 5:42 AM
Hi Ankita,
I think you are updating the internal table by means of append it.
Make use of the Modify ITAB(internal table) so that you will not get those repating values.
Reward point if it is useful.....
Thanks
Yogesh
‎2007 Aug 27 5:43 AM
Hi,
If you make matnr as the key of your internal table and use COLLECT statement then this can be achevied.
DATA: itab type table <table_type> with key matnr with header line.
LOOP AT ITAB.
COLLECT ITAB.
ENDLOOP.
Else you can also think of using
AT NEW.
But COLLECT will sum all other fields of the internal table based on the key of the internal table which is MATNR in your case.
Regards,
Sesh
‎2007 Aug 27 5:57 AM
Hi Ankita,
u r modifying Internal table , but only one field
If this is u r requirement..
Then use
MODIFY ITAB WITH TRANSPOTING FIELD1.
Thanks & Regards,
jogu_vinesh@yahoo.com
‎2007 Aug 27 6:08 AM
Hi ,
this my code,
LOOP AT ITAB.
MOVE ITAB-MATNR TO ITAB1-MATNR.
MOVE ITAB-101_102 TO ITAB1-101_102.
MOVE ITAB-121_122 TO ITAB1-121_122.
APPEND ITAB1.
ENDLOOP.
here I m moving all itab in itab1.
SORT ITAB BY matnr mblnr.
LOOP AT ITAB.
IF ITAB[] IS NOT INITIAL.
DELETE ADJACENT DUPLICATES FROM ITAB COMPARING MATNR .
MOVE ITAB-lBKUM TO ITAB-OPN.
MODIFY ITAB.
*APPEND ITAB1.
ENDIF.
ENDLOOP.
then this is code for getting single row and delete all other values.
LOOP AT ITAB.
MOVE ITAB-opn TO ITAB1-OPN.
APPEND ITAB1.
ENDLOOP.
here I m coping opn in itab1.
I know my output is wrong because of second append statment.
can u tell me what should i do now?
plz