Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 ABAP Include & Function Northern Arizona University College of Business.

Similar presentations


Presentation on theme: "1 ABAP Include & Function Northern Arizona University College of Business."— Presentation transcript:

1 1 ABAP Include & Function Northern Arizona University College of Business

2 2 Include Programs & Function Modules

3 3 Include program  An include program is designed to be used by other programs.  It is not complete by itself.  The program is included into another program via the Include statement.  The Include program is known as the Included program.

4 4 Include program  The program that includes the Include program is known as the including program. IncludingInclude

5 5 Include program *** INCLUDE ZXXX. Write: / ‘This is an Include program’.

6 6 Including program Program ZXXX_PGXX. Include ZXXX. Rest of the program.

7 7 Creating an Include program  ABAP Editor (SE38).  Create the program (Z-----).  Create as type I (Include program).  Under attributes.  A type I program cannot contain partial or incomplete statements.

8 8 Function Groups  A Function Group is a control program for Function Modules.  A Function Group is external to an ABAP program.

9 9 Defining a Function Group  Use the Function Builder (SE37) to build a Function Group.  A Function Group is identified by a four-character identifier (function group ID).  ZXXX  A short description must be supplied

10 10 Function Modules  A Function Module is a sub program that performs a particular function.  A Function Module is external to an ABAP program. A Function Module must be subordinate to a Function Group.  Use the Function Builder (SE37) to build a Function Module.

11 11 Function Modules  A Function Module name is between 3 and 30 characters.  Zwhatever

12 12 Function Modules  A Function Module can have parameters imported into the module.  A Function Module can have parameters exported from the module.  The parameters are passed by value (does not change the source field).

13 13 Defining a Function Module Import Parameters  Parameter Name  Internal reference of the parameter  Type  Enter TYPE  Reference Type  Data type (C, D, F, I, N, P, T, X)  Default Value

14 14 Defining a Function Module Export Parameters  Parameter Name  Internal reference of the parameter  Type  Enter TYPE  Reference Type  Data type (C, D, F, I, N, P, T, X)

15 15 Defining a Function Module Source Code FUNCTION ZXXX_DEMO1. *”----------------------------------- *”*”Local interface: *” IMPORTING *” Reference(p1) TYPE I DEFAULT 0 *” Reference(p2) TYPE I DEFAULT 0 *” EXPORTING *” Reference(p3) TYPE I DEFAULT 0 *”-----------------------------------

16 16 Defining a Function Module Source Code p3 = p1 + p2. ENDFUNCTION.

17 17 Calling a Function Module Call Function ‘ZXXX_DEMO1’ Exporting p1 = P_Value1 p2 = P_Value2 Importing p3 = W_Result.


Download ppt "1 ABAP Include & Function Northern Arizona University College of Business."

Similar presentations


Ads by Google