Presentation is loading. Please wait.

Presentation is loading. Please wait.

ABAP Training Function Builder.

Similar presentations


Presentation on theme: "ABAP Training Function Builder."— Presentation transcript:

1 ABAP Training Function Builder

2 Function Group A function group is an ABAP program with type F, which is a program created exclusively for containing function modules. Function modules are modular units with interfaces that can be called from any ABAP Program. Function modules that operate on the same objects are combined to form function groups.

3 Function Module Function group Function module Global data objects
sy - subrc Function module Administration Local data objects Source Code Global data objects Function group Subroutine Interface Import parameters Export parameters Changing parameters Exceptions

4 Example: Cancel dialog box
<Context-Specific Title> ! <context-specific text> "Data will be lost." No Yes

5 Function Module Interface
Exceptions Changing Export Function module POPUP_TO_CONFIRM_LOSS_OF_DATA Attributes Nicht Optionale Parameter des Constructors msen bei CREATE OBJECT versorgt werden Import Parameters TEXTLINE1 TEXTLINE2 TITEL START_COLUMN START_ROW Pass Value Optional ... Ref. type Description Source Code ! Non-optional parameters in the function module must be passed in the CALL FUNCTION statement

6 Testing Function Module
Export parameters Function module Import parameters Exception

7 Inserting a Function Module Call in a Program
CALL FUNCTION 'POPUP_TO_CONFIRM_LOSS_OF_DATA' EXPORTING textline = title IMPORTING answer = ... Insert statement POPUP_TO_CONFIRM_LOSS_OF_DATA Pattern System generates ABAP code CASE SY-SUBRC. Process return code Enter actual parameters

8 Create a Function Group
Step1. Enter group name begin ‘Y’ or ‘Z’ Step2. Push create

9 Create a Function Module – Step 1
Step1. Enter function module name begin ‘Y’ or ‘Z’ Step2. Push create

10 Create a Function Module – Step 2
Enter short text Assign Function group

11 Function Module Attributes

12 Maintain Import Parameter
LIKE TYPE TYPE REF TO ‘X‘: 非必要輸入 Passing data Into Function module

13 Maintain Export Parameter
LIKE TYPE TYPE REF TO Passing data Into Function module

14 Maintain Changing Parameter
LIKE TYPE TYPE REF TO ‘X‘: 非必要輸入 Passing data Into Function module

15 Maintain Tables Parameter
LIKE TYPE TYPE REF TO ‘X‘: 非必要輸入

16 Maintain Exceptions

17 Maintain Source code Activate


Download ppt "ABAP Training Function Builder."

Similar presentations


Ads by Google