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

How to use CRM_STATUS_READ to get product status?

I want to know that How to use the Function Module CRM_STATUS_READ. In table crmd_orderadm_h have a field GUID and I want to show status by passing the GUID to the FM CRM_STATUS_READ. I don't know how to fill parameters in this FM. FORM…
1
vote
1 answer

BAPI to get customer company?

Customer company is stored in KNB1 table. I tried with BAPI_CUSTOMER_GETDETAIL2, seems it does not expose company code. Instead of it, company code is the bapi input. I am looking for a BAPI that can give company code from given customer number. Is…
swemon
  • 5,840
  • 4
  • 32
  • 54
1
vote
1 answer

BAPI_SALESORDER_CHANGE throws type exception

I'm having trouble using the FM BAPI_SALESORDER_CHANGE. As soon as I execute my report, an exception is thrown by the FM. Following is the dump of the exception. An exception occurred that is explained in detail below. The exception, which is…
Diego
  • 133
  • 1
  • 12
1
vote
2 answers

How to debug DMEE Exit Events in SAP

I got a task to debug following standard and custom function modules which is related to "Event Modules for Payment Medium Formats" I've tried different methods but nothing works.. Any solution how? I found similar task on this thread unfortunately…
Christop
  • 13
  • 1
  • 3
1
vote
1 answer

BAPI/FM to search prod orders confirmations by workcenter and date?

I'm trying to figure out which BAPI/FM I could use to search amounts confirmed based on search criteria of date (+time if possible) and workcenter confirmed where was confirmed... I would be using BAPI_PRODORDCONF_GETDETAIL which contains these…
1
vote
1 answer

RFC-enabled function module to update physical samples

I need to update some fields of Physical samples in SAP ERP: List of columns which are in the table QPRS: ABINF: Storage Information ABDAT: Storage Deadline ABORT: Storage Location List of fields which correspond to statuses (table JEST): Sample…
waleed.makarem
  • 179
  • 2
  • 9
1
vote
0 answers

Create note in MB51 with GOS objects programmatically

Im working on creating a material document movement (MB51 report) and then creating a note to it. So far Im finished with creating the document and returning the document number. And now I need to create a note to that document. I was not able to…
Jiri Zaloudek
  • 326
  • 3
  • 19
1
vote
2 answers

FM to convert time from 24hr to 12hr format?

I have to format a DateTime which is in UTC based on user settings which include its time zone (CET/IST etc) and time format (24hr/12hr). I could find CONVERT TIME STAMP statement which takes only TIME ZONE as a parameter and does that…
1
vote
0 answers

Calling SAP Function Module through SQL Server

Is it possible to call a function module in SAP through a stored procedure in SQL Server that is linked to the SAP SQL Server? I know its not the right way to do things and I should do this using the SAP application layer, but I am not concerned…
Rahul
  • 903
  • 1
  • 10
  • 27
1
vote
1 answer

Convert rawstring (Byte String) into readable String

Requirement: To convert SRT_MMASTER table's MESSAGE_DATA field data into readable string format or in internal table. I have tried different function modules to convert Byte String (Blob) data stored in SRT_MMASTER table's MESSAGE_DATA field but…
Chandan Jha
  • 21
  • 1
  • 7
1
vote
1 answer

BAPI_SALESORDER_CHANGE does not make changes

I am call BAPI BAPI_SALESORDER_CHANGE to update sales order and need to changed the edatu at item level, the return of the BAPI is that the sales order is changed but no changes are made. i am committing after calling the BAPI BAPI…
Umar Abdullah
  • 1,282
  • 1
  • 19
  • 37
1
vote
1 answer

SAP Function Module to SQL Server stored procedure

I am trying to convert a SAP ETL process (implemented by BODS) to SQL Server (SSIS). The process is for delta changes (every 15 minutes) and the object is called “0FI_AP_4” in SAP. I want to implement an SSIS package (SQL Server stored procedure)…
1
vote
1 answer

Why IN UPDATE TASK module always does a rollback of DB?

While updating actual DB table (using SAP LUW), IN UPDATE TASK is always Rollback changes made in actual table. APPEND ls_emp TO lt_up_emp. call function 'ZFM_UPDATE_EMPLOYEE' in update task tables lt_update = lt_up_emp. COMMIT…
divScorp
  • 498
  • 1
  • 8
  • 17
1
vote
2 answers

SAP FM EPS2_GET_DIRECTORY_LISTING file mask

The FM EPS2_GET_DIRECTORY_LISTING has a parameter file_mask which I guess that it should act as a pattern. I need to read from the AS the files containing a word but the file_mask is working faultly. For example if I pass "*ZIP" it returns a file…
Codrin Strîmbei
  • 125
  • 7
  • 22
1
vote
1 answer

FM to simulate Delivery without Reference Sales Order

Is there other known FM that can be used to simulate deliveries aside from FM SD_SCD_SIMULATE_DELIVERIES? This FM SD_SCD_SIMULATE_DELIVERIES needs SALES_ORDER as mandatory importing parameter and I don't have SALES_ORDER. Please advise. Thanks! -CZa
Czarinaaaaa29
  • 311
  • 2
  • 8
  • 23