Header Ads

Important abap function modules


Useful ABAP Function Modules

This page is intended to maintain documentation of useful function modules. This is needed because indexing and search of information will be easier here (When compared to searching in SE37). When this page starts growing, this can be structured in an area wise list.

Function Module to execute unauthorized transactions
TRANSACTION_CALL_VIA_RFCTo execute some unauthorized transactions.

Function Modules for creating programs
 (Useful when you are generating programs)
RS_PROGRAM_CHECK_NAMETo check program names if you are generating them.
RS_CORR_INSERTTo insert the correction request in the repository.
REPS_OBJECT_ACTIVATETo activate repository objects, for example - to activate a newly generated program.
RS_DELETE_PROGRAMTo delete the program.
RS_ACCESS_PERMISSIONTo lock or unlock a program.

Function Modules related to Date and Time Calculations
CALCULATE_DATECalculates the future date based on the input .
DATE_TO_DAYReturns the Day for the entered date. 
DATE_COMPUTE_DAYReturns weekday for a date
DATE_GET_WEEKReturns week for a date
RP_CALC_DATE_IN_INTERVALAdd days / months to a date
DAY_ATTRIBUTES_GETReturns attributes for a range of dates specified
MONTHS_BETWEEN_TWO_DATESTo get the number of months between the two dates.
END_OF_MONTH_DETERMINE_2Determines the End of a Month.
HR_HK_DIFF_BT_2_DATESFind the difference between two dates in years, months and days.
FIMA_DAYS_AND_MONTHS_AND_YEARSFind the difference between two dates in years, months and days.
MONTH_NAMES_GETGet the names of the month
WEEK_GET_FIRST_DAYGet the first day of the week
HRGPBS_HESA_DATE_FORMATFormat the date in dd/mm/yyyy format
SD_CALC_DURATION_FROM_DATETIMEFind the difference between two date/time and report the difference in hours
L_MC_TIME_DIFFERENCEFind the time difference between two date/time
HR_99S_INTERVAL_BETWEEN_DATESDifference between two dates in days, weeks, months
LAST_DAY_OF_MONTHSReturns the last day of the month
DATE_CHECK_PLAUSIBILITYCheck for the invalid date.
DATE_2D_TO_4D_CONVERSIONYear entry: 2-character to  4-character.
DAY_IN_WEEKInput date and will give the name of the day 1-monday,2-Tuesday....
SD_DATETIME_DIFFERENCEGive the difference in Days and Time for 2 dates

Holidays and Factory Calendar
HOLIDAY_GETGives holidays for a country.It has two flags Freeday(for weekends)and Holiday(for public holidays).
FACTORYDATE_CONVERT_TO_DATEreturns the calendar date for the factory date and the factory calendar passed
DATE_CONVERT_TO_FACTORYDATEreturns the factory date for the date and factory calendar passed

Popup for dates
F4_DATEDisplays a popup dialog to choose date
POPUP_TO_SELECT_MONTHDisplay a pop-up to select a month

Function Modules related to (ALV)   SAP LIST VIEWER
REUSE_ALV_LIST_DISPLAYABAP List viewer  (LIST DISPLAY)
REUSE_ALV_GRID_DISPLAYALV GridControl full screen
REUSE_ALV_FIELDCATALOG_MERGECreate field catalog from dictionary structure or internal table

Function Module related to Change Tracking
CHANGEDOCUMENT_READ_HEADERSRead and format change documents
CHANGEDOCUMENT_READread change document headers and items to get the old and new values

Function Modules Related To Formatting
CLOI_PUT_SIGN_IN_FRONTDisplays the negative sign in front of the numeral
RKD_WORD_WRAPWrap text into several lines
CONVERSION_EXIT_ALPHA_INPUTPad zeros to the number at the left
CONVERSION_EXIT_ALPHA_OUTPUTEliminate zeros to the number at the left
READ_EXCHANGE_RATEExchange Convertion
SPELL_AMOUNTTransforms numeric values into text

Function Modules Related To Dialog Prompts
POPUP_TO_CONFIRMDisplays a popup dialog with a user defined message for confirmation
POPUP_TO_GET_VALUEDisplays a popup dialog requesting a value for a particular table-fieldname
SAPGUI_PROGRESS_INDICATORDisplays a progress bar with text to denote the percentage of completion and status
FILENAME_GETDisplays a popup dialog to get the presentation server filename
F4_DATEDisplays a popup dialog to choose date
POPUP_TO_SELECT_MONTHDisplay a pop-up to select a month
GET_PRINT_PARAMETERSPrinter parameters
F4IF_INT_TABLE_VALUE_REQUESTF4 help also returning the value to be displayed in internal table
F4IF_FIELD_VALUE_REQUESTF4 help for fields that are only known at runtime

Function modules related to RFC communication
RFC_CONNECTION_CLOSEClose a RFC connection
RFC_GET_SYSTEM_INFOGive system's information of a remote system
{+}Function modules related to reading/writing files on application server (named AS below) or Frontend +
FILE_READ_AND_CONVERT_SAP_DATAUploads the file from either presentation or application server into an internal table
SUBST_GET_FILE_LISTTo get the list of files from AS
ALSM_EXCEL_TO_INTERNAL_TABLELegacy Data Transfer w/ Excel
WS_FILE_DELETEDelete files on AS server
PFL_COPY_OS_FILECopy AS files
EPS_GET_DIRECTORY_LISTINGReturns all files from an AS directory
FILENAME_GETDisplays a popup dialog to get an AS filename (FILE transaction)
GUI_UPLOADUpload a file from the presentation server
GUI_DOWNLOADDownloads an Internal Table to the PC

Function Modules related to sending emails
SO_NEW_DOCUMENT_ATT_SEND_API1Sends emails with texts and attachments
SO_NEW_DOCUMENT_SEND_API1Sends emails with texts.

Function Modules related to data maintenance
VIEW_MAINTENANCE_CALLTo maintain data from a table or view (SM30)

Amount and Currency
CURRENCY_AMOUNT_SAP_TO_IDOCConvert currency to IDOC format
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.
CONVERT_TO_FOREIGN_CURRENCYConvert local currency to foreign currency.
CONVERT_TO_LOCAL_CURRENCYConvert from foreign currency to local currency
CONVERT_AMOUNT_TO_CURRENCYConvert an amount from a currency to another (exchange rate taken from database tables)
CONVERT_CURRENCY_BY_RATEConvert an amount from a currency to another, according to the passed exchange rate
BAPI_CURRENCY_CONV_TO_EXTERNALConversion of Currency Amounts into External Data Format
BAPI_CURRENCY_CONV_TO_INTERNALConversion of Currency Amounts into Internal Data Format
CALCULATE_TAX_FROM_NET_AMOUNT
SPELL_AMOUNTto get Amount in words
HR_IN_CHG_INR_WRDSChanges INR amount to words.

Function Modules related to FI, CO and SD Modules
FOR_ALL_SKC1AAccount subtotal
VC_I_GET_CONFIGURATIONSales Purchase details configuration
SD_PRINT_TERMS_OF_PAYMENTPrint terms for unique payment
SD_PRINT_TERMS_OF_PAYMENT_SPLIPrint terms for some parcels payment
J_1B_NF_DOCUMENT_READRead NF details
J_1B_NF_VALUE_DETERMINATIONRead values from NF returned combined with J_1B_NF_DOCUMENT_READ using.

Function Module related to HR-ABAP
HR_MAINTAIN_MASTERDATAThis function module is used to maintain master data for employees and applicants.
HR_READ_INFOTYPEThis function module reads the data records of an HR infotype that exist for employees and applicants.
HR_INFOTYPE_OPERATIONThis function module is used to maintain employees and applicants data.
CU_READ_RGDIRThis function module is used to read RGDIR of cluster CU.
PYXX_READ_PAYROLL_RESULTThis function module reads complete payroll result for all country versions, from file PCL2 cluster.
HR_GET_PAYROLL_RESULTSThis function module is used to fetch the payroll results for employees .
HR_RELATION_MAINTAINThis function module is to maintain the relation between employee and position.
BAPI_HRMASTER_SAVE_REPL_MULTThis function module is to create position or organizaion unit ect.

Powered by Blogger.