1 / 17

ABAP Include & Function

ABAP Include & Function. Northern Arizona University College of Business. Include Programs & Function Modules. 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.

vinny
Download Presentation

ABAP Include & Function

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

  2. Include Programs&Function Modules

  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. Include program • The program that includes the Include program is known as the including program. Including Include

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

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

  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. Function Groups • A Function Group is a control program for Function Modules. • A Function Group is external to an ABAP program.

  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. 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. Function Modules • A Function Module name is between 3 and 30 characters. • Zwhatever

  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. Defining a Function ModuleImport 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. Defining a Function ModuleExport Parameters • Parameter Name • Internal reference of the parameter • Type • Enter TYPE • Reference Type • Data type (C, D, F, I, N, P, T, X)

  15. Defining a Function ModuleSource 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. Defining a Function ModuleSource Code p3 = p1 + p2 . ENDFUNCTION.

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

More Related