SAPQuery步骤QUERY是SAP的一项简单报表工具,它可为没有编程基础的用户用来生成简单的报表。第一次接触QUERY的时候,感觉也不是很复杂,因为它有图形化的界面,你可在上面托托拽拽,然后就可以见到你要的报表,可是这只是简单的应用,其实每个工具功能都是比较完善的,QUERY也不例外。要全面的理解QUERY,首先看一下QUICKVIWER。事务代码:SQVI。我感觉这是QUERY的一个简化,大体流程基本一致,但是在许多方面的功能都“缩水“了。体现如下:1。QuickViewer所生成的报表是用户自定义的报表,只能由此用户自己使用、维护2。QuickViewer只能使用存于数据库内的数据,不能进行计算(除小计、累计)3。提供与SAP内部工具如EIS,ABC,ALV及外部工具如Word,Excel借口4。无须也无法利用用户组、Functionalarea统一管理5。无法传输比较而言,QUERY就比较完善了,可是做起来也比较麻烦一下:1。生成用户组SAP菜单→工具→ABAP工作台→实用程序→SAP查询→用户组T-Code:SQ032。创建Functionalarea(功能区)SAP菜单→工具→ABAP工作台→实用程序→SAP查询→信息集T-Code:SQ023。创建SAPQuerySAP菜单→工具→ABAP工作台→实用程序→SAP查询→查询T-Code:SQ01这些组件之间的关系有:1。Query的管理包括建立Functionalarea(功能区)和UserGroup(用户组),并将功能区分配到相应的用户组中去。2。Functionalarea(功能区)中定义query中需引用的表和字段。3。只有当一个用户属于至少一个用户组才可以创建、运行分配到该用户组的Queries。一个用户可以属于几个用户组。用户组中的用户享有相同的权力。因此,要想让一个用户使用某个Query,必须将该用户分配到对应的用户组。4。当Functionalarea(功能区)分配给了某用户组,该用户组的成员即可以访问此功能区。SAPQuery总体思路:1.sq02建立功能区域a.选择tableb.建立条件c..选择字段2.sql01建立query,可把query的使用分配给你建立的使用者群组(权限的控制)3.使用query,可定义格式,使用那些栏位进行选择具体步骤如下:1.ExamplebyqueryforScrapreason;2.T-codeSQ02forcreateaquery;3.Inputthereportnamethenclick“Create”;4.Iftheinformationthatshowinfinalreportincludeinonetablethanchoice“Directreadoftable”,ifneedgotfrommorethanonetablethanchoice“Tablejoinbybasistable”andmaintainedmajortablename.Inourexample,themajortableisMSEG;5.Aftersave,youcanchoiceadditionaltablefrom“Inserttable”;6.Filltheadditiontablename,inourexample,thesecondlytableis“MKPF”;7.Systemwillautomaticcreatetherelationbetweentwotable,inourexamplethekeyfieldis“MBLNR(materialdocumentnumber);8.Afterallrelatedtableischoseandcreatetherelation,thenclickback,inourexamplewejustneedusetwotable;9.Thenchoice“includekeyfields”;10.Afterclick√,youcanseebelowscreen;11.Expandedthefieldgroup;12.Thenyoucanchoicetherequiredinformationfromleftsidetorightside;13.OurreportstructureisGLaccount/Materialdocumentnumber/Materialnumber/postingdate/Quantity/Unit/Amount/Currency/Profitcenter/Costcenter/Movementtype/Reason/Reasontext/Username,afterchoice;14.Thengeneratethereport;15.Afteryougotthegreennoticefromsystem,thenyoucansaveandback;16.Afterback;17.UsingT-codeSQ03forassignuser;18.Choiceusergroupfromthelist,inourexample,wechoiceGroupMM;19.Thenclick“AssignusersandInfosets”;20.Thenyoucanspecificchoicewhocanusethereport;21.Adduserinthescreenthensaveandback;22.ThenbacktoSQ02,choiceusergroupassignment;23.Choiceusergroup“MM”,thensaveandback;24.UserT-codeSQ01,fillthequerynamethenclick“Create”;25.Findthenew“Query”thendoubleclick;26.Thenfilledthecolumn“Title”thenchoice“Basiclist”;27.Afterchoice“Basiclist”;28.Expandedthefieldgroup,andchoice“Text:Materialnumber”and“Text:Reasonformovement”thenwecanshowthedescriptionformaterialc...