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
1
vote
1 answer

BAPI_PRDSRVAPS_SAVEMULTI2 - Net weight becomes Zero

APO Experts, Where in the BAPI_PRDSRVAPS_SAVEMULTI2 are internal tables appending the updated values to the database? I am having trouble because when I passed 34.5 for net weight in this bapi BAPI_PRDSRVAPS_SAVEMULTI2, after COMMIT, value in MARM…
Czarinaaaaa29
  • 311
  • 2
  • 8
  • 23
1
vote
2 answers

Handling function module interfaces in bulk?

Is there a way to access the import parameters passed into a function module without addressing them individually? Does ABAP store them in some internal table, so I can work with them by looping through rows in some table, or fields of a…
Greg Day
  • 13
  • 5
1
vote
2 answers

Changing average price in Material Master (MM02) programmatically

I want to programmatically change the moving/average price(s) of materials for the following special case: VPRSV = 'S' (Standard price) MLMAA = 'X' (Material Ledger activated) MLAST = '3' (Material Price Determination = '3'…
Gerd Castan
  • 6,275
  • 3
  • 44
  • 89
1
vote
1 answer

How to use CRM_ORDER_READ function module in SAP CRM?

I am a fresher. Just 2 months of experience in SAP ABAP. I am asked to get the quotation date for list of contracts. For that I need to get the crm business transaction number from everh table. Now I need to use this transaction number in the…
user3757558
  • 55
  • 4
  • 12
1
vote
3 answers

Why is KOFAX SAP Function Module Z_DICOM_STORE_USING_FB60_FB65 not being Populated when Run?

We have upgraded our development SAP system from ECC6 SPS3 to ECC6 SPS5. An application external to SAP (KOFAX - a SAP certified product) passes an invoice image and invoice data to the SAP system. It then calls the Function Module…
Techboy
  • 4,286
  • 5
  • 36
  • 45
1
vote
3 answers

Bulk load into table parameter in Function Module and save it in test directory

I have an importing parameter of Table Type in a Function Module / BAPI which is having only one field (material number). I want to enter hundreds of rows to that Parameter and save it as test data. If I follow the normal procedure, I have to create…
Rahul Gupta
  • 111
  • 1
  • 5
1
vote
1 answer

FM to Download ABAP report output to PC as text

Is there any function module aside from GUI_DOWNLOAD to download the ABAP report output?
kinrubich
  • 15
  • 4
1
vote
2 answers

How to use exceptions in a function module?

I am pretty new at ABAP and I try to learn Function Modules in ABAP. I create a function and give it parameters for IMPORT and EXPORT,TABLES also I want to give an exception to the user while he/she make something what I don't want. So, I have two…
Merve Gül
  • 1,377
  • 6
  • 23
  • 40
1
vote
2 answers

SAP ERP, how to checkIn document files?

I want to create a new document in SAP ERP. Additional I have some files which belongs to this document, these files I want to upload to the SAP knowledge base. I'm using BAPI_DOCUMENT_CREATE2 to create or BAPI_DOCUMENT_CHECKIN2 to add files to a…
thomasW
  • 21
  • 2
  • 5
1
vote
1 answer

Get material linked document data

I want to get data from SAP ERP and put new data (material and document) to SAP ERP. I'm using the ERPConnect .Net tool from theobald software. But the question is not ERPConnect specific, any solution in C++, C# or any other language are fine. The…
thomasW
  • 21
  • 2
  • 5
0
votes
0 answers

Update BKPF fields while posting a document after validation is successful

I have a requirement to update XBLNR_ALT field using a number range on the header BKPF when posting a document. This update needs to happen only after all validations are successful. My requirement is to update the field using continuous number…
0
votes
1 answer

Data Extraction from SAP to Azure Datalake with Datafactory using SAP CDC

I am extracting ABAP CDS views from the SAP with Data Factory using SAP CDC. The ABAP CDS views are delta enabled but anytime I try to extract full load, I get the following error: Message=Sap Odp operation 'Execute function module…
0
votes
1 answer

How to get employee transport and accommodation allowance?

I am working on one of our HR system which have integration with SAP, I am using SAP Connector for Microsoft .NET 3.0 and it's working fine for getting basic employee data using BAPI_EMPLOYEE_GETDATA function module. I wants to know is there any…
0
votes
1 answer

FM for printing ZPL causes deadlock

I did create a ABAP report to print some ZPL which works fine. Now my goal is to transfer that logic into a FM to be able to call it wherever and however I want. Problem is that doing so causes my SAPGUI to deadlock itself for like 10 minutes and…
Radinator
  • 1,048
  • 18
  • 58
0
votes
1 answer

Any workflow assigned to 531 and 261 movement types?

Follow-up question of BAPI_GOODSMVT_CREATE in parallel mode causes "plant data of the material XXX is locked" error. As I wrote in above question - I'm currently improving program by using parallelism to split one job to multiple job, which are…