在用户设计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.

【转载】SAP的标准对话框函数的更多相关文章

  1. 如何修改Qt标准对话框的文字(例如,英文改成中文)

    此篇文章参考qtcn论坛整理而成,因为文字和图片是本人亲自组织,所以仍算原创. http://www.qtcn.org/bbs/read-htm-tid-30650.html http://blog. ...

  2. 标准C函数库的使用方法

    本篇介绍若干经常使用的标准C函数的使用方法,主要介绍stdio(标准输入输出).math(数字函数库).time(时间函数库).stdlib(标准函数库)string(标准字符串函数)等. 最后更新  ...

  3. 转载-Oracle ORACLE的sign函数和DECODE函数

    原文地址:http://www.cnblogs.com/BetterWF/archive/2012/06/12/2545829.html 转载以备用 比较大小函数 sign 函数语法:sign(n) ...

  4. 转载]SAP囚徒 - 通过销售订单领用到成本中心,FI替代

    转载]SAP囚徒 - 通过销售订单领用到成本中心,FI替代   原文地址:SAP囚徒 - 通过销售订单领用到成本中心,FI替代实现不同成本中心记账科目不同作者:SAP囚徒 物品领用通常是库存管理的范畴 ...

  5. Qt中的标准对话框之QMessageBox

    1. Qt标准对话框 Qt为开发者提供了一些可复用的对话框类型 Qt提供的可复用对话框全部继承自QDialog类 Qt中的对话框的使用方式和QDialog完全一致 2. 标准对话框的使用步骤 ①定义对 ...

  6. Qt 学习之路 2(15):标准对话框 QMessageBox

    Qt 学习之路 2(15):标准对话框 QMessageBox  豆子  2012年9月18日  Qt 学习之路 2  40条评论 所谓标准对话框,是 Qt 内置的一系列对话框,用于简化开发.事实上, ...

  7. 《转》PyQt4 精彩实例分析* 实例2 标准对话框的使用

    和大多数操作系统一样,Windows及Linux都提供了一系列的标准对话框,如文件选择,字体选择,颜色选择等,这些标准对话框为应用程序提供了一致的观感.Qt对这些标准对话框都定义了相关的类.这些类让使 ...

  8. QT+ 使用标准对话框+关于对话框+问题对话框+文件对话框

    #include "mainwindow.h" #include <QMenuBar> #include <QMenu> #include <QAct ...

  9. 【Qt开发】Qt标准对话框之QMessageBox

    好久没有更新博客,主要是公司里面还在验收一些东西,所以没有及时更新.而且也在写一个基于Qt的画图程序,基本上类似于PS的东西,主要用到的是Qt Graphics View Framework.好了,现 ...

随机推荐

  1. python中的is、==和cmp()比较字符串

    python 中的is.==和cmp(),比较字符串 经常写 shell 脚本知道,字符串判断可以用 =,!= 数字的判断是 -eq,-ne 等,但是 Python 确不是这样子地.所以作为慢慢要转换 ...

  2. 期权交易基本原理——买进看跌期权(Long Put),卖出看跌期权(Short Put)

    期权交易基本原理--买进看跌期权(Long Put),卖出看跌期权(Short Put) 来源:中电投先融期货-青岛 浏览:13508次2014-07-25 14:25:55 3 第三节 买进看跌期权 ...

  3. caffe中的filler.hpp源码的作用:

    filler.hpp文件:(它应该没有对应的.cpp文件,一切实现都是在头文件中定义的,可能是因为filler只分在网络初始化时用到那么一次吧) 1,首先定义了基类:Filler,它包括:一个纯虚函数 ...

  4. iOS开发之 在release版本禁止输出NSLog内容

    因为NSLog的输出还是比较消耗系统资源的,而且输出的数据也可能会暴露出App里的保密数据,所以发布正式版时需要把这些输出全部屏蔽掉. 我们可以在发布版本前先把所有NSLog语句注释掉,等以后要调试时 ...

  5. Android:控件WebView显示网页

    WebView可以使得网页轻松的内嵌到app里,还可以直接跟js相互调用. webview有两个方法:setWebChromeClient 和 setWebClient setWebClient:主要 ...

  6. Java troubleshooting guide

    http://www.oracle.com/technetwork/java/javase/toc-135973.html --不同的 OutOfMemoryError/内存溢出,以及相关的解决

  7. 【转】java多态详解

    1.        Java中除了static和final方法外,其他所有的方法都是运行时绑定的.private方法都被隐式指定为final的,因此final的方法不会在运行时绑定.当在派生类中重写基 ...

  8. hiho_1044 状态压缩

    题目大意 给定N个位置,每个位置i都有一个value[i]值,从中选择若干个位置,使得连续的M个位置中的被选中的位置数目不超过Q,求出所有选择方案中value和最大的方案,输出其最大value和. 分 ...

  9. 闹钟--alarmManager

    1.AlarmManager,顾名思义,就是“提醒”,是Android中 常用的一种系统级别的提示服务,在特定的时刻为我们广播一个指定的Intent.简单的说就是我们设定一个时间,然后在该时间到来 时 ...

  10. ftp断点续传

    有时候ftp的文件太大了 容易断掉 使用shell下载 1 #!/bin/bash 2 cd /data2/GATK2/refSeqDB/1000genomePhase3 3 ftp -v -n 19 ...