Académique Documents
Professionnel Documents
Culture Documents
*&---------------------------------------------------------------------*
*& Report ZINTERNAL_OPERATIONS
*&
*&---------------------------------------------------------------------*
*& *****CHALAPATHI
*&
*&---------------------------------------------------------------------*
REPORT ZINTERNAL_OPERATIONS.
wa_mara-matnr = '000219'.
wa_mara-mtart = 'MECH'.
wa_mara-mbrsh = 'MECHANICAL'.
wa_mara-matkl = 'GROUP2'.
wa_mara-meins = 'UNIT'.
ULINE.
INSERT WA_MARA INTO I_MARA INDEX 5.
WRITE: 'AFTER INSERT THE RECORD IN INDEX5' COLOR 2.
ULINE.
LOOP AT I_MARA INTO WA_MARA.
write: / SY-TABIX,
wa_mara-matnr,
wa_mara-mtart,
wa_mara-mbrsh,
wa_mara-matkl,
wa_mara-meins.
ENDLOOP.
********* SORT
SORT: i_mara ASCENDING BY MATNR .
ULINE.
WRITE: 'AFTER SORT THE TABLE' COLOR 3.
ULINE.
LOOP AT I_MARA INTO WA_MARA.
write: / SY-TABIX,
wa_mara-matnr,
wa_mara-mtart,
wa_mara-mbrsh,
wa_mara-matkl,
wa_mara-meins.
ENDLOOP.
********* DESCRIBE TABLE
DESCRIBE TABLE I_MARA LINES V_LINE.
ULINE.
WRITE:'AFTER COUNT THE TABLE ROWS' COLOR 4.
ULINE.
WRITE: V_LINE.
******** READ TABLE
****** READ TABLE UNDESTAND BY DOING DEBUGGING
READ TABLE i_mara INTO wa_mara WITH KEY matnr = '218' BINARY SEARCH.
READ TABLE i_mara INTO wa_mara INDEX 6.
******* MODIFY
******for modify statement we have to crate few records
****in this statement we have to options thouse are by index no,by putting wh
ere conditons.
SORT: i_mara.
wa_mara-matnr = '220'.
wa_mara-mtart = 'CHALAPATHI'.
wa_mara-mbrsh = 'ELE'.
wa_mara-matkl = 'FINESHIED'.
wa_mara-meins = 'UNITS'.
MODIFY I_MARA FROM WA_MARA INDEX 4.
ULINE.
WRITE: 'AFTER MODIFY THE INTERNAL TABLE RECORDS IN INDEX4 LOCATOIN' COLOR 5.
ULINE.
LOOP AT I_MARA INTO WA_MARA.
write: / SY-TABIX,
wa_mara-matnr,
wa_mara-mtart,
wa_mara-mbrsh,
wa_mara-matkl,
wa_mara-meins.
ENDLOOP.
wa_mara-matnr = '221'.
wa_mara-mtart = 'ELECTRICAL'.
wa_mara-mbrsh = 'EEE1'.
wa_mara-matkl = 'SEMI'.
wa_mara-meins = 'UNITS'.
sort: i_mara.
MODIFY I_MARA FROM WA_MARA TRANSPORTING matnr WHERE MATNR = '000218'.
ULINE.
WRITE: 'AFTER MODIFY THE RECORD 218 BY USING OF WHERE CONDITION' COLOR 6.
ULINE.
ENDLOOP.
ENDDO.
sort.
delete ADJACENT DUPLICATES FROM i_mara COMPARING matnr.
ULINE.
WRITE :'AFTER DELETING THE ADJACENT DUPLICATES' COLOR 1.
ULINE.
***** COLLECT
*** This program explains about the collect and append statement purpose+.
***** + APPEND: This keyword will append the current contents of the table he
ader or the structure to the end of the table as a new record..
***** This will not affect the any existing record of the table..whereas COLL
ECT : This keyword is used for summation purposes..
***** when you collect a record to an internal table, it will find that is th
e table already have any record with the same key values? If yes,
***** then it will add all the numeric values of the new record to the existi
ng record without changing the non numeric values.
wa_mara2-matnr = '00025'.
wa_mara2-mtart = 'MOTORS'.
wa_mara2-mbrsh = 'M'.
wa_mara2-matkl = 'ELEEE'.
wa_mara2-meins = 'PC'.
COLLECT WA_MARA2 INTO I_MARA2 .
wa_mara2-matnr = '00026'.
wa_mara2-mtart = 'civil'.
wa_mara2-mbrsh = 'ME'.
wa_mara2-matkl = 'FORCIVIL'.
wa_mara2-meins = 'CR'.
COLLECT WA_MARA2 INTO I_MARA2.
***** REPETED RECORD I WANT TO COLLECT BUT IT WILL NOT TAKE
****** CHECK IN OUT PUT
WA_MARA2-MATNR = '00025'.
WA_MARA2-MTART = 'MOTORS'.
WA_MARA2-MBRSH = 'M'.
WA_MARA2-MATKL = 'ELEEE'.
WA_MARA2-MEINS = 'PC'.
COLLECT WA_MARA2 INTO I_MARA2 .
ULINE.
WRITE:'AFTER COLLECT' COLOR 5 .
ULINE.
LOOP AT I_MARA2 INTO WA_MARA2.
write: / SY-TABIX,
wa_mara2-matnr,
wa_mara2-mtart,
wa_mara2-mbrsh,
wa_mara2-matkl,
wa_mara2-meins.
ENDLOOP.