The following internal tables must be modified to print or exclude additional fields.
Realization
The form routine is as follows:
FORM name
DATA: BEGIN OF FTAB occurs 10.
INCLUDE STRUCTURE DFIES.
DATA: END OF FTAB.
*1. Modify structure table ....
*1.1. check whether already done
LOOP AT STRUCTURE_TABLE WHERE.......
EXIT.
ENDLOOP.
*1.2. if not yet done > modify
IF SY-SUBRC.....
* get field information for fields to be added
* modify STRUCTURE_TABLE, e.g. APPEND or DELETE
* modify 2nd value table, e.g. add field contents to the
* lines or delete field contents from the lines
LOOP AT VALUE_TAB.
.......
ENDLOOP.
ENDFORM.