0% found this document useful (0 votes)
1K views2 pages

Start Routine Logic in ABAP

The document discusses how to use start routine logic to modify internal tables. It provides examples of using delete, modify, and append operations on a source package internal table within a start routine. The examples demonstrate assigning the internal table to a field symbol and using if-statements to select records for deletion or modification based on field values before modifying or deleting the records.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views2 pages

Start Routine Logic in ABAP

The document discusses how to use start routine logic to modify internal tables. It provides examples of using delete, modify, and append operations on a source package internal table within a start routine. The examples demonstrate assigning the internal table to a field symbol and using if-statements to select records for deletion or modification based on field values before modifying or deleting the records.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
  • Start Routine Logic
  • Delete Operation Logic
  • Modify Operation Logic

Start Routine Logic:

SOURCE_PACKAGE -> Internal Table


SOURCE_FIELDS -> Work Area
<SOURCE_FIELDS> -> Field Symbol

We can do operations like DELETE,MODIFY,APPEND the records in Start Routine.


Start Routine have Source Structure

EX1: START ROUTINE LOGIC WITH 'DELETE' OPTION

LOOP AT SOURCE_PACKAGE ASSIGNING <SOURCE_FIELDS>.

IF <SOURCE_FIELDS>-F3 = 'AMR'.
DELETE SOURCE_PACKAGE.
ENDIF.

ENDLOOP.

(OR) DELETE SOURCE_PACKAGE WHERE F3 EQ 'AMR'.

EX2: START ROUTINE LOGIC WITH 'MODIFY' OPTION

LOOP AT SOURCE_PACKAGE ASSIGNING <SOURCE_FIELDS>.

IF <SOURCE_FIELDS>-F3 = 'AMR'.
<SOURCE_FIELDS>-F2 = 'C999'.
* MODIFY SOURCE_PACKAGE FROM <SOURCE_FIELDS> INDEX SY-TABIX.(this
statement is not required, if the above field symbol)
ENDIF.

ENDLOOP.

(OR)

LOOP AT SOURCE_PACKAGE ASSIGNING <SOURCE_FIELDS>.

IF <SOURCE_FIELDS>-F3 = 'AMR'.
SOURCE_FIELDS-F2 = 'C999'.
MODIFY SOURCE_PACKAGE FROM <SOURCE_FIELDS> INDEX SY-TABIX.(this
statement is required, if the above is not field symbol)
ENDIF.

ENDLOOP.

EX3: START ROUTINE LOGIC WITH 'MODIFY' OPTION

DELETE SOURCE_PACKAGE WHERE LFSTK NE 'C'.

LOOP AT SOURCE_PACKAGE ASSIGNING <SOURCE_FIELDS>.

IF <SOURCE_FIELDS>-FKSTK IS INITIAL.
<SOURCE_FIELDS>-FKSTK = 'C'.
* MODIFY SOURCE_PACKAGE FROM <SOURCE_FIELDS> INDEX SY-TABIX.(this
statement is not required, if the above field symbol)
ENDIF.

ENDLOOP.
(OR)

LOOP AT SOURCE_PACKAGE ASSIGNING <SOURCE_FIELDS>.

IF <SOURCE_FIELDS>-FKSTK IS INITIAL.
SOURCE_FIELDS-FKSTK = 'C'.
MODIFY SOURCE_PACKAGE FROM <SOURCE_FIELDS> INDEX SY-TABIX.(this
statement is required, if the above is not field symbol)
ENDIF.

ENDLOOP.

Start Routine Logic:
SOURCE_PACKAGE -> Internal Table
SOURCE_FIELDS -> Work Area
<SOURCE_FIELDS> -> Field Symbol
We can do op
(OR)
     LOOP AT SOURCE_PACKAGE ASSIGNING <SOURCE_FIELDS>.
        
        IF <SOURCE_FIELDS>-FKSTK IS INITIAL.

You might also like