Useful Functions in ABAP
This page is intended to showcase the documentation of some useful function modules. I am putting
this is because indexing and searching for information will be easier here compared to the research
in SE37.
Function module to execute unauthorized transactions
TRANSACTION_CALL_VIA_RFC To carry out some unauthorized transactions.
To carry out some transactions not
ALINK_CALL_TRANSACTION
authorized.
Function modules for program creation (Useful when you are generating programs)
RS_PROGRAM_CHECK_NAME To verify program names, if you are generating them.
RS_CORR_INSERT To insert the correction request into the directory
To activate objects in the repository. (To activate a program, for
REPS_OBJECT_ACTIVATE
example)
RS_DELETE_PROGRAM To delete a program.
RS_ACCESS_PERMISSION To block/unblock a program
Function modules related to date and time calculations
CALCULATE_DATE Calculate a future date based on the input
DATE_TO_DAY Return the day for the entered date
DATE_COMPUTE_DAY Returns the day of the week for a date
DATE_GET_WEEK Returns the week of a date
RP_CALC_DATE_IN_INTERVAL Add days / months to a date
Return the attributes for a range of
DAY_ATTRIBUTES_GET
specified data
MONTHS_BETWEEN_TWO_DATES To obtain the number of months between the two dates.
END_OF_MONTH_DETERMINE_2 Determine the end of a month.
Find the difference between two dates in years,
HR_HK_DIFF_BT_2_DATES
months and days.
Find the difference between two dates in years,
FIMA_DAYS_AND_MONTHS_AND_YEARS
months and days.
GET_MONTH_NAMES Get the names of the month
WEEK_GET_FIRST_DAY Get the first day of the week
HRGPBS_HESA_DATE_FORMAT Format the date in the format dd/mm/yyyy
Find the difference between two dates/times and
SD_CALC_DURATION_FROM_DATETIME
report the difference in hours
Determine the time difference between two
L_MC_TIME_DIFFERENCE
dates/times
Difference between two dates in days, weeks,
Interval between dates
months
LAST_DAY_OF_MONTHS Returns the last day of the month
DATE_CHECK_PLAUSIBILITY Check if the date is invalid
Enter the year in yy format for output in format
DATE_2D_TO_4D_CONVERSION
yyyy
Enter the date and you will receive the name of the day: 1-
DAY_IN_WEEK
Monday
Show the difference in days and hours between
SD_DATETIME_DIFFERENCE
two dates
Holidays and factory calendar
Returns holidays of a country. It has two flags:
HOLIDAY_GET
Free day (for weekends)
Returns the calendar date for the factory date and
FACTORYDATE_CONVERT_TO_DATE
of the past factory calendar
Returns the factory date for the date and calendar of
DATE_CONVERT_TO_FACTORYDATE
factory past
Popup for dates
F4_DATE Show a pop-up window to choose a date
POPUP TO SELECT MONTH Show a pop-up window to select a month
Function modules related to (ALV) SAP LIST VIEWER
REUSE_ALV_LIST_DISPLAY ABAP List Viewer (Show the List)
REUSE_ALV_GRID_DISPLAY ALV GridControl Full Screen
Create the field catalog structure from the dictionary or
REUSE_ALV_FIELDCATALOG_MERGE
an internal table
Function modules related to Change Control
CHANGEDOCUMENT_READ_HEADERS Read and format modification documents
Read modification document headers and the
CHANGEDOCUMENT_READ
items to obtain the old and new values
Function-related formatting modules
CLOI_PUT_SIGN_IN_FRONT Displays the negative sign in front of a number
RKD_WORD_WRAP Break the text into several lines
CONVERSION_EXIT_ALPHA_INPUT Complete a number with leading zeros
CONVERSION_EXIT_ALPHA_OUTPUT Remove the leading zeros from a number
READ_EXCHANGE_RATE Currency Exchange
SPELL_AMOUNT Transform numerical values into text
Function modules related to Dialog Prompts
Show a popup window with a defined message
POPUP_TO_CONFIRM
by the user for confirmation
Show a pop-up window requesting a value for a
POPUP TO GET VALUE
determined table-fieldname
Displays a progress bar with a text for
SAP GUI Progress Indicator
indicate the percentage of completion and status
Show a pop-up window to get the name of a
FILENAME_GET
file on the presentation server (local)
F4_DATE Show a pop-up window to choose a date
POPUP_TO_SELECT_MONTH Display a pop-up to select a month
GET_PRINT_PARAMETERS Printer parameters
Help F4 and also returning the value to be displayed
F4IF_INT_TABLE_VALUE_REQUEST
in the internal table
Help F4 for fields that will only be known in
F4IF_FIELD_VALUE_REQUEST
execution time
Function modules related to RFC communication
RFC_CONNECTION_CLOSE Establish an RFC connection
RFC_GET_SYSTEM_INFO Show the system information of a remote connection
Function modules related to reading/writing files on the application server
(hereinafter referred to as AS) or Frontend +
Upload a file to the server as well
FILE_READ_AND_CONVERT_SAP_DATA application as in presentation and returns in
an internal table
SUBST_GET_FILE_LIST Return a list of files in the AS
ALSM_EXCEL_TO_INTERNAL_TABLE Transfer of legacy data with Excel
WS_FILE_DELETE Delete files in AS
PFL_COPY_OS_FILE Copy files to the AS
EPS_GET_DIRECTORY_LISTING Returns all files from a directory of the AS
Show a popup window that returns the name of
FILENAME_GET
file in AS (Transaction FILE)
GUI_UPLOAD Upload a file to the server
application
GUI_DOWNLOAD Download an internal table to the PC
Function modules related to sending emails
SO_NEW_DOCUMENT_ATT_SEND_API1 Send emails with text and attachments
SO_NEW_DOCUMENT_SEND_API1 Send emails with text
Functional modules related to data maintenance
VIEW MAINTENANCE CALL To maintain the data of a table or view (SM30)
Values and Currency
CURRENCY_AMOUNT_SAP_TO_IDOC Convert the currency to IDOC format
Move the negative sign to the left side of a
number to the right of the number. Note that
CLOI_PUT_SIGN_IN_FRONT the result will be justified to the left (like
all character fields), and not justified to
right, as numbers normally are.
CONVERT_TO_FOREIGN_CURRENCY Convert local currency to foreign currency.
CONVERT TO LOCAL CURRENCY Convert foreign currency to local currency
Convert a value from one currency to another (exchange rate)
CONVERT_AMOUNT_TO_CURRENCY from exchange rates taken from the bank tables of
data)
CONVERT_CURRENCY_BY_RATE Convert a value from one currency to another, from
according to the past exchange rate
Currency value conversion in format
BAPI_CURRENCY_CONV_TO_EXTERNAL
of external data
Conversion of values in currency in internal format
BAPI_CURRENCY_CONV_TO_INTERNAL
two dice
CALCULATE_TAX_FROM_NET_AMOUNT
SPELL_AMOUNT To obtain the value in full text
HR_IN_CHG_INR_WRDS Convert amount INR to words
Function modules related to FI, CO, and SD modules
FOR_ALL_SKC1A Subtotal of a bill
I_GET_CONFIGURATION Details of Purchase and Sale settings
Terms of Payment Print the terms of a one-time payment
SD_PRINT_TERMS_OF_PAYMENT_SPLI Print the terms of an installment payment
J_1B_NF_DOCUMENT_READ Read the details of the invoice
Read the values of the NF returned combined with
J_1B_NF_VALUE_DETERMINATION
J_1B_NF_DOCUMENT_READ
Function modules related to ABAP-HR
This function module is used to maintain data
HR_MAINTAIN_MASTERDATA
master for employees and candidates.
HR_READ_INFOTYPE This function module reads the data records from
an HR infotype that exists for employees and
candidates.
This function is used to maintain the data of
HR_INFOTYPE_OPERATION
employees and candidates.
CU_READ_RGDIR This function is used to read the RGDIR from the CU cluster.
This function module reads the payroll
PYXX_READ_PAYROLL_RESULT complete the versions of all countries from the file of
cluster PCL2.
This function module is used to search for the
HR_GET_PAYROLL_RESULTS
payroll results for the employees.
This function module is used to maintain the relationship
HR_RELATION_MAINTAIN
between employee and position.
This function module is to create a position or
BAPI_HRMASTER_SAVE_REPL_MULT
organizational unit, etc.