在用户设计sap的程序时,经常需要一些对话框,用户可以自己编写,但使用SAP系统中提供了的对话框函数将减少许多开发工作。
1、sap的函数组列表和用途说明
适用情况 | Function group |
提示用户将可能丢失数据 | SPO1 |
提示用户对某个问题选择Yes或者No | SPO1 |
提示用户将可能丢失数据, 并询问用户是否继续操作 | SPO1 |
提示用户在多个操作中选择一个操作 | SPO2 |
提示用户是继续当前操作或者取消当前操作 | SPO2 |
提示用户输入数据 (可以根据一个表检查或者不检查输入值) | SPO4 |
将数据显示给用户 | SPO4 |
将详细数据显示给用户 | SPO6 |
从列表中选择数据 | SP05 |
用可滚动的对话框显示数据给用户 | STAB |
从视图或者数据表中打印数据 | STPR |
2、函数列表和说明
2.1 SPO1的函数
- POPUP_TO_CONFIRM_STEP
用此函数可以建立一个对话框用于询问用户是否执行某步操作,用户可以选择Yes No或者Cancel。该函数可以传入一个标题和两行的文本(提示问题)。系统在窗口上显示一个绿色问号图标。
可以设置某个按钮作为默认按钮。
CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
EXPORTING TITEL = '确认提示测试'
TEXTLINE1 = '确实要执行'
TEXTLINE2 = '测试?'
CANCEL_DISPLAY = SPACE "不显示CANCEL按钮
IMPORTING ANSWER = ANSWER.
- POPUP_TO_CONFIRM_WITH_MESSAGE
类似POPUP_TO_CONFIRM_STEP,只是多三行的文本错误诊断提示。 系统在窗口上显示一个绿色问号图标。
call function 'POPUP_TO_CONFIRM_WITH_MESSAGE'
exporting titel = '确认提示测试'
textline1 = '确实要执行 ;;'
textline2 = spop-textline2
diagnosetext1 = spop-diagnose1
diagnosetext2 = spop-diagnose2
diagnosetext3 = spop-diagnose3
importing answer = answer.
- POPUP_TO_CONFIRM_WITH_VALUE
用此函数可以建立一个对话框用于询问用户是否执行某步操作,该操作可能会丢失数据,用户可以选择Yes No或者Cancel。该函数可以传入一个标题,两行的文本(提示问题)和一个对象值(对象值将会插入在提示问题文本的两部分之间)。系统在窗口上显示一个绿色问号图标。
可以设置某个按钮作为默认按钮。
CALL FUNCTION 'POPUP_TO_CONFIRM_WITH_VALUE'
EXPORTING TITEL = TITEL
TEXT_BEFORE = '确实要执行'
OBJECTVALUE = 'TEST'
TEXT_AFTER = '?'
IMPORTING ANSWER = ANSWER. - POPUP_TO_CONFIRM_LOSS_OF_DATA
用此函数可以建立一个对话框用于询问用户是否执行某步操作,该操作可能会丢失数据,用户可以选择Yes No或者Cancel。该函数可以传入一个标题和一个两行的文本(提示问题)。 系统在窗口上显示一个黄色!图标和一行“数据将丢失。”。
可以设置某个按钮作为默认按钮。
CALL FUNCTION 'POPUP_TO_CONFIRM_LOSS_OF_DATA'
EXPORTING TITEL = TITEL
TEXTLINE1 = SPOP-TEXTLINE1
TEXTLINE2 = SPOP-TEXTLINE2
IMPORTING ANSWER = ANSWER.
- POPUP_TO_CONFIRM
该函数是POPUP函数的增强版,可以自定义按钮文本和图标。
2.2、Function group SPO2
- POPUP_TO_DECIDE
显示一个对话框,用户可以两个操作中的一个或者取消。可以传入三行提示文本。
- POPUP_TO_DECIDE_WITH_MESSAGE
类同POPUP_TO_DECIDE,程序员可以多传入With this function module you create a dialog box in which you inform the user about a specific decision point via a diagnosis text, during an action. He or she can choose one of two alternative actions offered or cancel the action.
The action, the diagnosis text, the question and the alternative actions are passed as parameters.
The user action (Alternative 1, Alternative 2, or Cancel) is returned in a parameter.
2.3、Function group SPO4
- POPUP_GET_VALUES
This function module sends a dialog box for data display and input.
The input fields are passed in a structure and must be defined in the Dictionary. You can also specify individual field display attributes and a field text, if the key word from the Dictionary is not to be displayed as field text in the dialog box, in the structure.
The standard help functionality (F1, F4) is supported.
- POPUP_GET_VALUES_DB_CHECKED
This function module sends a dialog box for data to be input und checked against the database.
The input fields are passed in a structure and must be defined in the Dictionary. You can also specify individual field display attributes and a field text in the structure, if the key word from the Dictionary is not to be displayed as field text in the dialog box.
A comparison operator for checking the input data in the database is passed. You can specify whether the check is for the existence or absence of an object. A foreign key relationship check is supported.
The standard help functionality (F1, F4) is supported.
The user action is returned in a parameter.
- POPUP_GET_VALUES_USER_CHECKED
This function module sends a dialog box for data to be input and checked in an external sub-routine (user exit). The input fields are passed in a structure and must be defined in the dictionary. You can also specify individual field display attributes and a field text in the structure, if the key word from the Dictionary is not to be displayed as field text in the dialog box.
The Data input by the user in the dialog box are passed to the sub-routine specified in the interface for checking. Errors found by the check are entered in an error structure and are evaluated on return from the sub-routine by the function module.
The standard help functionality (F1, F4) is supported.
The user action (Continue or Cancel) is returned in a parameter.
- POPUP_GET_VALUES_USER_HELP
This function module sends a dialog box for data to be input with the possibility of a check in an external sub-routine (user exit) and branching in a user F1 or F4 help.
The input fields are passed in a structure and must be defined in the Dictionary. You can also specify individual field display attributes and a field text in the structure, if the key word from the Dictionary is not to be displayed as field text in the dialog box.
You can pass the data which are entered by the user in a dialog box to a sub-routine which must be specified in the interface for checking. Errors occurring in the check are stored in an error structure and are analyzed by the function module upon return from the sub-routine. The data, and an error message, if appropriate, are displayed again.
The standard help functionality (F1, F4) is supported.
User exits for a user F1 or F4 help can also be specified.
The user action (Continue or Cancel) is returned in a parameter.
- POPUP_GET_VALUES_USER_BUTTONS
This function module is like the previous function module POPUP_GET_VALUES_USER_HELP, with the additional possibility of passing one or two additional pushbuttons and a standard pushbutton, which the user can name.
- POPUP_GET_VALUES_SET_MAX_FIELD
With this function module you can specify the maximum number of fields which can be displayed in dialog boxes for this function group (SPO4). The specified value is stored in the function group local memory and applies for the rest of the application. Dialog boxes which display more then this number of fields are displayed with a scroll bar.
2.4、Function group SPO6
- POPUP_DISPLAY_TEXT
With this function module you display a text which exists in the system in a dialog box.
- POPUP_DISPLAY_TEXT_WITH_PARAMS
With this function module you display a text which exists in the system with parameters in a dialog box. The parameter values are passed in a table. The use of numbered texts is recommended, to make the parameter values translatable.
The parameter names must be passed in upper-case letters.
2.5、Function group SPO5
- POPUP_TO_DECIDE_LIST
从列表中选择数据,样例程序
report rsspo500.
data: selectlist like spopli occurs 5 with header line.
data: antwort type c.
while antwort ne 2.
clear selectlist.
refresh selectlist.
selectlist-varoption = 显示含有单选按钮的弹出框'.
append selectlist.
selectlist-varoption = '显示含有复选框的弹出框'.
selectlist-selflag = 'X'.
append selectlist.
call function 'POPUP_TO_DECIDE_LIST'
exporting
* CURSORLINE = 1
* MARK_FLAG = ' '
mark_max = 1
start_col = 10
start_row = 10
textline1 = 'Text1'
textline2 = 'POPUP_TO_DECIDE_LIST'
textline3 = 'TEXT3'
titel = 'TITLE '
importing
answer = antwort
tables
t_spopli = selectlist
exceptions
not_enough_answers = 1
too_much_answers = 2
too_much_marks = 3
others = 4.
if antwort eq 'A'.
exit.
endif.
endwhile.
if antwort ne 'A'.
clear selectlist.
refresh selectlist.
selectlist-varoption = '最多 15 个选项'.
selectlist-selflag = 'X'.
append selectlist.
selectlist-varoption = '含有复选框'.
selectlist-selflag = 'X'.
append selectlist.
selectlist-varoption = '或单选按钮'.
selectlist-selflag = 'X'.
append selectlist.
selectlist-varoption = '典型的列表功能:'.
selectlist-selflag = 'X'.
append selectlist.
selectlist-varoption = '* 选择'.
selectlist-selflag = 'X'.
append selectlist.
selectlist-varoption = '* 选择全部'.
selectlist-selflag = 'X'.
append selectlist.
selectlist-varoption = ' 取消全部选择'.
selectlist-selflag = 'X'.
append selectlist.
selectlist-varoption = '3 70字符/选项'.
selectlist-selflag = 'X'.
append selectlist.
selectlist-varoption = '65 字符/选项'.
selectlist-selflag = 'X'.
append selectlist.
selectlist-varoption = '激活/不激活可选行'.
selectlist-selflag = 'X'.
selectlist-inactive = 'X'.
append selectlist.
* 2. Aufruf **********************************************************
call function 'POPUP_TO_DECIDE_LIST'
exporting
* CURSORLINE = 1
mark_flag = 'X'
mark_max = 0
start_col = 15
start_row = 15
textline1 = 'Das POPUP bietet'(c01)
textline2 = 'folgende Funktionalit鋞:'(c02)
titel = 'Das Beispiel 2'(b02)
importing
answer = antwort
tables
t_spopli = selectlist
exceptions
not_enough_answers = 1
too_much_answers = 2
too_much_marks = 3
others = 4.
endif.
分享到:
相关推荐
8. POPUP_TO_CONFIRM和POPUP_TO_DECIDE_LIST:这两个函数分别用于弹出确认对话框和提供多个选项让用户选择,它们增强了用户交互体验。 9. CONVERSION_EXIT_MATN1_INPUT和CONVERSION_EXIT_MATN1_OUTPUT:这两个函数...
2. **FUNC03(呼叫open dialog的方式)**: 这个函数涉及到了SAP GUI的交互,可能用于打开对话框让用户输入信息或选择文件。在ABAP中,可以使用OPEN_DIALOG或CALL TRANSACTION并配合参数来实现这样的功能,这对于用户...
标准对话框由 SAP 提供一系列预定义的界面元素,而自定义对话框则允许开发者根据实际业务需求创建个性化的界面。 - **界面元素**:常见的界面元素包括输入框、选择框、按钮、列表框等,每种元素都有其特定的功能和...
BAPI_REQUISITION_CREATE是一个用于创建采购申请的标准SAP业务函数模块。通过将这个函数添加到代理类,我们可以在VB.NET代码中直接调用它,从而实现采购申请的创建。 在VB.NET的代码中,我们可以创建一个SAPProxy1...
2. `sapnco_utils.dll`:这是一个辅助库,包含了一些实用工具函数,比如用于处理SAP的IDoc(Intermediate Document)数据格式。 在压缩包内,有两个子压缩包——"X86.rar"和"X64.rar",分别对应于32位和64位的.NET...
学会正确使用数据库访问是开发事务代码的基础。 5. **程序结构**: ABAP程序由模块池(包括REPORT、FUNCTION GROUP)和增强(Enhancement)组成。REPORT用于生成报表,FUNCTION GROUP则封装功能模块。学习如何组织...
1. **数据库交互**:使用SQL指令进行数据的读取和修改,是对话框模块的核心功能。 2. **非独立程序**:对话框不是独立运行的程序,而是通过事务代码触发,嵌入到更大的业务流程中。 3. **流程逻辑控制**:PBO和PAI...
总结起来,通过正确使用ABAP的Function模块和适当的回调处理,我们可以创建具有弹出窗口形式的ALV,以灵活地展示和操作业务数据。这不仅提高了用户体验,还使得SAP系统的报表功能更加强大和易用。
ABAP(Advanced Business Application Programming)是SAP公司的编程语言,用于开发...以上函数是ABAP开发中常用的一些工具,掌握了这些函数,开发者能更高效地处理各种业务场景,编写出更加健壮和功能丰富的SAP应用。
2. **EDIT_LINES**: 此函数主要用于处理由`READ_TEXT`函数返回的长文本(LINES),它按照TDFORMAT='*'的标准格式重新组织文本。这在需要对长文本进行格式化或调整显示方式时非常有用。 3. **VIEW_MAINTENANCE_CALL*...
### ABAP常用函数详解 #### 1. RS_VARIANT_VALUES_TECH_DATA 此函数主要用于返回一个内部表,其中包含了PARAMETER SELECT-...掌握这些函数的使用方法,可以帮助开发者更高效地完成任务,提高应用程序的质量和性能。
在ABAP编程中,函数模块扮演着至关重要的角色,它们是SAP系统中的可重用代码块,用于执行特定任务。以下是一些在ABAP开发中常用的函数模块及其功能的详细解释: 1. SD_VBAP_READ_WITH_VBELN:这个函数模块用于根据...
2. **EDIT_LINES**: 此函数与READ_TEXT一起使用,用于重新组织由READ_TEXT函数读取的长文本,通常用于处理屏幕或报表中的文本布局。 3. **DY_GET_FOCUS**: 获取当前屏幕焦点所在的字段,这对于实现用户界面交互和...
此函数用于在用户输入字段时显示检索帮助对话框,通常用于查找和选择列表中的特定条目。例如,在输入供应商名称时,可以调用此函数显示一个包含所有供应商的列表,用户从中选择,提高数据输入的准确性和效率。 ####...
- 将之前定义的函数模块从服务器资源管理器中拖拽至SAPProxy中,确保Java SDK已正确安装。 - 加载完成后可以看到函数模块的关键信息,编译项目生成`.dll`文件。 #### 四、在Visual Studio 2008中调用接口程序 ####...
描述:本教材作为SAP的优秀入门指南,特别适合初学者掌握ABAP编程基础,全面涵盖ABAP/4(Advanced Business Application Programming)的介绍、基本语言概览、报告概述、对话框概述以及编程起步等内容。 ### ABAP/4...
4. **输出数据到屏幕**:使用WRITE语句将数据输出到标准输出设备。 5. **赋值**:通过MOVE语句完成变量之间的赋值操作。 6. **运算符及函数**:支持算术运算符、比较运算符以及内置函数。 7. **日期与时间运算**:...
包括使用ABAP开发工具编写简单的报表、创建和应用TABLES、设计和使用选择屏幕、处理事件、实现权限检查、创建和使用消息系统、运用功能模块、上传和下载数据、进行对话框编程、设计FORMS、以及利用BATCH INPUT、BAPI...
由于提供的部分内容似乎包含了一些非标准字符或者乱码,我们无法直接从中获取更多信息。因此,本篇将主要围绕标题、描述以及标签中提到的关键信息——即“SAP包创建”来进行详细阐述。 ### SAP包创建概述 在SAP...
PB 11.5,全称PowerBuilder 11.5,是一款由Sybase公司(现为SAP公司的一部分)开发的面向对象的可视化数据库应用程序开发工具。它以其强大的数据窗口功能、图形用户界面(GUI)设计以及易用性而闻名。在"PB 11.5 双...