Professional Documents
Culture Documents
ABAP Knowledge
ABAP Knowledge
APPL_LOG_DELETE With this function module you delete logs in the database according
to specified selection conditions
APPL_LOG_DISPLAY With this function module you can analyze logs in the database.
APPL_LOG_DISPLAY_INTERN With 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_INIT This function module checks whether the specified object or sub-object
exists and deletes all existing associated data in local memory.
APPL_LOG_READ_DB With 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_INTERN With 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 subobject.
APPL_LOG_SET_OBJECT With this function module, you create a new object or subobject 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_DB With 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_HEADER With 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_PARAMS With 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_MESSAGES With this function module you write one or more
messages, without parameters, in local memory.
APPL_LOG_WRITE_SINGLE_MESSAGE With 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_TID will return the IP address of the terminal in hex.
BAL_CNTL_CREATE Create Control for log display
BAL_CNTL_FREE Release Control
BAL_CNTL_REFRESH Put new data in log display
BAL_DB_DELETE Delete logs from the database
BAL_DB_DEQUEUE Unlock log
BAL_DB_ENQUEUELock log
BAL_DB_LOAD Load logs from the database
BAL_DB_LOAD Load log(s)
BAL_DB_SAVE Save logs in the database
BAL_DB_SAVE Save log(s)
BAL_DB_SAVE_PREPAREPrepare save
BAL_DB_SEARCH Find logs in the database
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_EXPORT Export a text table to the clipboard (on presentation server)
CLPB_IMPORT Import a Text Table from the Clipboard (on presentation server)
COMMIT_TEXT To load long text into SAP
CONVERSION_EXIT_ALPHA_INPUT converts any number into a string fill with zeroes,
with the number at the extreme right
Example:
input = 123
output = 0000000000000...000000000000123
= 00000000000123
= 123
=
=
=
=
=
=
=
=
"PDF"
FILE_LEN
OTFDATA
PDFDATA
1
2
3
4.
SRTF2 = 0
SRTF = (your report name)
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_LISTING return a list of filenames from a local or network drive
EPS_GET_FILE_ATTRIBUTES Pass in a filename and a path, and will return attributes
for the file
F4_DATE displays a calendar in a popup window and allows user to choose a date, or it can
be displayed read only.
F4_IF_FIELD_VALUE_REQUEST Use 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_REQUEST F4 help that returns the values selected in an
internal table. Very handy when programming your very own F4 help for a field.
Example:
data:
begin of t_values occurs 2,
value like kna1-begru,
end of t_values,
t_return like ddshretval occurs 0 with header line.
t_values = 'PAR*'.
append t_values.
t_values = 'UGG'.
append t_values.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield
= 'BEGRU'
value_org
= 'S'
tables
value_tab
= t_values
return_tab
= t_return
exceptions
parameter_error = 1
no_values_found = 2
others
= 3.
if sy-subrc = 0.
read table t_return index 1.
o_begru-low = t_return-fieldval.
if o_begru-low = 'PAR*'.
o_begru-option = 'CP'.
else.
o_begru-option = 'EQ'.
endif.
o_begru-sign = 'I'.
append o_begru to s_begru.
else.
o_begru = i_begru.
endif.
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_VALUES Fetch values from a set.
GET_CURRENT_YEAR Get the current fiscal year.
Example:
CALL FUNCTION 'GET_CURRENT_YEAR'
EXPORTING
BUKRS
= '1000'
" Company Code
DATE
= SY-DATUM
" Date to find fiscal year for
IMPORTING
CURRM
= w_currm
" Current Fiscal Month
CURRY
= w_curry
" Current Fiscal Year
PREVM
= w_prevm
" Previous Fiscal Month
PREVY
= w_prevy.
" Previous Fiscal Year
GET_GLOBAL_SYMBOLS Returns a list of all tables, select options, texts, etc for a
program. Even includes the text definitions for the selection screen
GET_INCLUDETAB Returns a list of all INCLUDES in a program
GET_JOB_RUNTIME_INFO Get the current job number from a program. Also returns
other useful info about the current job.
GET_PAYSLIP Returns a fully formatted payslip, ready for displaying
GUI_CREATE_DIRECTORY Create a directory on the presentation server
GUI_DELETE_FILE Replaces WS_FILE_DELETE. Delete a file on the presentation server
GUI_DOWNLOAD Replaces WS_DOWNLOAD. Download table from the app server to
presentation server
GUI_EXEC Replaces WS_EXECUTE. Start a File or Program Asynchronously with
WinExec
GUI_GET_DESKTOP_INFO Replaces WS_QUERY. Delivers Information About the
Desktop (client)
GUI_REMOVE_DIRECTORY Delete a directory on the presentation server
GUI_RUN Start a File or Program Asynchronously with ShellExecute
GUI_UPLOAD Replaces WS_UPLOAD. Upoad file from presentation server to the app
server
HELP_START Display 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_TABLE Show 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.
Example:
tables: t001w.
DATA: lc_werks
LIKE t001w-werks,
ltab_fields LIKE help_value OCCURS 0 with header line,
BEGIN OF ltab_values OCCURS 0,
feld(40) TYPE c,
END OF ltab_values.
*-- Set up fields to retrieve data
ltab_fields-tabname
= 'T001W'.
ltab_fields-fieldname = 'WERKS'.
ltab_fields-selectflag = 'X'.
APPEND ltab_fields.
ltab_fields-tabname
= 'T001W'.
ltab_fields-fieldname = 'NAME1'.
ltab_fields-selectflag = space.
APPEND ltab_fields.
*-- Fill values
select * from t001w.
ltab_values-feld = t001w-werks.
append ltab_values.
ltab_values-feld = t001w-name1.
append ltab_values.
endselect.
CALL FUNCTION 'HELP_VALUES_GET_WITH_TABLE'
EXPORTING
fieldname
= 'WERKS'
tabname
= 'T001W'
title_in_values_list
= 'Select a value'
IMPORTING
select_value
= lc_werks
TABLES
fields
= ltab_fields
valuetab
= ltab_values
EXCEPTIONS
field_not_in_ddic
= 01
more_then_one_selectfield = 02
no_selectfield
= 03.
like
like
like
like
IMPORTING
HOLIDAY_FOUND
tables
holiday_attributes
EXCEPTIONS
CALENDAR_BUFFER_NOT_LOADABLE
DATE_AFTER_RANGE
DATE_BEFORE_RANGE
DATE_INVALID
HOLIDAY_CALENDAR_ID_MISSING
HOLIDAY_CALENDAR_NOT_FOUND
OTHERS
= lc_holiday_found
= ltab_holiday_attributes
=
=
=
=
=
=
=
1
2
3
4
5
6
7.
if sy-subrc = 0 and
lc_holiday_found = 'X'.
write: / ld_date, 'is a holiday'.
else.
write: / ld_date, 'is not a holiday, or there was an error calling the
function'.
endif.
HOLIDAY_GET Provides a table of all the holidays based upon a Factory Calendar &/
Holiday Calendar.
HR_BEN_GET_FROM_FEATURE_BAREA Call the HR feature to determine the Benefit
Area for an employee
HR_BEN_GET_FROM_FEATURE_BENGR Call the HR feature to determine the Benefit
Group for an employee
HR_BEN_GET_FROM_FEATURE_BSTAT Call the HR feature to determine the Benefit
Status for an employee
HR_BEN_GET_FROM_FEATURE_COVGR Call the HR feature to determine the Cover
Group for an employee
HR_BEN_GET_FROM_FEATURE_CSTV1 Call the HR feature to determine the CSTV1
feature for an employee
HR_BEN_GET_FROM_FEATURE_EECGR Call the HR feature to determine the
Employee Cost Group for an employee
HR_BEN_GET_FROM_FEATURE_ELIGR Call the HR feature to determine the
Eligiblity Group for an employee
HR_BEN_GET_FROM_FEATURE_ERCGR Call the HR feature to determine the
Employer Cost Group for an employee
HR_BEN_GET_FROM_FEATURE_EVTGR Evaluate the EVTGR feature for an
employee
HR_BEN_GET_FROM_FEATURE_FLXGR Evaluate the FLXGR feature for an
employee
HR_BEN_GET_FROM_FEATURE_LDAYW Evaluate the LDAYW feature for an
employee
HR_BEN_GET_FROM_FEATURE_LRPGR Evaluate the LRPGR feature for an
employee
HR_BEN_GET_FROM_FEATURE_TRMGR Evaluate the TRMGR feature for an
employee
HR_BEN_GET_FROM_FEATURE_VARGU Evaluate the VARGU feature for an
employee
HR_DISPLAY_BASIC_LIST is 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.
=
=
=
=
'MOD')
'INS')
'DEL')
'COP')
l_bapireturn-id,
l_bapireturn-message+0(40).
ELSE.
WRITE: /
p_pernr,
20 'Create was successful',
l_bapireturn-id,
l_bapireturn-message+0(40).
ENDIF.
* Use 'BAPI_EMPLOYEE_DEQUEUE' to un-lock the employee before updating
CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
EXPORTING
number = l_p0169-pernr
IMPORTING
return = l_bapireturn.
absence
at work
W_PERNR = '00000001'.
CALL FUNCTION 'HR_PAYROLL_PERIODS_GET'
EXPORTING
get_begda
= w_begda
TABLES
get_periods
= it_t549q
EXCEPTIONS
no_period_found = 1
no_valid_permo = 2.
CHECK sy-subrc = 0.
CALL FUNCTION 'HR_TIME_RESULTS_GET'
EXPORTING
get_pernr
= w_pernr
get_pabrj
= it_t549q-pabrj
get_pabrp
= it_t549q-pabrp
TABLES
get_zl
= it_zl
EXCEPTIONS
no_period_specified
= 1
wrong_cluster_version = 2
no_read_authority
= 3
cluster_archived
= 4
technical_error
= 5.
NOTE: it_zl-iftyp = 'A'
it_zl-iftyp = 'S'
absence
at work
PLVAR = '01'
OTYPE = 'P '
MULTI_SELECT = 'X' to allow multiple selection
EASY = 'X' for user-dependent matchcode
Unfortunately, the use of table BASE_OBJIDS is disabled, so you can't
specify
a root for the hierarchy you display
SO_SPOOL_READ Fetch printer spool according to the spool number informed. See also
RSPO_RETURN_ABAP_SPOOLJOB
SO_WIND_SPOOL_LIST Browse printer spool numbers according to user informed.
SPELL_AMOUNT Convert a number to the corresponding words
SWD_HELP_F4_ORG_OBJECT SHR Matchcode tailored for organizational units.
Includes a button so that you can browse the hierarchy too.
SX_OBJECT_CONVERT_OTF_PDF Conversion From OTF to PDF (SAPScript
conversion)
SX_OBJECT_CONVERT_OTF_PRT Conversion From OTF to Printer Format (SAPScript
conversion)
SX_OBJECT_CONVERT_OTF_RAW Conversion From OTF to ASCII (SAPScript
conversion)
SXPG_CALL_SYSTEM you 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_CHECK Check whether the user is authorized to execute the specified
command on the target host system with the specified arguments.
SXPG_COMMAND_DEFINITION_GET Read the definition of a single external OS
command from the R/3 System's database.
SXPG_COMMAND_EXECUTE Check 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_GET Select a list of external OS command definitions.
TERM_CONTROL_EDIT Edit a table of text with a very nice text editor. Just call
TERM_CONTROL_EDIT and supply with the function with a table of text. Table entries are
modified in the editor after clicking "ok".
TERMINAL_ID_GET Return the terminal id
TH_DELETE_USER Logoff a user. Similar results to using SM04.
TH_ENVIRONMENT Get the UNIX environment
TH_POPUP Display a popup system message on a specific users screen.
TH_REMOTE_TRANSACTION Run a transaction on a remote server. Optionally provide
BDC data to be used in the transaction
TH_USER_INFO Give information about the current user (sessions, workstation logged in
from, etc)
TH_USER_LIST Show which users are logged into an app server
TMP_GUI_DIRECTORY_LIST_FILES Retrieve 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.
Example:
data:
lc_directory
lc_filter(20)
li_file_count
li_dir_count
ltab_dir_table
like
type
type
type
like
HR_99S_INTERVAL_BETWEEN_DATES
LAST_DAY_OF_MONTHS
DATE_CHECK_PLAUSIBILITY
DATE_2D_TO_4D_CONVERSION
DAY_IN_WEEK
SD_DATETIME_DIFFERENCE
date/time
Difference between two dates in days,
weeks, months
Returns the last day of the month
Check for the invalid date.
Year entry: 2-character to 4-character.
Input date and will give the name of the
day 1-monday,2-Tuesday....
Give the difference in Days and Time for 2
dates