Sap Smart forms3要点.docx

上传人:b****3 文档编号:27058094 上传时间:2023-06-26 格式:DOCX 页数:18 大小:779.48KB
下载 相关 举报
Sap Smart forms3要点.docx_第1页
第1页 / 共18页
Sap Smart forms3要点.docx_第2页
第2页 / 共18页
Sap Smart forms3要点.docx_第3页
第3页 / 共18页
Sap Smart forms3要点.docx_第4页
第4页 / 共18页
Sap Smart forms3要点.docx_第5页
第5页 / 共18页
点击查看更多>>
下载资源
资源描述

Sap Smart forms3要点.docx

《Sap Smart forms3要点.docx》由会员分享,可在线阅读,更多相关《Sap Smart forms3要点.docx(18页珍藏版)》请在冰豆网上搜索。

Sap Smart forms3要点.docx

SapSmartforms3要点

SapSmartforms

1.Overview:

简介:

smartforn是一种Gui的开发接口,支持drag&drop、copy&paste,制作窗体的工具,

smartform工具的优点,可减少一半的开发时程,而且不懂程序一样可以开发

smartform使用时机:

需要输出文字可控制字号,需在窗体中加入图形(ex:

logal),

可以共享格式

Ps.SAP宣称Sap4.6c以后将以smartforms取代Sapscriptforms

架构:

smartforms:

 

InaSmartFormyoudescribe:

◎此表格为自行定义规化的表格(一页上的元素位置)

◎依照自行定义规化的表格去布局想要显示的text,graphics,addresses,tables….等资料。

◎利用Applicstionprogram设定逻辑条件将所需要的数据从database读取至internaltable。

◎传送Applicationdata到自行定义规化的表格界面。

当smartformactivate时,系统产生一个functionmodule,把smartform(表格)的所有属性封于囊中。

一旦应用程序叫这个functionmodule,smartforms使用moduleinterface传送以前选择的任何table数据和根据表格描述去output(print)表格。

界面:

T-CODE:

SMARTFORMS

form:

显示、更改、建立smartform窗体,在输入字段中输入smartform窗体名称

style:

设定smartform窗体中所需要的字型、字体大小、放置字体位置

textmodule:

在自己本身窗体或其他窗体中需要显示批注或一段文字时,可在此设定及维护

formattributes:

表格属性

一般属性:

显示form的名称、说明,建立者、建立日期、时间及更改者信息及设定Language属性

输出选项:

pageformat:

页面格式,可以设定成A4、A5…..或自行定义的格式

定义方式:

?

XSFOUTPUT:

?

Forminterface:

表格界面

当smartformactivate时,系统产生一个functionmodule,把smartform(表格)的所有属性封于囊中。

一旦应用程序叫这个functionmodule,smartforms使用moduleinterface传送以前选择的任何table数据和根据表格描述去output(print)表格。

fomrinterfac的功能就是将abapprogram中的数据接收过来

import:

输入字段或structure名称,将abapprogram中的字段或structure值传进来.

export:

将某些特定值或结果传出.

表格:

输入internaltable名称,将abapprogram中的internaltable值传进来

exceptions:

?

Globaldefinitions:

定义globaldatatype

globaldata:

定义在此form中所用的数据型态

types:

可以定义在form中自己所需要的字段、structure、internaltable

initialization:

在此可以写一些abapprogram(用perform方式)去读取你所需要的数据

formroutines:

和initialization一样,在此存放的是子程序(form)的地方

Style:

设定smartform窗体中所需要的字型、字体大小、放置字体位置

headerdata:

standardsettings:

当在form中使用此style时default的设定

administraction:

显示此style的说明及建立者、更改者的information.

paragraphformats:

定义段落格式

indentsandspacing:

设定输出字符串的位置

字型:

设定输出文字的字型、大小、型式、颜色、是否加底线

如果不设定(留空白)会依照headerdata-standardsettings中所设定的值

tabs:

详细订义文字输出位置,

numberandoutline:

定义数字型态格式

characterformats:

定义字型格式

standardsettings:

1.设定输出文字,可设定成上标或下标

2.设定barcode

字型:

设定输出文字的字型、大小、型式、颜色、是否加底线

textmodule:

在自己本身窗体或其他窗体中需要显示批注或一段文字时,可在此设定及维护

text:

批注中内容输入在此地方,并可以设定批注中的段落、字型、字体大小

management:

设定批注中所需的字型,建立者、建立日期、时间及更改者及设定Language属性

2.FormLogic:

ThediagrambelowshowsthetreestructureoftherootnodePagesandwindows:

3.Nodetype:

Outputareas

Nodetype

Description

Possibledirectsuccessors

Page

Apageoftheform.Directsuccessorsofthisnodecanbeplaceddirectlyonthepage.

Window,graphic,address

Window

Outputareaonapage.Therearemainwindowsandsubwindows.

Allexceptwindowandpagenodes

Elementarynodes(withoutsuccessors)

Nodetype

Description

Text

Youusethisnodetoprintanytexts(andtablecontents),exceptaddresses.

Graphic

Youusethisnodetopositiongraphicsintheform.Toincludebackgroundgraphics,usenodetypePage.

Address

Youusethisnodetoincludeanaddress.Thesystemreadstheaddressdatadirectlyfromthedatabasetablesandformatsthemforprintoutput.

Tableoutput

Nodetype

Description

Possibledirectsuccessors

Template

Outputofatablecontainingstaticdata

Allexceptwindow,page,table,andtemplatenodes

Table

Outputofatablecontainingapplicationdata

Aswithtemplatenode

 

Flowcontrol

Nodetype

Description

Possibledirectsuccessors

Command

Executesspecialcommands(nextpage,paragraphnumbering,printercontrol)

(nosuccessor)

Loop

Processessuccessornoderepeatedly.

Allexceptwindowandpagenodes

Alternative

Branchesdependingoncondition.

DirectsuccessorsareautomaticallythenodesTRUEandFALSE.Thedirectsuccessorsoftheseareallnodesexceptwindowandpagenodes.

Othernodes

Nodetype

Description

Possibledirectsuccessors

Folder

Combinessuccessornodestologicalgroups

Allexceptwindowandpagenodes

Complexsection

Combinesallattributesofthenodetypestemplate,table,loop,folder

Allexceptwindowandpagenodes

Programlines

ExecutesABAPprogramcode(forexample,conversionroutines).

(nosuccessors)

 

4.nodetype说明:

A.Page:

定义输出格式,如A4,A5,或是直式/横式打印。

B.window:

分为mainwindow和subwindows,主要是用来当做displayarea

a.mainwindow:

(1)一个form中只能有一个mainwindow

(2)mainwindow在每一page中的宽度要一样,但高度可不一样

(3)若此page没有定义mainwindow,则其nextpage不可为page本身。

Ex:

page1如没定义mainwindow,在一般属性中NEXTPAGE不可设成

Page1.

(4)内容是可以延续的,且每一page中都有.

b.subwindows:

除了mainwindow以外的window,内容是不可延续的。

C.Text:

用来显现文字或变量值

D.Graph:

用来显现图档。

E.Address:

用来显现地址数据。

A.Template:

用来显现静态的数据,即定义模板表格,其内容再一一填入,表格型式是固定的。

B.TABLE:

用来显现动态的数据,即定义表格的LINETYPES,数据可动态的选择不同的

LINETYPE来显示。

C.COMMAND:

用来做PAGE切换及PRINTCONTROL.

I.Loop:

可重复执行NODES.

J.Alternative:

可做逻辑运算。

K.Folder:

把多个NODE结合成一个GROUP,用于分类。

L.Complexsection:

有template,table,loop,folder的功能组合。

M.Programlines:

可于SMARTFORM中撰写ABAPPROGRAM。

详细用法及设定,在范例实作时会有详细介绍

 

 IntegratingtheSmartFormintotheApplication 

Use

透过两个functionmodule去触发所需打印的表格。

第一个module用form的name来决定产生的functionmodulename。

然后,call这个functionmodule。

产生的functionmodulename在一个系统之内是唯一的。

因此,首先call的这个functionmodulename来决定目前产生的module。

Prerequisites

以自己的形式定义了这个表格界面并将使此formactive起来。

Procedure

1.IntheFormBuildercallthefunctionEnvironment→NameofthefunctionmoduleanduseSTRG-YandSTRG-Ctocopyitsname.

以形式(表格)建设者把功能叫做环境吗?

功能组件(模块)的名字和用STRG-Y和STRG-丙等来复制它的名字。

2.Inthedataretrievalprogramdefineavariableoftypers281_fnamforthenameofthegeneratedfunctionmodule:

在数据检索中程序对于产生的功能module:

的名字定义类型附应激励器281_fnam的一个变量。

datafm_nametypers38l_fnam.

YoucancalltheSmartForminotherpartsoftheapplicationprogramaswell.However,inthiscaseyoumustmakesurethatthesystemcanaccessthedatatobepassedfromthatplace.Werecommendtoencapsulatethedataretrievalinafunctionmoduleaswell.

你(们)能够在应(运)用程序的其他一些部分也叫聪明伶俐形式(表格)。

然而,在这种情况下你(们)必须确信系统能够存取从那地方透过的这个数据。

我们在一个功能组件(模块)中建议也把这个数据检索封于囊中。

3.Ifdesired,youcancallthefunctionmoduleSSF_FIELD_LIST.Itreturnsalistoftheformparametersactuallyusedintheform.Youcanusethisinformationtolimitdataselection,ifnecessary.

如果希望(愿望),你(们)能够叫这个功能组件(模块)SSF_田地_表。

它(这)退回实际上用于形式(表格)的(这些)形式(表格)参数的一个表(目录)。

你(们)能够用这个信息来限制数据选择,如果必要。

4.

5.CallfunctionmoduleSSF_FUNCTION_MODULE_NAME.Itreturnsthenameofthegeneratedfunctionmodule:

CALLFUNCTION'SSF_FUNCTION_MODULE_NAME'

  EXPORTING

    FORMNAME             =''

  IMPORTING

    FM_NAME              =fm_name

  EXCEPTIONS

    NO_FORM              =1

    NO_FUNCTION_MODULE   =2

    OTHERS               =3.

IFSY-SUBRC<>0.

   

ENDIF.

6.Callthegeneratedfunctionmodule.Todothis,usetheInsertstatementfunctionforCALLFUNCTIONintheABAPEditorandusethenameyoucopiedinstep1.(toavoidhavingtocopyallinterfaceparametersmanually).Thenreplacethefunctionmodulenamewiththevariablefm_namedefinedinstep2.

CALLFUNCTIONfm_name

  EXPORTING

*   ARCHIVE_INDEX=

*   ARCHIVE_PARAMETERS=

*   CONTROL_PARAMETERS=

*   MAIL_APPL_OBJ=

*   MAIL_RECIPIENT=

*   MAIL_SENDER=

*   OUTPUT_OPTIONS=

*   USER_SETTINGS='X'

    G_CARRID=

    G_CONNID=

    G_FLDATE=

*IMPORTING

*   DOCUMENT_OUTPUT_INFO=

*   JOB_OUTPUT_INFO=

*   JOB_OUTPUT_OPTIONS=

  TABLES

    GT_SBOOK=

  EXCEPTIONS

    FORMATTING_ERROR=1

    INTERNAL_ERROR=2

    SEND_ERROR=3

    USER_CANCELED=4

    OTHERS=5.

IFSY-SUBRC<>0.

   

ENDIF.

Inthisexample,threevariablesandaninternaltablearepassed.TheparametersG_CARRID,G_CONNID,G_FLDATA,andGT_SBOOKhavebeendefinedbeforeintheforminterface.

7.Intheinterfacepassalldatayouwanttotransfertotheform.

Result

ThegeneratedfunctionmoduleprocessestheformlogicdefinedintheSmartForm.Itsoutputissenttotheprinterspoolforprocessing.

Aslongasyoudonotchangetheforminterface,youcanmakeanychangestotheform.Whenyouactivateitagain,thesystemgeneratesthecurrentversionoftheformassoonasyoucallthefunctionmodule.Onlyifyouchangetheforminterface,youmustadapttheinterfaceinthedataretrievalprogram.

参考文件:

 

范例实作(stepbystep)

范例窗体名称:

请购单

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 经管营销 > 经济市场

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1