ABAP Functions

TEXT Function

SAVE_TEXT – To load long text into SAP

READ_TEXT – To load long text into SAP

SAVE_TEXT – To load long text into SAP

COMMIT_TEXT – To load long text into SAP

INIT_TEXT – To load long text into SAP

LIST_TO_ASCII – convert an ABAP report (displayed on screen) from OTF to ASCII format

READ_TEXT – To load long text into SAP

SAP has many build in functions that displays pop-up dialog screens.

 

POPUP Screens

POPUP_TO_CONFIRM_STEP – Create a dialog box in which you make a question whether the user wishes to perform the step.

POPUP_TO_CONFIRM_WITH_MESSAGE – Create a dialog box in which you inform the user about a specific decision point during an action.

POPUP_TO_CONFIRM_WITH_VALUE – Create a dialog box in which you make a question whether the user wishes to perform a processing step with a particular object.

POPUP_TO_DECIDE – Provide user with several choices as radio buttons

POPUP_TO_DECIDE_WITH_MESSAGE – Create a dialog box in which you inform the user about a specific decision point via a diagnosis text.

POPUP_TO_DISPLAY_TEXT – Create a dialog box in which you display a two-line message.

POPUP_TO_SELECT_MONTH – Popup to choose a month

POPUP_WITH_TABLE_DISPLAY – Provide a display of a table for user to select one, with the value of the table line returned when selected.

POPUP_TO_CONFIRM – Pop-up dialog confirm an action before it is carried out.

POPUP_TO_DISPLAY_TEXT –    Displays a text in a modal screen

POPUP_TO_INFORM – Displays several lines of text. No OK or Cancel buttons.

POPUP_TO_CONFIRM/POPUP_TO_DISPLAY_TEXT.

TH_POPUP – Display a popup system message on a specific users screen.

POPUP_TO_CONFIRM_LOSS_OF_DATA – Create 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_STEP – Create a dialog box in which you make a question whether the user wishes to perform the step.

POPUP_TO_CONFIRM_WITH_MESSAGE – Create a dialog box in which you inform the user about a specific decision point during an action.

POPUP_TO_CONFIRM_WITH_VALUE – Create a dialog box in which you make a question whether the user wishes to perform a processing step with a particular object.

POPUP_TO_DECIDE – Provide user with several choices as radio buttons

POPUP_TO_DECIDE_WITH_MESSAGE – Create a dialog box in which you inform the user about a specific decision point via a diagnosis text.

POPUP_TO_DISPLAY_TEXT – Create a dialog box in which you display a two-line message.

POPUP_WITH_TABLE_DISPLAY – Provide a display of a table for user to select one, with the value of the table line returned when selected.

POPUP_TO_CONFIRM_LOSS_OF_DATA – Create 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_STEP – Create a dialog box in which you make a question whether the user wishes to perform the step.

POPUP_TO_CONFIRM_WITH_MESSAGE – Create a dialog box in which you inform the user about a specific decision point during an action.

POPUP_TO_CONFIRM_WITH_VALUE – Create a dialog box in which you make a question whether the user wishes to perform a processing step with a particular object.

POPUP_TO_DECIDE – Provide user with several choices as radio buttons

POPUP_TO_DECIDE_WITH_MESSAGE – Create a dialog box in which you inform the user about a specific decision point via a diagnosis text.

POPUP_TO_DISPLAY_TEXT – Create a dialog box in which you display a two-line message.

POPUP_WITH_TABLE_DISPLAY – Provide a display of a table for user to select one, with the value of the table line returned when selected.

Below are an example of the use of POPUP_TO_CONFIRM:

data returncode(1) type c.

call function ‘POPUP_TO_CONFIRM’

exporting

titlebar              = ‘Delete selected lines’

text_question  = ‘Are you sure you want to delete ?’

text_button_1 = ‘OK’

icon_button_1 = ‘ICON_OKAY’

text_button_2 = ‘Cancel’

icon_button_2 = ‘ICON_CANCEL’

default_button         = ‘2’

display_cancel_button  = ”

importing

answer                = returkode.

 

* Test the returnkode. If the first button is pushed the returncode is 1 and if the second

* button is pushed the returncode is 2

if  returncode = 1.

perform delete.

endif.

 

Some of the functions copied from ABAP hints & Tips at

http://oasis.fortunecity.com/skegness/110/functions.html

RH_START_EXCEL_WITH_DATA -starts Excel with the contents of an internal table.

RH_STRUC_GET – Returns all related org info

RP_CALC_DATE_IN_INTERVAL – Add/subtract years/months/days from a date

RP_LAST_DAY_OF_MONTHS – Determine last day of month

RS_REFRESH_FROM_SELECTOPTIONS – Get the current contents of selection screen

RS_VARIANT_CONTENTS – Returns the contents of the specified variant in a table.

RZL_SLEEP – Hang the current application from 1 to 5 seconds.

RZL_SUBMIT – Submit a remote report.

RZL_READ_DIR_LOCAL – Read a directory on the Application Server

RZL_READ_DIR – If 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_FILE – Read 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_WRITE_FILE_LOCAL – Saves table to the presentation server (not PC). Does not use OPEN DATASET, so it does not suffer from authority hecks!

SAPGUI_PROGRESS_INDICATOR – Display a progress bar on the SAP GUI, and give the user some idea of what is happening

SCROLLING_IN_TABLE -If 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_DIFFERENCE – Give the difference in Days and Time for 2 dates

SO_NEW_DOCUMENT_ATT_SEND_API1 – Send a document as part of an email. The documentation is better than normal for this function, so please read it.

SO_SPOOL_READ – Fetch printer spool according to the spool number informed.

SO_SPOOL_READ – SAPoffice: Read a Spool Entry

SO_WIND_SPOOL_LIST – Browse printer spool numbers according to user informed.

TERMINAL_ID_GET – Return the terminal id

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

UNIT_CONVERSION_SIMPLE – convert weights from one UOM to another.

UPLOAD – upload a file to the presentation server (PC)

WRITE_LIST – Useful for writing out the list contents that result from the function LIST_FROM_MEMORY.

WS_DOWNLOAD – Save Internal Table as File on the Presentation Server

WS_EXCEL – Start EXCEL on the PC

WS_EXECUTE – execute a program on a windows PC

WS_FILE_DELETE – Delete File at the Frontend

WS_FILENAME_GET – Call File Selector

WS_MSG – Create a dialog box in which you display an one-line message.

WS_UPLOAD – Load Files from the Presentation Server to Internal ABAP Tables

WS_VOLUME_GET – Get the label from a frontend device.

WWW_LIST_TO_HTML – After running a report, call this function to convert the list output to HTML.

 

Other Function

BP_EVENT_RAISE – Trigger an event from ABAP/4 program.

BP_JOBLOG_READ – Fetch job log executions.

COMMIT_TEXT – To load long text into SAP

DOWNLOAD – download a file to the presentation server (PC)

DYNP_VALUES_READ – Read the values from a dynpro.  This funciton can be used to read the values from a report’s selection screen too.

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.

EPS_GET_DIRECTORY_LISTING – return a list of filenames from a local or network drive

F4_DATE – displays a calendar in a popup window and allows user to choose a date, or it can be displayed read only.

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

FTP_CONNECT – Open a connection (and log in) to an FTP server

FTP_COMMAND – Execute a command on the FTP server

FTP_DISCONNECT – Close the connection (and log off) the FTP server

– Takes 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.

G_SET_GET_ALL_VALUES – Fetch values from a set.

HOLIDAY_GET – Provides a table of all the holidays based upon a Factory Calendar &/ Holiday Calendar.

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.

INIT_TEXT – To load long text into SAP

LIST_TO_ASCII – convert an ABAP report (displayed on screen) from OTF to ASCII format

LIST_FROM_MEMORY – Retrieves the output of a report from memory when the report was executed using SUBMIT… EXPORTING LIST TO MEMORY.  See also WRITE_LIST.

MONTH_NAMES_GET – It returns all the month and names in repective language.

MS_EXCEL_OLE_STANDARD_OLE – will build a file, and automatically start Excel

SCROLLING_IN_TABLE -If 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_DIFFERENCE – Give the difference in Days and Time for 2 dates

SO_SPOOL_READ – Fetch printer spool according to the spool number informed.

SO_SPOOL_READ – SAPoffice: Read a Spool Entry

SO_WIND_SPOOL_LIST – Browse printer spool numbers according to user informed.

UNIT_CONVERSION_SIMPLE – convert weights from one UOM to another.

UPLOAD – upload a file to the presentation server (PC)

WS_DOWNLOAD – Save Internal Table as File on the Presentation Server

WS_EXCEL – Start EXCEL on the PC

WS_EXECUTE – execute a program on a windows PC

WS_FILE_DELETE – Delete File at the Frontend

WS_FILENAME_GET – Call File Selector

WS_MSG – Create a dialog box in which you display an one-line message.

WS_UPLOAD – Load Files from the Presentation Server to Internal ABAP Tables

WS_VOLUME_GET – Get the label from a frontend device.

WWW_LIST_TO_HTML – After running a report, call this function to convert the list output to HTML.

RH_START_EXCEL_WITH_DATA -starts Excel with the contents of an internal table.

RS_REFRESH_FROM_SELECTOPTIONS – Get the current contents of selection screen

RZL_SLEEP – Hang the current application from 1 to 5 seconds.

RZL_SUBMIT – Submit a remote report.

RZL_READ_DIR_LOCAL – Read a directory on the Application Server

MONTH_NAMES_GET – It returns all the month and names in repective language.

MS_EXCEL_OLE_STANDARD_OLE – will build a file, and automatically start Excel

DOWNLOAD – download a file to the presentation server (PC)

EPS_GET_DIRECTORY_LISTING – return a list of filenames from a local or network drive

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

G_SET_GET_ALL_VALUES – Fetch values from a set.

HOLIDAY_GET – Provides a table of all the holidays based upon a Factory Calendar &/ Holiday Calendar.

BP_EVENT_RAISE – Trigger an event from ABAP/4 program.

BP_JOBLOG_READ – Fetch job log executions.

本文作者: GavinDong

版权属于: GavinDong博客

文章链接: https://gavindong.com/319.html

如果使用过程中遇到问题,可 **点击此处** 交流沟通。

版权所有,转载时必须以链接形式注明作者和原始出处及本声明。

(0)

相关文章

发表回复

登录后才能评论