Function Modules

What is the Function Module in BDC?

Function modules in BDC performed in a sequence to transfer the data successfully.

List down the functional modules used in sequence in BDC?
Which function modules can be used to transfer the data using BDC programming?

These are the 3 functional modules that are used in a sequence to perform a data transfer successfully using BDC programming -

  • BDC_OPEN_GROUP - Parameters like Name of the client, sessions and username are specified in these functional modules.
  • BDC_INSERT - It is used to insert the data for one transaction into a session.
  • BDC_CLOSE_GROUP - This is used to close the batch input session.

Define Function Group. What are the differences between Function Module and Function Group?

Function Group and Function Module are logically belonging together. Function groups are considered as containers of the Function Modules. The differences between Function Groups and Function Modules are as follows -

  • Function Groups need not be defined in Function Module however, the function modules must be defined in Function Groups.
  • Function Modules can be called from various kinds of programs. Function Groups cannot be called.
  • Function Groups acts as Function Module's containers, but the function modules don’t act as containers.

What statement will be found in an SAP application program that implements a function module exit?

“CALL CUSTOMER” statement used to determine if a function module exit exists.

Explain the relationship between a functional area, user group and query when developing queries using the SAP Query tool?

  • Functional areas and user groups are organizational elements used in SAP Query that should be created in the order specified by user to query environment.
  • The data that is used to define the query specified in a functional area.
  • Users are assigned to user groups. Functional areas are also assigned to the user group allowing users to create and start querying based on the data in that functional area. Multiple functional areas can be assigned to a user group and a functional area can be assigned to several different groups.

What is Function Group? Difference between function group and Function Module?

Function Groups act as containers for Function Modules that logically belong together.
Function Groups -

  • These cannot be defined in a Function Module.
  • It cannot be called.
  • They are containers for Function Module.

Function Modules -

  • These must be defined in a Function Group.
  • It can be called from any program.
  • They are not containers for Function Group.

What is an RFC?

Remote Function Call.

Create any functions? How to go about it?

Steps for creating the Functions -
First Procedure -

  1. /nSE37
  2. Goto
  3. Function Group (FG)
  4. Create Group
  5. Name of FG (ZTC_FG)
  6. Short Text
  7. Save
  8. Local Object

Second Procedure -

  • Environment
  • Inactive Object
  • Function Group (ZTC_FG)
  • Activate
  • Back

Third Procedure -

  • Name of Function Module (ZTC_FM)
  • Create
  • Write FG Name (ZTC_FG)
  • Short Text
  • Save

Fourth Procedure -
Call function ‘ZTC_FM’.

What are the function modules used in F4 Help?

There are two types of function modules used in F4 help -


How do you write a function module in Sap? Describe?

  • Called program - SE37 - Creating function group, function module by assigning attributes, importing, exporting, tables, and exceptions.
  • Calling program - SE38 - In program, click pattern and write function name- provide export, import, tables, exception values.

What are the exceptions in function module?

Exception is a runtime errors that occurs during the function module execution. Normally exceptions might occur due to performing an invalid operation or invalid movements. Exception disturbs the normal flow of the execution.

What are different types of attributes of Function Module?
Do you know about the types of attributes of the function module?

There are 6 attributes of function module -

  • Import
  • Export
  • Table
  • Changing
  • Source
  • Exception

Can function modules be called from other kinds of programs?

Yes, Function Modules can be called from several other types of programs.

Type of parameters to pass to RFC pass by value or pass by reference?

Always Pass by Value.
RFC is Remote Function call cannot access the values with Pass by reference.

How to debug RFC Function module?

SE38 -> Utilities -> Settings -> ABAP Editor -> Debugging.
The above path activates the external debugging and choose the New Debugger option in ABAP debugger. Go to the place in the code and put break point, popup appear then choose the HTTP break point. If we are triggering the RFC from SAP portal make sure that both the user ID should be same. If the users are different then provide the XI/Portal User ID in the user’s field.

What is difference between Function module and RFC?

In a function module, passing data using call by reference. In particular, the tables parameter should call using "call by reference" by passing memory address.
In an RFC, passing data is by value. The reason behind this is, it’s going to access other system while doing the above by reference wouldn't work as we are into another system whose memory id will not match.

What is the difference between BAPI and RFC?

A BAPI are standard SAP function modules provided by SAP for remote access. Also, they are part of Business Object Repository (BOR).
RFC is the protocol used to call functions in an R/3 system by a caller external to R/3 or to call programs external to R/3 from an R/3 system. BAPI are RFC enabled function modules. The difference between RFC and BAPI are business objects. We create business objects and those are then registered in our BOR (Business Object Repository) that can be accessed outside the SAP system by using some other applications (Non-SAP) such as VB or JAVA.

What is a function Group in SAP?

Function Group is a collection of function modules that shares global data with each other.
When an ABAP/4 program contains a CALL FUNCTION statement, the system loads the entire function group in with the program code at run time. Every function module belongs to a function group.

What are the types of parameters in the function modules?

  • EXPORTING: for passing data to the called function.
  • IMPORTING: for receiving data returned from the function module.
  • TABLES: for passing internal tables only, by reference (that is, by address).
  • CHANGING: for passing parameters to and from the function.

What is extension in and extension out in BAPI?

BAPI extension is used to update custom fields of a table.
BAPI extension out is used to retrieve custom fields of a table.