Modify the data in internal table by using modify keyword
This is 2 step procedure.
1. Fill the latest information into the work area.
2. Modify the internal table based on work area.
Syntax:- Modify <it>
If we are maintaining all the fields information in the work area (key field)
Syntax: - Modify <it>
*& Report ZR_MODIFY_KEYWORD
*&
*&---------------------------------------------------------------------*
REPORT ZR_MODIFY_KEYWORD.
TYPE-POOLS SLIS.
TABLES EKKO.
SELECT-OPTIONS S_EBELN FOR EKKO-EBELN.
DATA: BEGIN OF WA_EKKO,
EBELN LIKE EKKO-EBELN,
BEDAT LIKE EKKO-BEDAT,
LIFNR LIKE EKKO-LIFNR,
END OF WA_EKKO.
FROM EKKO
INTO TABLE IT_EKKO
WHERE EBELN IN S_EBELN.
DATA: IT_FCAT TYPE SLIS_T_FIELDCAT_ALV,
WA_FCAT LIKE LINE OF IT_FCAT.
I_PROGRAM_NAME = SY-CPROG
I_INTERNAL_TABNAME = 'WA_EKKO'
I_INCLNAME = SY-CPROG CHANGING
CT_FIELDCAT = IT_FCAT.
* Modify the field catalog based on requirement
FROM WA_FCAT
TRANSPORTING KEY EMPHASIZE
WHERE FIELDNAME = 'LIFNR'.
FROM WA_FCAT
TRANSPORTING HOTSPOT
WHERE FIELDNAME = 'LIFNR'.
EXPORTING
IT_FIELDCAT = IT_FCATTABLES
T_OUTTAB = IT_EKKO.