List of ABAP Function Modules in SAP

Here is a list of important Function Modules in SAP.Function modules are re-usable programs ( codes ) that can be called via ABAP programs.

Function ModuleDescription
ABAP_DOCU_DOWNLOADDownload ABAP documentation in HTML format.
APPL_LOG_DELETEWith this function module you delete logs in the database according to specified selection conditions
APPL_LOG_DISPLAYWith this function module you can analyze logs in the database.
APPL_LOG_DISPLAY_INTERNWith this function module you can analyze logs in local memory, e.g. when you have only collected log records at runtime and do not want to write to the database.
APPL_LOG_INITThis function module checks whether the specified object or sub-object exists and deletes all existing associated data in local memory.
APPL_LOG_READ_DBWith this function module you read the log data in the database for an object or sub-object according to specified selection conditions.
APPL_LOG_READ_INTERNWith this function module you read all log data whose log class has at least the specified value, from local memory, for the specified object or sub-object.
APPL_LOG_SET_OBJECTWith this function module, you create a new object or sub-object for writing in local memory.

With a flag you can control whether the APPL_LOG_WRITE_… messages are written in local memory or are output on the screen.

APPL_LOG_WRITE_DBWith this function module you write all data for the specified object or sub-object in local memory to the database.

If the log for the object or sub-object in question is new, the log number is returned to the calling program.

APPL_LOG_WRITE_HEADERWith this function module, you write the log header data in local memory.
APPL_LOG_WRITE_LOG_PARAMETERSWith this function module, you write the name of the log parameters and the associated values for the specified object or sub-object in local memory.

If this function module is called repeatedly for the same object or sub-object, the existing parameters are updated accordingly. If you do not specify an object or sub-object with the call, the most recently used is assumed.

APPL_LOG_WRITE_MESSAGE_PARAMSWith this function module you write a single message, with parameters, in local memory. Otherwise the function module works like APPL_LOG_WRITE_SINGLE_MESSAGE.
APPL_LOG_WRITE_MESSAGESWith this function module you write one or more messages, without parameters, in local memory.
APPL_LOG_WRITE_SINGLE_MESSAGEWith this function module you write a single message, without parameters, in local memory.

If no header entry has yet been written for the object or sub-object, it is created. If you do not specify an object or sub-object with the call, the most recently used is assumed.

ARFC_GET_TIDwill return the IP address of the terminal in hex.
BAL_CNTL_CREATECreate Control for log display
BAL_CNTL_FREERelease Control
BAL_CNTL_REFRESHPut new data in log display
BAL_DB_DELETEDelete logs from the database
BAL_DB_LOADLoad logs from the database
BAL_DB_LOADLoad log(s)
BAL_DB_SAVESave logs in the database
BAL_DB_SAVESave log(s)
BAL_DB_SEARCHFind logs in the database
BAL_DSP_LOG_DISPLAYDisplay messages in memory
BAL_DSP_LOG_PARAMETERSEither output extended long text or call a callback routine (based on the data in BAL_S_LOG-PARAMS)
BAL_DSP_LOG_TECHNICAL_DATAOutput all log header data
BAL_DSP_MSG_LONGTEXTDisplay message long text
BAL_DSP_MSG_PARAMETERSEither output extended long text or call a callback routine (based on the data in BAL_S_MSG-PARAMS)
BAL_DSP_MSG_TECHNICAL_DATAOutput technical data of a message such as work area, error number, etc.
BAL_DSP_OUTPUT_INITInitialize output
BAL_DSP_OUTPUT_SET_DATASet dataset to be displayed
BAL_DSP_PROFILE_NO_TREE_GETDisplay without tree (fullscreen)
BAL_DSP_PROFILE_POPUP_GETDisplay without tree (popup)
BAL_DSP_PROFILE_SINGLE_LOG_GETStandard profile (SLG1) for one log
BAL_DSP_PROFILE_STANDARD_GETStandard profile (SLG1) for a lot of logs
BAL_GLB_CONFIG_GETRead configuration
BAL_GLB_CONFIG_SETSet configuration
BAL_GLB_MEMORY_EXPORTPut function group memory in ABAP-MEMORY
BAL_GLB_MEMORY_IMPORTGet function group memory from ABAP-MEMORY
BAL_GLB_MEMORY_REFRESH(Partially) reset global memory
BAL_GLB_MEMORY_REFRESH(Partially) initialize memory
BAL_GLB_MSG_CURRENT_HANDLE_GETGet current message handle
BAL_GLB_MSG_DEFAULTS_GETGet message defaults
BAL_GLB_SEARCH_LOGFind logs in memory
BAL_GLB_SEARCH_MSGFind messages in memory
BAL_LOG_CREATECreate log with header data
BAL_LOG_CREATECreate log with header data
BAL_LOG_DELETEDelete log (from database also at Save)
BAL_LOG_EXISTCheck existence of a log in memory
BAL_LOG_HDR_CHANGEChange log header
BAL_LOG_HDR_CHECKCheck log header data for consistency
BAL_LOG_HDR_READRead log header and other data
BAL_LOG_MSG_ADDPut message in log
BAL_LOG_MSG_ADDPut message in log
BAL_LOG_MSG_CHANGEChange message
BAL_LOG_MSG_CHANGEChange message
BAL_LOG_MSG_CHECKCheck message data for consistency
BAL_LOG_MSG_CUMULATEAdd message cumulated
BAL_LOG_MSG_DELETEDelete message
BAL_LOG_MSG_DELETEDelete message
BAL_LOG_MSG_EXISTCheck existence of a message in memory
BAL_LOG_MSG_READRead message and other data
BAL_LOG_MSG_REPLACEReplace last message
BAL_LOG_REFRESHDelete log from memory
BAL_LOG_REFRESHDelete log from memory
BAL_OBJECT_SELECTRead Application Log objects table record
BAL_OBJECT_SUBOBJECTCheck whether object and subobject exist and the combination is allowed
BAL_SUBOBJECT_SELECTRead subobject table record
BP_EVENT_RAISETrigger an event from ABAP/4 program
BP_JOBLOG_READFetch job log executions
CHANGEDOCUMENT_READ_HEADERSGet the change document header for a sales document, and put the results in an internal table.
CHANGEDOCUMENT_READ_POSITIONSGet the details of a change document, and store them in an internal table. This will tell you whether a field was changed, deleted, or updated.
CLAF_CLASSIFICATION_OF_OBJECTSReturn all of the characteristics for a material
CLOI_PUT_SIGN_IN_FRONTMove the negative sign from the left hand side of a number, to the right hand side of the number. Note that The result will be left justified (like all character fields), not right justifed as numbers normally are.
CLPB_EXPORTExport a text table to the clipboard (on presentation server)
CLPB_IMPORTImport a Text Table from the Clipboard (on presentation server)
COMMIT_TEXTTo load long text into SAP
CONVERSION_EXIT_ALPHA_INPUTconverts any number into a string fill with zeroes, with the number at the extreme right
CONVERSION_EXIT_ALPHA_OUTPUTconverts any number with zeroes right into a simple integer
CONVERT_ABAPSPOOLJOB_2_PDFconvert abap spool output to PDF
CONVERT_OTFConvert SAP documents (SAPScript) to other types.
CONVERT_OTFSPOOLJOB_2_PDFconverts a OTF spool to PDF (i.e. Sapscript document)
CONVERT_TO_FOREIGN_CURRENCYConvert local currency to foreign currency.
CONVERT_TO_LOCAL_CURRENCYConvert from foreign currency to local currency
DATE_CHECK_PLAUSIBILITYCheck to see if a date is in a valid format for SAP. Works well when validating dates being passed in from other systems.
DATE_COMPUTE_DAYReturns a number indicating what day of the week the date falls on. Monday is returned as a 1, Tuesday as 2, etc.
DATE_GET_WEEKwill return the week that a date is in.
DATE_IN_FUTURECalculate a date N days in the future.
DAY_ATTRIBUTES_GETReturn useful information about a day. Will tell you the day of the week as a word (Tuesday), the day of the week (2 would be Tuedsay), whether the day is a holiday, and more.(provided by Francois Henrotte)
DOWNLOADdownload a file to the presentation server (PC)
DYNP_VALUES_READRead the values from a dynpro. This function can be used to read the values from a report’s selection screen too (Another example).
DYNP_VALUES_UPDATESimilar to DYNP_VALUES_READ, this function will allow the updating of fields on a dynpro. Very useful when you want to change a field based on the value entered for another field.
ENQUE_SLEEPWait a specified period of time before continuing processing.
ENQUEUE_ESFUNCTIONLock an abap program so that it cannot be executed.
Please note that you should not use SY-REPID to pass your report name to the function. The value of SY-REPID will change as it is being passed to the function module, and will no longer hold the value of the calling report.
EPS_GET_DIRECTORY_LISTINGreturn a list of filenames from a local or network drive
EPS_GET_FILE_ATTRIBUTESPass in a filename and a path, and will return attributes for the file
F4_DATEdisplays a calendar in a popup window and allows user to choose a date, or it can be displayed read only.
F4_IF_FIELD_VALUE_REQUESTUse values from a DDIC table to provide a list of possible values. TABNAME and FIELDNAME are required fields, and when MULTIPLE_CHOICE is selected, more than one value can be returned.
F4IF_INT_TABLE_VALUE_REQUESTF4 help that returns the values selected in an internal table. Very handy when programming your very own F4 help for a field.
F4IF_SHLP_EXIT_EXAMPLEdocuments the different reasons to use a search help exit, and shows how it is done.
F4IP_INT_TABLE_VALUE_REQUESTThis function does not exist in 4.6 and above. Use F4IF_INT_TABLE_VALUE_REQUEST instead.
FILENAME_GETpopup to get a filename from a user, returns blank filename if user selects cancel
FORMAT_MESSAGETakes a message id and number, and puts it into a variable. Works better than WRITE_MESSAGE, since some messages use $ as a place holder, and WRITE_MESSAGE does not accommadate that, it only replaces the ampersands (&) in the message.
FTP_COMMANDExecute a command on the FTP server
FTP_CONNECTOpen a connection (and log in) to an FTP server
FTP_DISCONNECTClose the connection (and log off) the FTP server
FU CSAP_MAT_BOM_READYou can use this function module to display simple material BOMs. You cannot display BOM groups (for example, all variants of a variant BOM). as in transaction CS03. Current restrictions: You cannot display long texts. You cannot display sub-items. You cannot display classification data of BOM items for batches. You can only display one alternative or variant. You cannot enter an alternative for module CSAP_MAT_BOM_READ, so you always see alternative 01. The following example came from a posting on the SAP-R3-L mailing list.
Function Group GRAP is now obsolete.SAP recommends using functions in function group SFES instead. Below is an overview of the changes.
G_SET_GET_ALL_VALUESFetch values from a set.
GET_CURRENT_YEARGet the current fiscal year.
GET_GLOBAL_SYMBOLSReturns a list of all tables, select options, texts, etc for a program. Even includes the text definitions for the selection screen
GET_INCLUDETABReturns a list of all INCLUDES in a program
GET_JOB_RUNTIME_INFOGet the current job number from a program. Also returns other useful info about the current job.
GUI_CREATE_DIRECTORYCreate a directory on the presentation server
GUI_DELETE_FILEReplaces WS_FILE_DELETE. Delete a file on the presentation server
GUI_DOWNLOADReplaces WS_DOWNLOAD. Download table from the app server to presentation server
GUI_EXECReplaces WS_EXECUTE. Start a File or Program Asynchronously with WinExec
GUI_GET_DESKTOP_INFOReplaces WS_QUERY. Delivers Information About the Desktop (client)
GUI_REMOVE_DIRECTORYDelete a directory on the presentation server
GUI_RUNStart a File or Program Asynchronously with ShellExecute
GUI_UPLOADReplaces WS_UPLOAD. Upoad file from presentation server to the app server
HELP_STARTDisplay help for a field. Useful for doing AT SELECTION SCREEN ON VALUE REQUEST for those fields that do not provide F4 help at the DDIC level.
HELP_VALUES_GET_WITH_TABLEShow a list of possible values for F4 popup help on selection screens. This function module pops up a screen that is just like all the other F4 helps, so it looks like the rest of the SAP system. Very useful for providing dropdowns on fields that do not have them predefined.
HOLIDAY_CHECK_AND_GET_INFOUseful for determining whether or not a date is a holiday. Give the function a date, and a holiday calendar, and you can determine if the date is a holiday by checking the parameter HOLIDAY_FOUND.
HOLIDAY_GETProvides a table of all the holidays based upon a Factory Calendar &/ Holiday Calendar.
HR_DISPLAY_BASIC_LISTis an HR function, but can be used for any data. You pass it data, and column headers, and it provides a table control with the ability to manipulate the data, and send it to Word or Excel. Also see the additional documentation here.
HR_GET_LEAVE_DATAGet all leave information (includes leave entitlement, used holidays/paid out holidays)
HR_IE_NUM_PRSI_WEEKSReturn the number of weeks between two dates.
HR_PAYROLL_PERIODS_GETGet the payroll period for a particular date. (provided by Francois Henrotte)
HR_TIME_RESULTS_GETGet the time results for a payroll period. (provided by Francois Henrotte)
INIT_TEXTTo load long text into SAP
K_WERKS_OF_BUKRS_FINDReturn a list of all plants for a given company code.
LIST_FROM_MEMORYRetrieves the output of a report from memory when the report was executed using SUBMIT… EXPORTING LIST TO MEMORY. See also WRITE_LIST.
LIST_TO_ASCIIconvert an ABAP report (displayed on screen) from OTF to ASCII format
MBEW_EXTENDGet the stock position for the previous month. This displays the same info that you see in MM03.
MONTH_NAMES_GETIt returns all the month and names in repective language.
MONTH_PLUS_DETERMINEAdd or subtract months from a date. To subtract a month, enter a negative value for the ‘months’ parameter.
MS_EXCEL_OLE_STANDARD_OLEwill build a file, and automatically start Excel
OTF_CONVERTwraps several other function modules. Will convert OTF to ASCII or PDF
POPUP_TO_CONFIRM_LOSS_OF_DATACreate a dialog box in which you make a question whether the user wishes to perform a processing step with loss of data.
POPUP_TO_CONFIRM_STEPCreate a dialog box in which you make a question whether the user wishes to perform the step.
POPUP_TO_CONFIRM_WITH_MESSAGECreate a dialog box in which you inform the user about a specific decision point during an action.
POPUP_TO_CONFIRM_WITH_VALUECreate a dialog box in which you make a question whether the user wishes to perform a processing step with a particular object.
POPUP_TO_DECIDEProvide user with several choices as radio buttons
POPUP_TO_DECIDE_WITH_MESSAGECreate a dialog box in which you inform the user about a specific decision point via a diagnosis text.
POPUP_TO_DISPLAY_TEXTCreate a dialog box in which you display a two line message
POPUP_TO_SELECT_MONTHPopup to choose a month
POPUP_WITH_TABLE_DISPLAYProvide a display of a table for user to select one, with the value of the table line returned when selected.
PRICINGReturn pricing conditions in an internal table. Use structure TCOMK for parameter COMM_HEAD_1, and structure TCOMP for parameter COMM_ITEM_1, and set CALCULATION_TYPE to B. The pricing conditions will be returned in XOMV. You must fill TCOMP, and TCOMK with the appropriate values before callling the function in order for it to work.
PROFILE_GETRead an Entry in an INI File on the frontend
PROFILE_SETWrite an Entry in an INI File on the frontend
READ_TEXTTo load long text into SAP
REGISTRY_GETRead an Entry from the Registry
REGISTRY_SETSet an entry in the Registry
RFC_ABAP_INSTALL_AND_RUNRuns an ABAP program that is stored in the table PROGRAM when the MODE = ‘F’. Table WRITES contains the ouput of the program. Allows you to run a program without having the source code in the target system.
RH_GET_ACTIVE_WF_PLVARReturn the active HR Plan
RH_GET_DATE_DAYNAMEreturn the day based on the date provied
RH_START_EXCEL_WITH_DATAstarts Excel with the contents of an internal table. This function finds Excel in the desktop registry. It also uses a local PC working directory to save the file (that’s what the ‘W’ value for data path flag does). Very transparent to user!
RH_STRUC_GETReturns all related org info
RHP0_POPUP_F4_SEARKis a matchcode for any type of HR Planning object, including the possibility to fill the field that you want
RKD_WORD_WRAPConvert a long string or phrase into several lines.
RP_CALC_DATE_IN_INTERVALAdd/subtract years/months/days from a date
RP_LAST_DAY_OF_MONTHSDetermine last day of month
RPY_DYNPRO_READRead dynpro, including screen flow
RPY_TRANSACTION_READGiven a transaction, return the program and screen or given a program and screen, return the transactions that use the program and screen.
RS_COVERPAGE_SELECTIONSReturns an internal table that contains a formatted list of all the selection parameters entered for a report. Table is ready to print out.
RS_REFRESH_FROM_SELECTOPTIONSGet the current contents of selection screen
RS_SEND_MAIL_FOR_SPOOLLISTSend message from ABAP/4 program to SAPoffice.
RS_VARIANT_CONTENTSReturns the contents of the specified variant in a table.
RSPO_DOWNLOAD_SPOOLJOBDownload the spool from a program to a file. Requires spool number.
RSPO_RETURN_ABAP_SPOOLJOBFetch printer spool according to the spool number informed.
RZL_READ_DIRIf the server name is left blank, it reads a directory from local presentation server, otherwise it reads the directory of the remote server
RZL_READ_DIR_LOCALRead a directory on the Application Server
RZL_READ_FILERead a file from the presentation server if no server name is given, or read file from remote server. Very useful to avoid authority checks that occur doing an OPEN DATASET. This function using a SAP C program to read the data.
RZL_SLEEPHang the current application from 1 to 5 seconds.
RZL_SUBMITSubmit a remote report.
RZL_WRITE_FILE_LOCALSaves table to the presentation server (not PC). Does not use OPEN DATASET, so it does not suffer from authority checks!
SAP_CONVERT_TO_XLS_FORMATConvert data to Microsoft Excel format.
SAPGUI_PROGRESS_INDICATORDisplay a progress bar on the SAP GUI, and give the user some idea of what is happening
SAVE_TEXTTo load long text into SAP
SCROLLING_IN_TABLEIf you are coding a module pool and using a table control, you can use this function SCROLLING_IN_TABLE to handle any scrolling. (provided by Paul Kjaer)
SD_DATETIME_DIFFERENCEGive the difference in Days and Time for 2 dates
SO_NEW_DOCUMENT_ATT_SEND_API1Send a document as part of an email. The documentation is better than normal for this function, so please read it.
SO_SPLIT_FILE_AND_PATHSplit a fully pathed filename into a filename and a path.
SO_SPOOL_READFetch printer spool according to the spool number informed. See also RSPO_RETURN_ABAP_SPOOLJOB
SO_WIND_SPOOL_LISTBrowse printer spool numbers according to user informed.
SWD_HELP_F4_ORG_OBJECTSHR Matchcode tailored for organizational units. Includes a button so that you can browse the hierarchy too.
SX_OBJECT_CONVERT_OTF_PDFConversion From OTF to PDF (SAPScript conversion)
SX_OBJECT_CONVERT_OTF_PRTConversion From OTF to Printer Format (SAPScript conversion)
SX_OBJECT_CONVERT_OTF_RAWConversion From OTF to ASCII (SAPScript conversion)
SXPG_CALL_SYSTEMyou can check the user’s authorization for the specified command and run the command. The command runs on the host system on which the function module is executed. The function module is RFC capable. It can therefore be run on the host system at which a user happens to be active or on another designated host system at which an R/3 server is active.
SXPG_COMMAND_CHECKCheck whether the user is authorized to execute the specified command on the target host system with the specified arguments.
SXPG_COMMAND_DEFINITION_GETRead the definition of a single external OS command from the R/3 System’s database.
SXPG_COMMAND_EXECUTECheck a user’s authorization to use a command, as in SXPG_COMMAND_CHECK. If the authorization check is successful, then execute the command on the target host system.
SXPG_COMMAND_LIST_GETSelect a list of external OS command definitions.
TERMINAL_ID_GETReturn the terminal id
TH_DELETE_USERLogoff a user. Similar results to using SM04.
TH_ENVIRONMENTGet the UNIX environment
TH_POPUPDisplay a popup system message on a specific users screen.
TH_REMOTE_TRANSACTIONRun a transaction on a remote server. Optionally provide BDC data to be used in the transaction
TH_USER_INFOGive information about the current user (sessions, workstation logged in from, etc)
TH_USER_LISTShow which users are logged into an app server
TMP_GUI_DIRECTORY_LIST_FILESRetrieve all of the files and subdirectories on the Presentation Server (PC) for a given directory.
When a value other than * or *.* is used for the filter, you will not get any directories, unless they match your wildcard filter. For example, if you entered *.png, then only files and directories that end in png will be returned by the function.
UNIT_CONVERSION_SIMPLEconvert weights from one UOM to another.
UPLOADupload a file to the presentation server (PC)
UPLOAD_FILESWill load one or more files from app or presentation server
WEEK_GET_FIRST_DAYFor a given week (YYYYMM format), this function returns the date of the Monday of that week.
WRITE_LISTUseful for writing out the list contents that result from the function LIST_FROM_MEMORY.
WS_DOWNLOADSave Internal Table as File on the Presentation Server
WS_EXECUTEexecute a program on a windows PC
WS_FILE_DELETEDelete File at the Frontend
WS_FILENAME_GETCall File Selector
WS_MSGCreate a dialog box in which you display an one line message
WS_UPLOADLoad Files from the Presentation Server to Internal ABAP Tables
WS_VOLUME_GETGet the label from a frontend device.
WWW_LIST_TO_HTMLAfter running a report, call this function to convert the list output to HTML.