Questions tagged [function-module]

A function module is an SAP sub-program containing reusable code. They can be used to modularise ABAP programs. This tag can be used for issues using predefined function modules and for problems writing and implementing user created function modules.

Function modules allow you to encapsulate and reuse global functions in the SAP System. They are managed in a central function library. The SAP System contains several predefined functions modules that can be called from any ABAP program. Function modules also play an important role during updating and in interaction between different SAP systems, or between SAP systems and remote systems through remote communications.

Unlike subroutines, you do not define function modules in the source code of your program. Instead, you use the Function Builder. The actual ABAP interface definition remains hidden from the programmer. You can define the input parameters of a function module as optional. You can also assign default values to them. Function modules also support exception handling. This allows you to catch certain errors while the function module is running. You can test function modules without having to include them in a program using the Function Builder.

The Function Builder also has a release process for function modules. This ensures that incompatible changes cannot be made to any function modules that have already been released. This applies particularly to the interface. Programs that use a released function module will not cease to work if the function module is changed.

Useful Links

Related Tags

84 questions
3
votes
1 answer

Starting new thread without using a Function Module call

I know that one can start a new thread by CALL FUNCTION 'ZTEST_RFC' STARTING NEW TASK 'ABC'. but as I am writing a web application in ABAP, it feels so wrong to have my OO handler parse an http call, get the request data, then call an Old Skool…
tomdemuyt
  • 4,572
  • 2
  • 31
  • 60
3
votes
1 answer

How to create a Search Help Exit Function Module, if it requires TABLES parameters but those are obsolete?

Trying to create a Search Help Exit (to copy an old one actually). My problem is that I can't declare Tables parameters for a function module (because they are obsolete and i can't get past the warning) BUT on checking by Function Module, an error…
vlad-ardelean
  • 7,480
  • 15
  • 80
  • 124
2
votes
1 answer

How to add homepage URL to SAP business partner?

I'm working on a program witch creates Business Partners in SAP IS-U system. For the creation of business partners I use function module BAPI_ISUPARTNER_CREATEFROMDATA I have to add homepage URL too, any idea how to do it? Thanks!
ijavid
  • 715
  • 12
  • 23
2
votes
1 answer

How to get the due date 14 days before shipment date?

have the requirement to set the payment term 14 days before shipment date. so my baseline date will be the shipment date. How to get the due date for 'baseline date - 14 days' because all the resource i searched it only showed for baseline date +…
khaidir
  • 21
  • 1
2
votes
2 answers

Read data from XLSX provided as XSTRING

An Excel file (.xlsx) is uploaded on the frontend which is UI5 Fiori. The file contents come to SAP ABAP backend via ODATA in XSTRING format. I need to store that XSTRING into an internal table and then in a DDIC table. Eg: Suppose the Excel has 5…
sneh
  • 21
  • 1
  • 1
  • 2
2
votes
2 answers

How to build a call graph for a function module?

A while ago during documenting legacy code I found out there is a tool for displaying call graph (call stack) of any standard program. Absurdly I wasn't aware of this tool for years :D It gives fancy list/hierarchy of calls of the program, though…
Suncatcher
  • 10,355
  • 10
  • 52
  • 90
2
votes
1 answer

How to get MIGO data via FM or BAPI?

Is there a BAPI or FM to get the data on the MIGO screen? I'm talking about the data it retrieves when pressing the execute button. I tried debugging the code, but it doesn't seem to call a BAPI or FM. Regards
Dorien De Wallen
  • 173
  • 5
  • 13
2
votes
2 answers

Do we need to clear an export parameter at FM start?

I found this code: FUNCTION /FOO/BAR. *"---------------------------------------------------------------------- *"*"Lokale Schnittstelle: *" IMPORTING *" VALUE(IV_XYZ) TYPE STRING *" EXPORTING *" VALUE(EV_RESULT_JSON) TYPE …
guettli
  • 25,042
  • 81
  • 346
  • 663
2
votes
3 answers

How to use REUSE_ALV_FIELDCATALOG_MERGE function module?

I'm trying to use the function module REUSE_ALV_FIELDCATALOG_MERGE to pass the field label in ddic to display in the column header of the alv report. But, that didn't work. If I comment the I_STRUCTURE_NAME = 'TY_YNAH_CUS_OBJ_REQ' line, it give me…
Begin
  • 21
  • 1
  • 2
  • 4
2
votes
1 answer

Bad Request error when calling HTTP_POST?

I have a question about the SAP Function Module "http_post". I just want to post a short message (msg) out of the SAP to a Push Notification Server (pushd-Github-Projekt) I installed before. Now I'm not sure how to pass the message. I tested the FM…
user3759155
  • 21
  • 1
  • 1
  • 4
2
votes
3 answers

How to find the Transport Request with my custom objects?

I've copied two Function Modules QM06_SEND_PAPER_STEP2 and QM06_FM_TASK_CLAIM_SEND_PAPER to similar Z* Function Modules. I've put these FMs into a ZQM06 Function Group which was created by another developer. I want to use Transaction SCC1 to move my…
vlad-ardelean
  • 7,480
  • 15
  • 80
  • 124
2
votes
1 answer

Is there a way to export test parameters from SE37?

Is there a way to export the test variants of the test tool available in the transaction SE37 and then import those variants into another system? I have not been able to find anything in the standard. Maybe there is a custom program which would…
Jagger
  • 10,350
  • 9
  • 51
  • 93
1
vote
1 answer

The statement "function" is not allowed in the current environment

I try to create simple function module but I have this error which says the statement "function" is not allowed in the current environment. However, the similar statement "function-pool" is allowed Thank you.
1
vote
2 answers

BAPI_GOODSMVT_CREATE with multiple material numbers and same PP order?

As I know of, When you're using BAPI_GOODSMVT_CREATE at the same time(by loop or just coincidence), Using same material number puts you an error about locked object (Material XXXX is locked by USER YYYY). But, as i know of, using…
1
vote
1 answer

How to collect detailed stack trace for Function Module execution?

Is there a way / tool to collect detailed Stacktrace for SAP Function Module executions? We are seeing intermittent performance issues in an application. It is calling a SAP FM (using PyRFC). This FM itself performs many things - logic, further…
sdas
  • 23
  • 8