ABAP开发常用函数汇总

ABAP_DOCU_DOWNLOAD
下载HTML格式的ABAP文档。

APPL_LOG_DELETE
通过该功能模块,您可以根据指定的选择条件删除数据库中的日志

APPL_LOG_DISPLAY
通过该功能模块,可以对数据库中的日志进行分析。

APPL_LOG_DISPLAY_INTERN
使用此功能模块,您可以在本地内存中分析日志,例如,当您仅在运行时收集日志记录并且不想写入数据库时。

APPL_LOG_INIT
该功能模块检查指定的对象或子对象是否存在,并删除本地内存中所有存在的关联数据

APPL_LOG_READ_DB
使用此功能模块,您可以根据指定的选择条件从数据库中读取对象或子对象的日志数据。

APPL_LOG_READ_INTERN
使用此功能模块,您可以从本地内存中读取指定对象或子对象的日志类至少具有指定值的所有日志数据。

APPL_LOG_SET_OBJECT
使用此函数模块,您可以创建一个新对象或子对象,以便在本地内存中进行写入。通过一个标志,您可以控制APPL_LOG_WRITE_…消息是写入本地内存还是输出到屏幕上。

APPL_LOG_WRITE_DB
使用此函数模块,您可以将本地内存中指定对象或子对象的所有数据写入数据库。如果所讨论的对象或子对象的日志是新的,则将日志号返回给调用程序。

APPL_LOG_WRITE_HEADER
使用这个功能模块,您可以将日志头数据写入本地内存。

APPL_LOG_WRITE_LOG_PARAMETERS
使用此功能模块,您可以在本地内存中为指定对象或子对象写入日志参数的名称和相关值。如果为同一对象或子对象重复调用此函数模块,则会相应地更新现有参数。如果没有使用调用指定对象或子对象,则假定最近使用的对象。

APPL_LOG_WRITE_MESSAGE_PARAMS
使用此函数模块,您可以在本地内存中编写带有参数的单个消息。否则,函数模块就像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_ENQUEUE
Lock 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_PREPARE
Prepare save

BAL_DB_SEARCH
Find logs in the database

BAL_DSP_LOG_DISPLAY
Display messages in memory

BAL_DSP_LOG_DISPLAY
Display Log

BAL_DSP_LOG_PARAMETERS
Either output extended long text or call a callback routine (based on the data in BAL_S_LOG-PARAMS)

BAL_DSP_LOG_TECHNICAL_DATA
Output all log header data

BAL_DSP_MSG_LONGTEXT
Display message long text

BAL_DSP_MSG_PARAMETERS
Either output extended long text or call a callback routine (based on the data in BAL_S_MSG-PARAMS)

BAL_DSP_MSG_TECHNICAL_DATA
Output technical data of a message such as work area, error number, etc.

BAL_DSP_OUTPUT_FREE
End output

BAL_DSP_OUTPUT_INIT
Initialize output

BAL_DSP_OUTPUT_SET_DATA
Set dataset to be displayed

BAL_DSP_PROFILE_DETLEVEL_GET
Message hierarchy in DETLEVEL

BAL_DSP_PROFILE_NO_TREE_GET
Display without tree (fullscreen)

BAL_DSP_PROFILE_POPUP_GET
Display without tree (popup)

BAL_DSP_PROFILE_SINGLE_LOG_GET
Standard profile (SLG1) for one log

BAL_DSP_PROFILE_STANDARD_GET
Standard profile (SLG1) for a lot of logs

BAL_GLB_AUTHORIZATION_GET
Assign authorization

BAL_GLB_AUTHORIZATION_RESET
Reset authorization

BAL_GLB_CONFIG_GET
Read configuration

BAL_GLB_CONFIG_SET
Set configuration

BAL_GLB_MEMORY_EXPORT
Put function group memory in ABAP-MEMORY

BAL_GLB_MEMORY_IMPORT
Get 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_GET
Get current message handle

BAL_GLB_MSG_DEFAULTS_GET
Get message defaults

BAL_GLB_SEARCH_LOG
Find logs in memory

BAL_GLB_SEARCH_MSG
Find messages in memory

BAL_LOG_CREATE
Create log with header data

BAL_LOG_CREATE
Create log with header data

BAL_LOG_DELETE
Delete log (from database also at Save)

BAL_LOG_EXIST
Check existence of a log in memory

BAL_LOG_HDR_CHANGE
Change log header

BAL_LOG_HDR_CHECK
Check log header data for consistency

BAL_LOG_HDR_READ
Read log header and other data

BAL_LOG_MSG_ADD
Put message in log

BAL_LOG_MSG_ADD
Put message in log

BAL_LOG_MSG_CHANGE
Change message

BAL_LOG_MSG_CHANGE
Change message

BAL_LOG_MSG_CHECK
Check message data for consistency

BAL_LOG_MSG_CUMULATE
Add message cumulated

BAL_LOG_MSG_DELETE
Delete message

BAL_LOG_MSG_DELETE
Delete message

BAL_LOG_MSG_EXIST
Check existence of a message in memory

BAL_LOG_MSG_READ
Read message and other data

BAL_LOG_MSG_REPLACE
Replace last message

BAL_LOG_REFRESH
Delete log from memory

BAL_LOG_REFRESH
Delete log from memory

BAL_MSG_DISPLAY_ABAP
Output message as ABAP-MESSAGE

BAL_OBJECT_SELECT
Read Application Log objects table record

BAL_OBJECT_SUBOBJECT
Check whether object and subobject exist and the combination is allowed

BAL_SUBOBJECT_SELECT
Read subobject table record

BP_EVENT_RAISE
Trigger an event from ABAP/4 program

BP_JOBLOG_READ
Fetch job log executions

CHANGEDOCUMENT_READ_HEADERS
Get the change document header for a sales document, and put the results in an internal table.

Example:

      CALL FUNCTION ‘CHANGEDOCUMENT_READ_HEADERS’

           EXPORTING

                objectclass = ‘EINKBELEG’

                objectid    = l_objectid

                username    = space

           TABLES

                i_cdhdr     = lt_cdhdr.

      LOOP AT lt_cdhdr WHERE udate IN s_aedat.

        CALL FUNCTION ‘CHANGEDOCUMENT_READ_POSITIONS’

             EXPORTING

                  changenumber = lt_cdhdr-changenr

             TABLES

                  editpos      = lt_editpos.

        LOOP AT lt_editpos WHERE fname = ‘LOEKZ’

                           AND   f_new = ‘L’.

          p_desc = text-r01. ” Cancel Contract

        ENDLOOP.

      ENDLOOP.

               

CHANGEDOCUMENT_READ_POSITIONS
Get 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.

Example:

      CALL FUNCTION ‘CHANGEDOCUMENT_READ_HEADERS’

           EXPORTING

                objectclass = ‘EINKBELEG’

                objectid    = l_objectid

                username    = space

           TABLES

                i_cdhdr     = lt_cdhdr.

      LOOP AT lt_cdhdr WHERE udate IN s_aedat.

        CALL FUNCTION ‘CHANGEDOCUMENT_READ_POSITIONS’

             EXPORTING

                  changenumber = lt_cdhdr-changenr

             TABLES

                  editpos      = lt_editpos.

        LOOP AT lt_editpos WHERE fname = ‘LOEKZ’

                           AND   f_new = ‘L’.

          p_desc = text-r01. ” Cancel Contract

        ENDLOOP.

      ENDLOOP.

               

CLAF_CLASSIFICATION_OF_OBJECTS
Return all of the characteristics for a material

CLOI_PUT_SIGN_IN_FRONT
Move 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_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

CONVERSION_EXIT_ALPHA_OUTPUT
converts any number with zeroes right into a simple integer

Example:

input   = 00000000000123

output  = 123

CONVERT_ABAPSPOOLJOB_2_PDF
convert abap spool output to PDF

CONVERT_OTF

Convert SAP documents (SAPScript) to other types.

Example:

CALL FUNCTION “CONVERT_OTF”

       EXPORTING    FORMAT                = “PDF”

       IMPORTING    BIN_FILESIZE          = FILE_LEN

       TABLES       OTF                   = OTFDATA

                    LINES                 = PDFDATA

       EXCEPTIONS   ERR_MAX_LINEWIDTH     = 1                  

                    ERR_FORMAT            = 2

                    ERR_CONV_NOT_POSSIBLE = 3

                    OTHERS                = 4.

CONVERT_OTFSPOOLJOB_2_PDF
converts a OTF spool to PDF (i.e. Sapscript document)

CONVERT_TO_FOREIGN_CURRENCY
Convert local currency to foreign currency.

CONVERT_TO_LOCAL_CURRENCY
Convert from foreign currency to local currency

DATE_CHECK_PLAUSIBILITY
Check 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_DAY
Returns a number indicating what day of the week the date falls on. Monday is returned as a 1, Tuesday as 2, etc.

DATE_GET_WEEK
will return the week that a date is in.

DATE_IN_FUTURE
Calculate a date N days in the future.

DAY_ATTRIBUTES_GET
Return 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)

DOWNLOAD
download a file to the presentation server (PC)

DYNP_VALUES_READ
Read 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_UPDATE
Similar 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_SLEEP
Wait a specified period of time before continuing processing.

ENQUEUE_ESFUNCTION
Lock an abap program so that it cannot be executed.

Example:

Set the parameters as follows:

  RELID = ‘ZZ’

  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.

                   

F4IF_SHLP_EXIT_EXAMPLE

documents the different reasons to use a search help exit, and shows how it is done.

F4IP_INT_TABLE_VALUE_REQUEST
此函数在4.6及以上版本中不存在。使用F4IF_INT_TABLE_VALUE_REQUEST代替。

FILENAME_GET

popup to get a filename from a user, returns blank filename if user selects cancel

FORMAT_MESSAGE
获取消息id和号码,并将其放入一个变量中。比WRITE_MESSAGE工作得更好,因为一些消息使用$作为占位符,而WRITE_MESSAGE不支持这一点,它只替换消息中的&符号。

FTP_COMMAND
在FTP服务器上执行命令

FTP_CONNECT
打开连接(并登录)到FTP服务器

FTP_DISCONNECT
关闭连接(并注销)FTP服务器

FU CSAP_MAT_BOM_READ
您可以使用此功能模块显示简单的物料bom。不能显示BOM组(例如,一个变体BOM的所有变体)。如事务CS03。当前限制:不能显示长文本。不能显示子项。不能批量显示BOM分类数据。您只能显示一个替代或变体。您不能为模块CSAP_MAT_BOM_READ输入替代选项,因此您总是看到替代选项01。下面的例子来自SAP-R3-L邮件列表上的帖子。

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

ᝰ随心ꦿེএ

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值