Wenn dir (dem SAP-System) die Programme nicht gehören, darfst du sie auch nicht ändern. Dann ist es eine Modifikation.
Code: Alles auswählen.
*&---------------------------------------------------------------------*
*& Report ZTEST89
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT ztest89.
DATA program_name TYPE rpy_prog-progname VALUE 'ZTEST_BASE64'.
DATA:
t_src TYPE TABLE OF abapsource,
t_scx TYPE TABLE OF abaptxt255,
l_changed type xfeld.
FIELD-SYMBOLS: <s> TYPE abapsource,
<x> TYPE abaptxt255.
CALL FUNCTION 'RPY_PROGRAM_READ'
EXPORTING
* LANGUAGE = SY-LANGU
program_name = program_name
with_includelist = ' '
only_source = 'X'
* ONLY_TEXTS = ' '
* READ_LATEST_VERSION = ' '
* WITH_LOWERCASE = ' '
* IMPORTING
* PROG_INF =
TABLES
* INCLUDE_TAB =
source = t_src
source_extended = t_scx
* TEXTELEMENTS =
EXCEPTIONS
cancelled = 1
not_found = 2
permission_error = 3
OTHERS = 4.
IF sy-subrc <> 0.
EXIT.
ENDIF.
IF t_src[] IS INITIAL AND t_scx[] IS INITIAL.
EXIT.
ENDIF.
clear l_changed.
IF NOT t_scx[] IS INITIAL.
LOOP AT t_scx ASSIGNING <x>.
IF <x>-line CS 'BREAK'.
REPLACE 'BREAK' IN <x>-line WITH '"BREAK'.
l_changed = 'X'.
ENDIF.
ENDLOOP.
if not l_changed is INITIAL.
INSERT REPORT program_name FROM t_scx.
endif.
ENDIF.
IF NOT t_src[] IS INITIAL.
LOOP AT t_src ASSIGNING <s>.
IF <s>-line CS 'BREAK'.
REPLACE 'BREAK' IN <s>-line WITH '"BREAK'.
l_changed = 'X'.
ENDIF.
ENDLOOP.
if not l_changed is INITIAL.
INSERT REPORT program_name FROM t_src.
endif.
ENDIF.