ABAP - Types and Subroutines

instructor

Author

Alex Patterson

12/5/2016

Last Updated: 3/22/2021

Types

Predefined ABAP Types

Subroutines

Examples of Subroutines

Example Report with Subroutines

REPORT ZABAP__TRAIN_00_TECH_EX1. DATA: num1 TYPE i, num2 TYPE i, sum TYPE i. num1 = 2. num2 = 4. PERFORM addit USING num1 num2 CHANGING sum. num1 = 7. num2 = 11. PERFORM addit USING num1 num2 CHANGING sum. FORM addit. USING add_sum1 TYPE any add_num2 TYPE any CHANGING TYPE any. add_sum = add_num1 add_num2. PERFORM out USING add_num1 add_num2 add_sum. ENDFORM. FORM out. USING out_num1 TYPE any out_num2 TYPE any out_sum TYPE any. WRITE: / 'Sum of ', out_num1, ' and ', out_sum2, ' is ', out_sum. ENDFORM.