Create Table Control Using ABAP Programming.docx

上传人:b****6 文档编号:3018572 上传时间:2022-11-17 格式:DOCX 页数:10 大小:347.07KB
下载 相关 举报
Create Table Control Using ABAP Programming.docx_第1页
第1页 / 共10页
Create Table Control Using ABAP Programming.docx_第2页
第2页 / 共10页
Create Table Control Using ABAP Programming.docx_第3页
第3页 / 共10页
Create Table Control Using ABAP Programming.docx_第4页
第4页 / 共10页
Create Table Control Using ABAP Programming.docx_第5页
第5页 / 共10页
点击查看更多>>
下载资源
资源描述

Create Table Control Using ABAP Programming.docx

《Create Table Control Using ABAP Programming.docx》由会员分享,可在线阅读,更多相关《Create Table Control Using ABAP Programming.docx(10页珍藏版)》请在冰豆网上搜索。

Create Table Control Using ABAP Programming.docx

CreateTableControlUsingABAPProgramming

CreateTableControlUsingABAPProgramming

CreateTableControlUsingABAPProgramming

Inlasttwoweeks,Ihavelearnedself-taughthowtocreate tablecontrol in SAPScreenusing ABAP4.Aftertrialanderror,finallyIhavefinishedmysmallproject.Whilelearningabouttablecontrol,Iuse SAPHelp asmainreference,somewebsitesandpresentationslidesfromMichaelAdams,QueenslandUniversityofTechnology.

ATableControlisascreen‘container’orobjectthatallowsdisplayofmultiplerowsofatable(database or internaltable)onascreen.Itisgoodfordisplayingaone-to-manyrelationshipontheonescreen.Thetablecontrolobjecthasmanyfeaturesbuiltintoenhancescreendisplayandusability.

TableControlfeaturesallow

∙horizontal&verticalscrolling

∙columnwidthresizing

∙scrollingwithinafield(wherecontentsarewiderthanthescreenfieldwidth)

∙reorderingthesequenceofcolumns

∙savingthecurrentdisplaysettingsforfutureuse

∙selectionoftablerows&columns

Formattingfeaturesinclude

∙automatictableresizingonwindowresize

∙separatorlinesbetweenrows&columns

∙columnheaderfieldsforallcolumns

Herestepstocreatetablecontrol

1.Declarethetablecontrol

Aswellasdrawingthetablecontrolonthescreenitisnecessarytodeclarethetablecontrolasadataitem(intheTOPincludeprogramforthetransaction).

CONTROLSctrlTYPETABLEVIEW USINGSCREENscr.

isthenameofthetablecontrolonascreenintheABAPprogram

correspondstoacomplextype–   (CXTAB_CONTROLdefinedintheABAPdictionary)

isthescreenfromwhichthetablecontrolwillgetitsinitialvalues

2.Addingtablecontroltoascreen

Inthegraphicalscreeneditorchoosethetablecontrolelementbutton. Usetheleftmousebuttontopositionandsizethecontrolonthescreen.

Theninputthenameoftablecontrol.

3.AddingFieldtoatablecontrol

Toaddfieldtotablecontrol,wecanretrievefromtableorinternaltable.Clickonicon“dictionary/programfieldwindow”orfunctionkeyF6.

Theretwooptionwhileretrievefield,i.e.basedondatabasetableorinternaltable.Ifwanttoretrievefromdatabasetable,inputthenameoftablethenclickpushbutton“GetfromDictionary”.Ifwanttoretrievefrominternaltable,inputtheinternaltablenamethenclickpushbutton“Getfromprogram”.

Markthefieldtobeaddedtotablecontrol,andthenclickonpushbuttonOK.

Dragselectedfieldsintotablethenreleasethemousebutton.

Herethefieldsweselectedwillbedisplayedinreversedorder.Idonotexactlywhyithappens.Ihavetriedsomewaysandtrickstodisplayincorrectorder,butthefieldsstilldisplayedinreversedorder.Finally,togetthecorrectorderIselectedthefieldsonebyone.

4.Addinglabelforeachcolumn

Labelcolumnistextfield.Toaddit,justclickonthetextfieldicon,dragitontoheaderofthecolumnandthentypethelabel.

TableControlPrinciple

Thereareasetofprogrammingprinciplesthatshouldbeadheredtowhenusingtablecontrolsandsteploops.Datafromthedatabaseshouldbeinitiallyloadedintoaninternaltable.Thismeansthatthedatabaseisaccessedforreadpurposesonlyonceinthetransaction.Nexttherowsoftheinternaltableareloadedintothetablecontrol.Anychangesthataremadetothedataarethensavedbacktotheinternaltable.Attheendofthetransaction,thecontentsoftheinternaltablecanbewrittenbacktothedatabase,againtominimizedatabaseI/O.

PAIlogicforscreen1(seescreenbelow)loadstheinternaltablewithdatafromthedatabaseaccordingtotheentriessuppliedbytheuser.

PBOlogicforscreen2(seescreenbelow)populatesthetablecontrolfromtheinternaltable(buffer).

Useractioninscreen2triggersthePAIlogic.PAIlogicupdatestheinternaltablewithnewvaluesentered(intothetablecontrolscreenfields)bytheuser.

PAIlogicistriggeredbyactionssuchasscrollingdownasinglerowaswellasactionssuchasBACK,EXIT,etc.

Unlesstheuseractioncausesthetransactiontoleavethecurrentscreen,afterthePAImoduleshavebeenexecuted,thePBOmodulesforthescreenareexecutedagain.Thusthetablecontrolfieldsareupdatedorrefreshedaftereveryuseraction.

PBO(ProcessBeforeOutput)

InPBOprocessingfieldsaretransportedfromthemodulepooltothescreeninapredefinedorder.

∙Thetablecontrolsteploopisprocessedrowbyrow.Fieldswithcorrespondingnamesaretransportedfromthemodulepooltothescreen.

∙Afterthesteploophasbeenprocessedallremainingmodulepoolfieldsaretransportedtothescreen.

PAI(ProcessAfterInput)

∙AllscreenfieldsthatdonotbelongtoatablecontrolandarenotspecifiedinaFIELDstatementaretransportedtomodulepoolfields

∙Tabl

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

当前位置:首页 > 法律文书 > 调解书

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

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