Sap Smart forms
1.Overview:
简介:
smartforn是一种Gui的开发接口,支持drag&drop、copy &paste,制作窗体的工具,
smartform工具的优点,可减少一半的开发时程,而且不懂程序一样可以开发
smartform使用时机:需要输出文字可控制字号,需在窗体中加入图形(ex:logal),
可以共享格式
Ps. SAP宣称Sap 4.6c以后将以smart forms 取代Sapscript forms
架构:
smart forms:
In a Smart Form you describe:
◎此表格为自行定义规化的表格(一页上的元素位置)
◎依照自行定义规化的表格去布局想要显示的text, graphics, addresses, tables….等资料。
◎利用Applicstion program 设定逻辑条件将所需要的数据从database读取至internal table。
◎传送Application data到自行定义规化的表格界面。
当smartform activate时, 系统产生一个function module, 把smartform(表格)的所有属性封于囊中。一旦应用程序叫这个function module, smartforms使用module interface 传送以前选择的任何table 数据和根据表格描述去output( print)表格。
界面:
T-CODE:SMARTFORMS
form:显示、更改、建立smartform窗体,在输入字段中输入smartform窗体名称
style:设定smartform窗体中所需要的字型、字体大小、放置字体位置
text module:在自己本身窗体或其他窗体中需要显示批注或一段文字时,可在此设定及维护
form attributes:表格属性
一般属性:显示form的名称、说明,建立者、建立日期、时间及更改者信息及设定Language属性
输出选项:
page format:页面格式,可以设定成A4、A5…..或自行定义的格式
定义方式:?
XSF OUTPUT:?
Form interface: 表格界面
当smartform activate时, 系统产生一个function module, 把smartform(表格)的所有属性封于囊中。一旦应用程序叫这个function module, smartforms使用module interface 传送以前选择的任何table 数据和根据表格描述去output( print)表格。
fomr interfac的功能就是将abap program中的数据接收过来
import:输入字段或structure名称,将abap program中的字段或structure值传进来.
export:将某些特定值或结果传出.
表格:输入internal table名称,将abap program中的internal table值传进来
exceptions:?
Global definitions:定义global data type
global data:定义在此form中所用的数据型态
types:可以定义在form中自己所需要的字段、structure、internal table initialization:在此可以写一些abap program(用perform方式)去读取你所需要的数据form routines:和initialization一样,在此存放的是子程序(form)的地方
Style: 设定smartform窗体中所需要的字型、字体大小、放置字体位置
header data:
standard settings:当在form中使用此style时default的设定
administraction:显示此style的说明及建立者、更改者的information.
indents and spacing:设定输出字符串的位置
如果不设定(留空白)会依照header data- standard settings中所设定的值
tabs:详细订义文字输出位置,
number and outline:定义数字型态格式
character formats:定义字型格式
standard settings:1.设定输出文字,可设定成上标或下标
2.设定bar code
字型:设定输出文字的字型、大小、型式、颜色、是否加底线
text:批注中内容输入在此地方,并可以设定批注中的段落、字型、字体大小
management:设定批注中所需的字型,建立者、建立日期、时间及更改者及设定Language属性
2.Form Logic:
3.Node type:
Output areas
Elementary nodes (without successors)
Table output
Flow control
Other nodes
4.node type 说明:
A. Page : 定义输出格式,如A4, A5,或是直式/横式打印。
B. window: 分为main window 和subwindows , 主要是用来当做display area
a.main window :
(1)一个form 中只能有一个main window
(2)main window 在每一page中的宽度要一样,但高度可不一样
(3)若此page没有定义main window,则其next page 不可为page 本身。
Ex: page1如没定义main window,在一般属性中NEXT PAGE不可设成
Page1.
(4)内容是可以延续的,且每一page中都有.
b.subwindows :除了main window以外的window,内容是不可延续的。
C. Text: 用来显现文字或变量值
D.Graph: 用来显现图档。
E.Address: 用来显现地址数据。
A.Template: 用来显现静态的数据,即定义模板表格,其内容再一一填入,表格型式是固定的。
B.TABLE: 用来显现动态的数据,即定义表格的LINE TYPES,数据可动态的选择不同的
LINE TYPE来显示。
https://www.doczj.com/doc/1e14772560.html,MAND: 用来做PAGE切换及PRINT CONTROL.
I.Loop: 可重复执行NODES.
J.Alternative : 可做逻辑运算。
K.Folder :把多个NODE结合成一个GROUP,用于分类。
https://www.doczj.com/doc/1e14772560.html,plex section : 有template, table, loop, folder 的功能组合。
M.Program lines : 可于SMARTFORM中撰写ABAP PROGRAM。
详细用法及设定,在范例实作时会有详细介绍
Integrating the Smart Form into the Application
Use
透过两个function module去触发所需打印的表格。第一个module用form的name来决定产生的function module name。然后, call这个function module。
产生的function module name在一个系统之内是唯一的。因此, 首先call的这个function module name 来决定目前产生的module。
Prerequisites
以自己的形式定义了这个表格界面并将使此form active起来。
Procedure
1. In the Form Builder call the function Environment Name of the function module and use STRG-Y and
STRG-C to copy its name.
以形式(表格)建设者把功能叫做环境吗? 功能组件(模块)的名字和用STRG - Y 和STRG - 丙等来复制它的名字。
2.In the data retrieval program define a variable of type rs281_fnam for the name of the generated
function module:
在数据检索中程序对于产生的功能modul e:的名字定义类型附应激励器281_fnam 的一个变量。
data fm_name type rs38l_fnam.
You can call the Smart Form in other parts of the application program as well. However, in this case you must make sure that the system can access the data to be passed from that place. We recommend to encapsulate the data retrieval in a function module as well.
你(们)能够在应(运)用程序的其他一些部分也叫聪明伶俐形式(表格)。然而, 在这种情况下你(们)必须确信系统能够存取从那地方透过的这个数据。我们在一个功能组件(模块)中建议也把这个数据检索封于囊中。
3. If desired, you can call the function module SSF_FIELD_LIST. It returns a list of the form parameters
actually used in the form. You can use this information to limit data selection, if necessary.
如果希望(愿望), 你(们)能够叫这个功能组件(模块) SSF_田地_表。它(这)退回实际上用于形式(表格)的(这些)形式(表格)参数的一个表(目录)。你(们)能够用这个信息来限制数据选择, 如果必要。
4.
5.Call function module SSF_FUNCTION_MODULE_NAME. It returns the name of the generated function
module:
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = '