SAP動態(tài)樹程序DialogALV報表_第1頁
SAP動態(tài)樹程序DialogALV報表_第2頁
SAP動態(tài)樹程序DialogALV報表_第3頁
SAP動態(tài)樹程序DialogALV報表_第4頁
SAP動態(tài)樹程序DialogALV報表_第5頁
已閱讀5頁,還剩84頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領

文檔簡介

1、SAP動態(tài)樹程序Dialog ALV報表-Author:SUNZK QQ:1131341075 微信:DreamSunlight88REPORTZFIR_1027.INCLUDEZFIR_1027_TOP.INCLUDEZFIR_1027_CLS.INCLUDEZFIR_1027_SEL.INCLUDEZFIR_1027_O01.INCLUDEZFIR_1027_I01.INCLUDEZFIR_1027_F01.*&*&包含ZFIR_1026_TOP*&*TYPE-POOLS:KKBLO.TABLES:T001,T012K,TCJ_POSITIONS,ZFIT1011,SSCRFIELDS,B

2、KPF,ISELLIST,TCJ_DOCUMENTS.TYPES:BEGINOFTY_TAB.INCLUDETYPEZFIT1011.TYPES:BANKATYPEBNKA-BANKA,HBKIDTYPET012K-HBKID,BCJNRTYPET012K-BCJNR,ZJLBTYPECHAR20,資金類別KHHTTYPECHAR20,開戶行描述QCZHYETYPEFDBL_DE_S,期初帳戶余額(2015-05-01)SRZJ_01TYPEFDBL_DE_S,運維收入SRZJ_02TYPEFDBL_DE_S,咨詢技術服務收入SRZJ_03TYPEFDBL_DE_S,軟件收入SRZJ_04TY

3、PEFDBL_DE_S,培訓收入SRZJ_05TYPEFDBL_DE_S,備用金收入SRZJ_06TYPEFDBL_DE_S,其他收入SRZJ_07TYPEFDBL_DE_S,運營資金昆明(收)SRZJ_08TYPEFDBL_DE_S,運營資金上海(收)SRZJ_09TYPEFDBL_DE_S,利息收入SRZJ_10TYPEFDBL_DE_S,其他貨幣資金SRZJ_11TYPEFDBL_DE_S,籌資收入SRZJ_12TYPEFDBL_DE_S,借款SRZJ_13TYPEFDBL_DE_S,歸還借款(收)SRZJ_14TYPEFDBL_DE_S,提取差旅費(收)SRZJ_15TYPEFDBL_

4、DE_S,提取備用金(收)SRZJ_16TYPEFDBL_DE_S,退款SRZJ_17TYPEFDBL_DE_S,保證金SRZJ_18TYPEFDBL_DE_S,一般戶備用金SRZJ_19TYPEFDBL_DE_S,運營資金北京(收)SRZJ_XJTYPEFDBL_DE_S,收入小計ZCZJ_01TYPEFDBL_DE_S,報銷款ZCZJ_02TYPEFDBL_DE_S,租房合同領導租房ZCZJ_03TYPEFDBL_DE_S,工資ZCZJ_04TYPEFDBL_DE_S,預借差旅費ZCZJ_05TYPEFDBL_DE_S,預借報銷款ZCZJ_06TYPEFDBL_DE_S,其他預借款ZCZJ

5、_07TYPEFDBL_DE_S,合同付款ZCZJ_08TYPEFDBL_DE_S,培訓費(員工福利)ZCZJ_09TYPEFDBL_DE_S,培訓費(對公free)ZCZJ_10TYPEFDBL_DE_S,辦公室裝修費ZCZJ_11TYPEFDBL_DE_S,辦公室房租ZCZJ_12TYPEFDBL_DE_S,轉款手續(xù)費ZCZJ_13TYPEFDBL_DE_S,采購軟件ZCZJ_14TYPEFDBL_DE_S,軟件服務費ZCZJ_15TYPEFDBL_DE_S,其他庫存采購支出ZCZJ_16TYPEFDBL_DE_S,工資(代發(fā))ZCZJ_17TYPEFDBL_DE_S,社保四險/醫(yī)保險ZC

6、ZJ_18TYPEFDBL_DE_S,公積金ZCZJ_19TYPEFDBL_DE_S,殘保金ZCZJ_20TYPEFDBL_DE_S,個人所得稅ZCZJ_21TYPEFDBL_DE_S,工會經(jīng)費ZCZJ_22TYPEFDBL_DE_S,社保代理/勞務派遣費ZCZJ_23TYPEFDBL_DE_S,差旅費ZCZJ_24TYPEFDBL_DE_S,機票款ZCZJ_25TYPEFDBL_DE_S,所得稅(含匯算清繳)ZCZJ_26TYPEFDBL_DE_S,增值稅ZCZJ_27TYPEFDBL_DE_S,附加稅ZCZJ_28TYPEFDBL_DE_S,印花稅ZCZJ_29TYPEFDBL_DE_S,

7、一般戶備用金(機票款,支)ZCZJ_30TYPEFDBL_DE_S,租房預借款ZCZJ_31TYPEFDBL_DE_S,車位租金ZCZJ_32TYPEFDBL_DE_S,電費(辦公室)ZCZJ_33TYPEFDBL_DE_S,水費(辦公室)ZCZJ_34TYPEFDBL_DE_S,其他租賃費(辦公室)ZCZJ_35TYPEFDBL_DE_S,采購固定資產(chǎn)ZCZJ_36TYPEFDBL_DE_S,保險費ZCZJ_37TYPEFDBL_DE_S,購辦公用品ZCZJ_38TYPEFDBL_DE_S,其他ZCZJ_39TYPEFDBL_DE_S,律師費ZCZJ_40TYPEFDBL_DE_S,運營資金

8、上海(支)ZCZJ_41TYPEFDBL_DE_S,運營資金昆明(支)ZCZJ_42TYPEFDBL_DE_S,支取備用金ZCZJ_43TYPEFDBL_DE_S,支取差旅費ZCZJ_44TYPEFDBL_DE_S,其他服務費ZCZJ_45TYPEFDBL_DE_S,服務費(支)ZCZJ_46TYPEFDBL_DE_S,保證金ZCZJ_47TYPEFDBL_DE_S,歸還借款(支)ZCZJ_48TYPEFDBL_DE_S,獎金ZCZJ_49TYPEFDBL_DE_S,利息支出ZCZJ_50TYPEFDBL_DE_S,付支付寶備用金ZCZJ_51TYPEFDBL_DE_S,運營資金-北京(支)Z

9、CZJ_XJTYPEFDBL_DE_S,支出小計QMYETYPEFDBL_DE_S,支出小計ZHJTYPEFDBL_DE_S.合計TYPES:ENDOFTY_TAB.DATA:BEGINOFGT_TCJ_POSITIONSOCCURS0.INCLUDETYPETCJ_POSITIONS.DATA:TRANSACT_NAMETYPETCJ_TRANS_NAMES-TRANSACT_NAME,*NUMTYPECHAR4,*ORT01TYPET001-ORT01,HBKIDTYPET012K-HBKID,帳號*FUNACTYPET012K-FUNAC,資金性質(zhì)*FUNACTTYPEZFIE1002-

10、FUNACT,資金性質(zhì)描述ACATRTYPET012K-ACATR,資金類別明細ACATRTTYPEZFIE1002-ACATRT,賬戶性質(zhì)描述*TEXT1TYPET012T-TEXT1,銀行賬戶描述BANKATYPEBNKA-BANKA,銀行賬戶描述CLASSTYPECHAR20.*CSHYETYPEFAGL_BALANCE_LINE-DEBIT,*QCYETYPEFAGL_BALANCE_LINE-DEBIT,*CSHRQTYPEBKPF-BUDATDATA:ENDOFGT_TCJ_POSITIONS.SC100*ALV實列DATA:GC_ALVGRID100TYPEREFTOCL_GUI

11、_ALV_GRID.*客戶容器DATA:GC_CCONTAINER100TYPEREFTOCL_GUI_CUSTOM_CONTAINER,GO_TREE100TYPEREFTOCL_GUI_COLUMN_TREE,GV_CONT_100TYPESCRFNAMEVALUEALV100,*ALV字段設置GT_FIELDCAT100TYPELVC_T_FCAT,GS_FIELDCAT100TYPELVC_S_FCAT,*ALV布局GS_LAYOUT100TYPELVC_S_LAYO,GT_SORT100TYPELVC_T_SORT,GS_SORT100TYPELVC_S_SORT,GT_UIFUNC

12、TION100TYPEUI_FUNCTIONS.*DOIvaribles*DATA:INITIALIZED(1),SPLITTERTYPEREFTOCL_GUI_SPLITTER_CONTAINER,CONTAINERTYPEREFTOCL_GUI_CONTAINER,CONTROLTYPEREFTOI_OI_CONTAINER_CONTROL,DOCUMENTTYPEREFTOI_OI_DOCUMENT_PROXY,FILENAMELIKERLGRAP-FILENAME,RETCODETYPESOI_RET_STRING,SPREADSHEETTYPEREFTOI_OI_SPREADSHEE

13、T,ERRORTYPEREFTOI_OI_ERROR,ERRORSTYPEREFTOI_OI_ERROROCCURS0WITHHEADERLINE,APPTYPEVRM_ID,BDS_INSTANCETYPEREFTOCL_BDS_DOCUMENT_SET,DOC_SIGNATURETYPESBDST_SIGNATURE,WA_DOC_SIGNATURELIKELINEOFDOC_SIGNATURE,DOC_COMPONENTSTYPESBDST_COMPONENTS,DOC_URISTYPESBDST_URI,WA_DOC_URISLIKELINEOFDOC_URIS,EXCEL(80)VA

14、LUEExcel.Sheet,RANGESTYPESOI_RANGE_LIST,RANGEITEMTYPESOI_RANGE_ITEM,EXCEL_INPUTTYPESOI_GENERIC_TABLE,EXCEL_INPUT_WATYPESOI_GENERIC_ITEM,TABLENAME(10),OKCODE(15),ROW(4),COLUMN(4),DATA(39),DOCUMENT_TYPE(80),ITEM_URL(256).DATA:BEGINOFGT_CULUMNOCCURS0,NAMETYPETV_ITMNAME,TEXTTYPETV_HEADING,ENDOFGT_CULUMN

15、.DATA:BEGINOFGT_T012OCCURS0.INCLUDETYPET012.DATA:BANKATYPEBNKA-BANKA.DATA:ENDOFGT_T012.DATA:BEGINOFGT_SUB_ALVOCCURS0.INCLUDETYPETCJ_POSITIONS.DATA:ENDOFGT_SUB_ALV.DATA:BEGINOFIT_TABOCCURS0,FLAG(1),AREANO(5)TYPEN,TABCONTENTTYPEZTAB_EXCEL,ENDOFIT_TAB.DATA:BEGINOFITABOCCURS0.INCLUDESTRUCTUREALSMEX_TABL

16、INE.DATA:ENDOFITAB.RANGES:R_BUKRSFORT001-BUKRS.DATA:GV_FLAGTYPEC,EV_REGCTTYPEZFINODID,GV_NUMTYPECHAR3,G_VALUETYPESTRING.DATA:GT_HIERARCHYTYPESOI_HIERARCHY_TABLE.DATA:GT_T001TYPET001OCCURS0WITHHEADERLINE,GT_T012KTYPETABLEOFT012KWITHHEADERLINE,GT_ZFIE1002TYPETABLEOFZFIE1002WITHHEADERLINE.TYPES:TT_DEMO

17、_ITEMTYPESTANDARDTABLEOFDEMO_ITEM,TT_ZFIT1011TYPESTANDARDTABLEOFZFIT1011,TT_TABTYPESTANDARDTABLEOFTY_TAB,TY_DEMO_ITEMTYPEDEMO_ITEM,TY_ZFIT1011TYPEZFIT1011.DATA:GT_NODE_TABTYPETREEV_NTAB,GT_ITEM_TABTYPESTANDARDTABLEOFDEMO_ITEM,GT_ZFIT1011TYPETABLEOFZFIT1011,GT_TABTYPETT_TAB,WT_TABTYPETT_TAB,GS_TABTYP

18、ETY_TAB,WS_TABTYPETY_TAB.FIELD-SYMBOLS:TYPEZFIT1011.DATA:GT_TCJ_DOCUMENTSTYPETCJ_DOCUMENTSOCCURS0WITHHEADERLINE,GT_TCJ_TRANSACTIONSTYPETCJ_TRANSACTIONSOCCURS0WITHHEADERLINE,GT_TCJ_TRANS_NAMESTYPETCJ_TRANS_NAMESOCCURS0WITHHEADERLINE,GT_BNKATYPEBNKAOCCURS0WITHHEADERLINE.*ALVrelated*DATA:GT_SUB_FIELDCA

19、TTYPELVC_T_FCAT.DATA:GT_FIELDCATTYPELVC_T_FCAT,IT_FIELDCATTYPELVC_T_FCAT,IS_FIELDCATTYPELVC_S_FCAT,IT_EVENTSTYPESLIS_T_EVENTWITHHEADERLINE,IT_SUB_EVENTSTYPESLIS_T_EVENTWITHHEADERLINE,GS_LAYOUTTYPELVC_S_LAYO,IT_SORTTYPESLIS_T_SORTINFO_ALV,IT_PRINTTYPESLIS_PRINT_ALV,G_GRIDTYPEREFTOCL_GUI_ALV_GRID.DATA

20、:G_REPIDLIKESY-REPID,GT_LAYOUT_ALVTYPELVC_S_LAYO.DATA:WA_SORTTYPESLIS_SORTINFO_ALV,GT_SORTTYPELVC_T_SORT,GS_T012KTYPET012K.DATA:LR_GRIDTYPEREFTOCL_GUI_ALV_GRID.DATA:G_LAYOUTTYPESLIS_LAYOUT_ALV,TITLETYPELVC_TITLE,IVARIANTLIKEDISVARIANT.DATAFNAME(20).*FIELDsymbols*FIELD-SYMBOLS:TYPEANY,TYPEANY.FIELD-S

21、YMBOLS:LIKEGT_TCJ_POSITIONS.FIELD-SYMBOLS:TYPETY_TAB.*&*&包含ZFIR_1026_CLS*&*INCLUDEBCALV_TOOLBAR_EVENT_RECEIVER*CLASSLCL_EVENT_RECEIVERDEFINITION.PUBLICSECTION.METHODS:CONSTRUCTORIMPORTINGHANDLETYPEREFTOCL_GUI_COLUMN_TREECB_NODE_DOUBLE_CLICKTYPERS38L_FNAM,HANDLE_ITEM_DOUBLE_CLICKFOREVENTITEM_DOUBLE_C

22、LICKOFCL_GUI_COLUMN_TREEIMPORTINGNODE_KEYITEM_NAME.PRIVATESECTION.DATA:TREE_HANDLETYPEREFTOCL_GUI_COLUMN_TREE.DATA:TREE_CB_NODE_DOUBLE_CLICKTYPERS38L_FNAM.ENDCLASS.lcl_toolbar_event_receiverDEFINITION*CLASSLCL_EVENT_RECEIVERIMPLEMENTATION*CLASSLCL_EVENT_RECEIVERIMPLEMENTATION.METHODCONSTRUCTOR.TREE_

23、HANDLE=HANDLE.TREE_CB_NODE_DOUBLE_CLICK=CB_NODE_DOUBLE_CLICK.ENDMETHOD.constructorMETHODHANDLE_ITEM_DOUBLE_CLICK.DATA:LV_NODIDTYPEZFINODID.DATA:LV_ITEM_NAMETYPENAME1.DATA:LS_TCJ_POSITIONSLIKELINEOFGT_TCJ_POSITIONS.DATA:LS_SUB_ALVLIKELINEOFGT_SUB_ALV.DATA:LV_1TYPESTRING,LV_2TYPESTRING,LV_3TYPESTRING,

24、LV_4TYPESTRING.*BREAKAB_LUOFY.CLEAR:LV_NODID,LV_ITEM_NAME.LV_NODID=NODE_KEY.LV_ITEM_NAME=ITEM_NAME.READTABLEGT_TABWITHKEYNODID=LV_NODIDTRANSPORTINGNOFIELDS.IFSY-SUBRC=0.CLEAR:GT_SUB_ALV,GS_TAB.REFRESH:WT_TAB,GT_SUB_ALV.PERFORMFRM_GET_CLICK_DATAUSINGLV_NODID.使用遞歸找尋下級數(shù)據(jù)LOOPATWT_TABINTOGS_TAB.LOOPATGT_

25、TCJ_POSITIONSINTOLS_TCJ_POSITIONSWHERECOMP_CODE=GS_TAB-BUKRS公司代碼ANDHBKID=GS_TAB-HBKID銀行CODEANDCAJO_NUMBER=GS_TAB-BCJNR.銀行描述IFGS_TAB-RCFLG=X.CHECKLS_TCJ_POSITIONS-NODIDISNOTINITIAL.ELSE.CHECKLS_TCJ_POSITIONS-NODIDISINITIAL.ENDIF.IFLV_ITEM_NAME=ZHJORLV_ITEM_NAME=NODID.合計項不做限制ELSE.SPLITLV_ITEM_NAMEAT_I

26、NTOLV_1LV_2.分割出資金類別,資金類別明細SPLITLS_TCJ_POSITIONS-CLASSAT_INTOLV_3LV_4.分割出資金類別,資金類別明細CONDENSE:LV_1,LV_2,LV_3,LV_4NO-GAPS.CHECKLV_1=LV_3.檢查出資金類別IFLV_2=XJ.ELSE.CHECKLV_2=LV_4.ENDIF.ENDIF.GS_TAB-NODID=LS_TCJ_POSITIONS-NODID.區(qū)域中心標識.MOVE-CORRESPONDINGLS_TCJ_POSITIONSTOLS_SUB_ALV.APPENDLS_SUB_ALVTOGT_SUB_AL

27、V.CLEARLS_SUB_ALV.ENDLOOP.ENDLOOP.SORTGT_SUB_ALVBYCOMP_CODECAJO_NUMBERFISC_YEARPOSTING_NUMBERPOSITION_NUMBER.DELETEADJACENTDUPLICATESFROMGT_SUB_ALVCOMPARINGCOMP_CODECAJO_NUMBERFISC_YEARPOSTING_NUMBERPOSITION_NUMBER.IFGT_SUB_ALVISNOTINITIAL.PERFORMFRM_SUB_FIELDCAT.PERFORMFRM_SUB_EVENTS.PERFORMFRM_SUB

28、_ALV.ENDIF.ENDIF.ENDMETHOD.handle_item_double_clickENDCLASS.LCL_EVENT_RECEIVERIMPLEMENTATIONDATA:GO_APPLICATIONTYPEREFTOLCL_EVENT_RECEIVER.*-p1參數(shù):1列2行3值*-p2作用:填充excel*DEFINEHFILL-CELL.ITAB-COL=&1.ITAB-ROW=&2.IF&4=X.IF&30.CLEARG_VALUE.G_VALUE=ABS(&3).CONCATENATE-G_VALUEINTOG_VALUE.CONDENSEG_VALUENO-G

29、APS.MOVEG_VALUETOITAB-VALUE.ELSE.MOVE&3TOITAB-VALUE.ENDIF.ELSE.MOVE&3TOITAB-VALUE.ENDIF.APPENDITAB.CLEARITAB.END-OF-DEFINITION.*&*&包含ZFIR_1026_SEL*&*SELECTION-SCREENBEGINOFBLOCKBLK1WITHFRAMETITLEK1.SELECT-OPTIONS:S_BUKRSFORBKPF-BUKRSOBLIGATORY,S_BUDATFORISELLIST-BDATEDEFAULTSY-DATUMOBLIGATORYNOINTER

30、VALSNO-EXTENSION.SELECTION-SCREENENDOFBLOCKBLK1.START-OF-SELECTION.REFRESHGT_T012K.EV_REGCT=GI.SELECT*INTOTABLEGT_ZFIT1011FROMZFIT1011WHEREBUKRSINS_BUKRSORNODID=GI.IFS_BUKRSISNOTINITIAL.LOOPATGT_ZFIT1011ASSIGNINGWHEREBUKRSISINITIAL.-DWNOD=S_BUKRS-LOW.ENDLOOP.ENDIF.IFGT_ZFIT1011ISINITIAL.MESSAGE請先維護資

31、金層次維護表:ZFIT1011TYPESDISPLAYLIKEE.LEAVELIST-PROCESSING.ENDIF.*權限檢查AUTHORITY-CHECKOBJECTF_BKPF_BUKIDBUKRSFIELDS_BUKRS-LOW.IFSY-SUBRC0.MESSAGES055(ZFI)DISPLAYLIKEE.EXIT.ENDIF.CALLSCREEN100.*&*&包含ZFIR_1026_O01*&*&*&ModuleSTATUS_0100OUTPUT*&*text*MODULESTATUS_0100OUTPUT.*SETPF-STATUS0100.*SETTITLEBAR0100

32、.PERFORMFRM_BUILT_ALV_100.ENDMODULE.STATUS_0100OUTPUT*&*&ModuleSTATUS_0200OUTPUT*&*text*MODULESTATUS_0200OUTPUT.*SETPF-STATUSxxxxxxxx.*SETTITLEBARxxx.DATA:L_TOPTYPEI,L_LASTTYPEI.DATA:INDICATOR(100)TYPECVALUE正在寫入,請等待.SETPF-STATUSEXCEL_PF.PERFORMFRM_CREATE_BASIC_OBJECT.PERFORMPROGRESS_INDICATORUSINGIN

33、DICATOR.LOOPATIT_TAB.ITAB=IT_TAB-TABCONTENT.PERFORMFRM_SET_CELL.ENDLOOP.PERFORMFRM_SET_GROUPCHANGINGGT_HIERARCHY.*高度寬度自適應5CALLMETHODDOCUMENT-EXECUTE_MACROEXPORTINGMACRO_STRING=module.Macro1.ENDMODULE.STATUS_0200OUTPUT*&*&包含ZFIR_1026_I01*&*&*&ModuleUSER_COMMAND_0100INPUT*&*text*MODULEUSER_COMMAND_010

34、0INPUT.CASESY-UCOMM.WHEN&F03.LEAVETOSCREEN0.WHEN&F15OR&F12.LEAVEPROGRAM.WHENEXPORT.PERFORMFRM_EXCEL_OUTPUT.WHENOTHERS.ENDCASE.CALLMETHODCL_GUI_CFW=FLUSH.CLEAR:SY-UCOMM.ENDMODULE.USER_COMMAND_0100INPUT*&*&ModuleUSER_COMMAND_0200INPUT*&*text*MODULEUSER_COMMAND_0200INPUT.CASESY-UCOMM.WHENBACK.CALLMETHO

35、DCL_GUI_CFW=FLUSH.CALLMETHODCL_GUI_CFW=DISPATCH.FREE:CONTROL,DOCUMENT,ERROR,BDS_INSTANCE,SPREADSHEET.REFRESH:DOC_COMPONENTS,DOC_URIS,DOC_SIGNATURE.CLEAR:INITIALIZED.CALLMETHODCONTAINER-FREE.CALLMETHODSPLITTER-FREE.LEAVETOSCREEN0.WHENEXIT.IFNOTDOCUMENTISINITIAL.CALLMETHODDOCUMENT-CLOSE_DOCUMENT.FREED

36、OCUMENT.ENDIF.IFNOTCONTROLISINITIAL.CALLMETHODCONTROL-DESTROY_CONTROL.FREECONTROL.ENDIF.LEAVEPROGRAM.WHENSAVE.CLEARFILENAME.CALLFUNCTIONF4_FILENAMEEXPORTING*PROGRAM_NAME=SYST-CPROG*DYNPRO_NUMBER=SYST-DYNNRFIELD_NAME=FILENAMEIMPORTINGFILE_NAME=FILENAME.CALLMETHODDOCUMENT-SAVE_COPY_ASEXPORTINGFILE_NAM

37、E=FILENAMENO_FLUSH=XPROMPT_USER=IMPORTINGRETCODE=RETCODE.IFSY-SUBRC=0.MESSAGE保存成功!TYPES.LEAVETOSCREEN0.ELSE.CALLMETHODC_OI_ERRORS=SHOW_MESSAGEEXPORTINGTYPE=E.ENDIF.ENDCASE.ENDMODULE.USER_COMMAND_0200INPUT*&*&包含ZFIR_1026_F01*&*&*&FormFRM_BUILT_ALV_100*&*text*-p1text*-p2text*FORMFRM_BUILT_ALV_100.DATA

38、:LS_HEADERTYPETREEV_HHDR,LS_EVENTTYPECNTL_SIMPLE_EVENT,LT_EVENTSTYPECNTL_SIMPLE_EVENTS.DATA:LV_TITLEBARTYPESTRING.*lv_titlebar=銀行賬戶余額日報表(&s_budat-low&-&s_budat-high&).LV_TITLEBAR=銀行賬戶余額日報表.SETPF-STATUS0100.SETTITLEBAR0001WITHLV_TITLEBAR.IFGC_CCONTAINER100ISINITIAL.CREATEOBJECTGC_CCONTAINER100EXPORTI

39、NGCONTAINER_NAME=GV_CONT_100EXCEPTIONSCNTL_ERROR=1CNTL_SYSTEM_ERROR=2CREATE_ERROR=3LIFETIME_ERROR=4LIFETIME_DYNPRO_DYNPRO_LINK=5OTHERS=6.IFSY-SUBRC0.MESSAGEIDSY-MSGIDTYPESY-MSGTYNUMBERSY-MSGNOWITHSY-MSGV1SY-MSGV2SY-MSGV3SY-MSGV4.ENDIF.*setupthehierarchyheaderLS_HEADER-HEADING=銀行賬戶日報表.headingLS_HEADE

40、R-WIDTH=40.width:30characters*createatreecontrolCREATEOBJECTGO_TREE100EXPORTINGPARENT=GC_CCONTAINER100NODE_SELECTION_MODE=CL_GUI_COLUMN_TREE=NODE_SEL_MODE_SINGLEITEM_SELECTION=XHIERARCHY_COLUMN_NAME=NODIDHIERARCHY_HEADER=LS_HEADEREXCEPTIONSCNTL_SYSTEM_ERROR=1CREATE_ERROR=2FAILED=3ILLEGAL_NODE_SELECT

41、ION_MODE=4ILLEGAL_COLUMN_NAME=5LIFETIME_ERROR=6.IFSY-SUBRC0.*MESSAGEa000.ENDIF.*add*createobjectIFGO_APPLICATIONISINITIAL.CREATEOBJECTGO_APPLICATIONEXPORTINGHANDLE=GO_TREE100CB_NODE_DOUBLE_CLICK=X.ENDIF.*assigneventhandlersintheapplicationclasstoeachdesiredeventheaderclickCLEAR:LT_EVENTS,LS_EVENT.LS

42、_EVENT-EVENTID=CL_GUI_COLUMN_TREE=EVENTID_ITEM_DOUBLE_CLICK.LS_EVENT-APPL_EVENT=X.APPENDLS_EVENTTOLT_EVENTS.CALLMETHODGO_TREE100-SET_REGISTERED_EVENTSEXPORTINGEVENTS=LT_EVENTSEXCEPTIONSCNTL_ERROR=1CNTL_SYSTEM_ERROR=2ILLEGAL_EVENT_COMBINATION=3.IFSY-SUBRC0.*MESSAGEA000.ENDIF.IFGO_APPLICATIONISNOTINIT

43、IAL.SETHANDLERGO_APPLICATION-HANDLE_ITEM_DOUBLE_CLICKFORGO_TREE100.ENDIF.*add*builddataPERFORMBUILD_NODE_AND_ITEM_TABLEUSINGGT_ZFIT1011CHANGINGGT_NODE_TABGT_ITEM_TAB.*-為tree添加節(jié)點CALLMETHODGO_TREE100-ADD_NODES_AND_ITEMSEXPORTINGNODE_TABLE=GT_NODE_TABITEM_TABLE=GT_ITEM_TABITEM_TABLE_STRUCTURE_NAME=DEMO

44、_ITEMEXCEPTIONSFAILED=1CNTL_SYSTEM_ERROR=3ERROR_IN_TABLES=4DP_ERROR=5TABLE_STRUCTURE_NAME_NOT_FOUND=6.CALLMETHODGO_TREE100-EXPAND_ROOT_NODES*EXPORTING*level_count=*expand_subtree=EXCEPTIONSFAILED=1ILLEGAL_LEVEL_COUNT=2CNTL_SYSTEM_ERROR=3OTHERS=4.IFSY-SUBRC0.*ImplementsuitableerrorhandlinghereENDIF.C

45、ALLMETHODCL_GUI_CFW=FLUSH.ENDIF.ENDFORM.FRM_BUILT_ALV_100*&*&FormFRM_BUILD_FIELDCAT*&*text*-p1text*P_LV_NAMEtext*-P_LV_TEXTtext*FORMFRM_ADD_COLUMNUSINGPV_NAMETYPETV_ITMNAMEPV_TEXTTYPETV_HEADING.DATA:LV_NUMTYPEI.DATA:LV_TEXTTYPETV_HEADING.CALLMETHODGO_TREE100-ADD_COLUMNEXPORTINGNAME=PV_NAME*HIDDEN=*D

46、ISABLED=ALIGNMENT=2WIDTH=40*WIDTH_PIX=X*HEADER_IMAGE=HEADER_TEXT=PV_TEXT*HEADER_TOOLTIP=EXCEPTIONSCOLUMN_EXISTS=1ILLEGAL_COLUMN_NAME=2TOO_MANY_COLUMNS=3ILLEGAL_ALIGNMENT=4DIFFERENT_COLUMN_TYPES=5CNTL_SYSTEM_ERROR=6FAILED=7PREDECESSOR_COLUMN_NOT_FOUND=8OTHERS=9.IFSY-SUBRC0.*Implementsuitableerrorhand

47、linghereENDIF.GT_CULUMN-NAME=PV_NAME.GT_CULUMN-TEXT=PV_TEXT.APPENDGT_CULUMN.CLEARGT_CULUMN.ENDFORM.FRM_ADD_COLUMN*&*&FormBUILD_NODE_AND_ITEM_TABLE*&*text*-P_GT_ZFIT1011text*-P_GT_NODE_TABtext*-P_GT_ITEM_TABtext*FORMBUILD_NODE_AND_ITEM_TABLEUSINGIT_TABTYPETT_ZFIT1011CHANGINGCT_NODETYPETREEV_NTABCT_IT

48、EMTYPETT_DEMO_ITEM.DATA:LS_TABTYPETY_TAB,LS_NODETYPETREEV_NODE,LS_ITEMTYPETY_DEMO_ITEM.DATA:LV_UPNODTYPEZFIUPNOD.REFRESH:GT_TAB,R_BUKRS.CLEARLV_UPNOD.PERFORMFRM_BUILD_FIELDCAT.添加列*用遞歸獲取樹結構數(shù)據(jù)GV_FLAG=X.第一次要排除同級節(jié)點PERFORMFRM_COLLECT_NODEUSINGEV_REGCTCHANGINGIT_TAB.*整理業(yè)務數(shù)據(jù)PERFORMFRM_SUBROUTINES.*根節(jié)點LOOPA

49、TGT_TABINTOLS_TABWHERENODID=EV_REGCT.LS_NODE-NODE_KEY=EV_REGCT.LS_NODE-RELATKEY=.LS_NODE-ISFOLDER=ABAP_TRUE.LS_NODE-EXPANDER=ABAP_TRUE.APPENDLS_NODETOCT_NODE.CLEAR:LS_NODE.LS_ITEM-ITEM_NAME=NODID.LS_ITEM-NODE_KEY=LS_TAB-NODID.LS_ITEM-CLASS=2.2text;3checkbox;4button;5linkLS_ITEM-EDITABLE=.*modifybyti

50、anhaiguangon20130422.*ls_item-text=ls_tab-nodid&ls_tab-ndtxt.CONCATENATELS_TAB-NODIDLS_TAB-NDTXTINTOLS_ITEM-TEXTSEPARATEDBYSPACE.*endmodifyAPPENDLS_ITEMTOCT_ITEM.CLEAR:LS_ITEM.CLEAR:LS_TAB-ZJLB,LS_TAB-KHHT.PERFORMFRM_ADD_DATAUSINGLS_TABCHANGINGCT_NODECT_ITEM.ENDLOOP.*SORTGT_TABBYNODIDUPNODRCFLGDESCE

51、NDING.dwnodnxtnd.LOOPATGT_TABINTOLS_TABWHEREUPNODISNOTINITIAL.判斷當前層的上一級是否存在READTABLEGT_TABWITHKEYNODID=LS_TAB-UPNODTRANSPORTINGNOFIELDS.IFSY-SUBRC0.CONTINUE.ENDIF.判斷當前層的下一級是否存在READTABLEGT_TABWITHKEYUPNOD=LS_TAB-NODIDTRANSPORTINGNOFIELDS.IFSY-SUBRC=0.LS_NODE-ISFOLDER=ABAP_TRUE.ELSE.LS_NODE-ISFOLDER=A

52、BAP_FALSE.ENDIF.LS_NODE-NODE_KEY=LS_TAB-NODID.LS_NODE-RELATKEY=LS_TAB-UPNOD.*ls_node-n_image=5B.*ls_node-exp_image=5B.APPENDLS_NODETOCT_NODE.CLEAR:LS_NODE.*LS_ITEM-ITEM_NAME=NODID.LS_ITEM-NODE_KEY=LS_TAB-NODID.LS_ITEM-CLASS=2.cl_gui_column_tree=item_class_checkbox.2text;3checkbox;4button;5link*ls_it

53、em-editable=X.*modifybytianhaiguangon20130422.*ls_item-text=ls_tab-nodid&-&ls_tab-ndtxt.IFLS_TAB-BANKAISINITIAL.CONCATENATELS_TAB-NODIDLS_TAB-NDTXTINTOLS_ITEM-TEXTSEPARATEDBYSPACE.ELSE.LS_ITEM-TEXT=LS_TAB-NDTXT.ENDIF.*endmodify.COLLECTLS_ITEMINTOCT_ITEM.CLEAR:LS_ITEM.IFLS_TAB-BCJNRISINITIAL.CLEAR:LS

54、_TAB-ZJLB,LS_TAB-KHHT.ENDIF.PERFORMFRM_ADD_DATAUSINGLS_TABCHANGINGCT_NODECT_ITEM.ENDLOOP.ENDFORM.BUILD_NODE_AND_ITEM_TABLE*&*&FormFRM_COLLECT_NODE*&*text*-P_EV_REGCTtext*p1text*p1text*-p2text*FORMFRM_DATA_GET.DATA:LV_DATETYPESY-DATUM.DATA:LV_TABIXTYPESY-TABIX.REFRESH:GT_TCJ_POSITIONS,GT_TCJ_DOCUMENT

55、S,GT_TCJ_TRANSACTIONS,GT_TCJ_TRANS_NAMES,GT_BNKA.*確定日期IFS_BUDAT-HIGHISNOTINITIAL.LV_DATE=S_BUDAT-HIGH.ELSE.LV_DATE=S_BUDAT-LOW.ENDIF.IFGT_T001ISNOTINITIAL.SELECT*INTOCORRESPONDINGFIELDSOFTABLEGT_TCJ_DOCUMENTSFROMTCJ_DOCUMENTSASAINNERJOINT012KASBONBBCJNR=ACAJO_NUMBERANDACOMP_CODE=BBUKRSFORALLENTRIESI

56、NGT_T001WHEREACOMP_CODEINS_BUKRSANDACOMP_CODE=GT_T001-BUKRSANDAPOSTING_DATE=LV_DATE*ANDaposting_dateINs_budat*AND(adocument_status=P*ORadocument_status=R).ANDADOCUMENT_STATUS=S.*ANDBFUNACINS_FUNAC*ANDbhbkidINs_hbkid.ELSE.SELECT*INTOCORRESPONDINGFIELDSOFTABLEGT_TCJ_DOCUMENTSFROMTCJ_DOCUMENTSASAINNERJ

57、OINT012KASBONBBCJNR=ACAJO_NUMBERANDACOMP_CODE=BBUKRSWHEREACOMP_CODEINS_BUKRSANDAPOSTING_DATE=LV_DATE*ANDaposting_dateINs_budatANDADOCUMENT_STATUS=S.*AND(adocument_status=P*ORadocument_status=R).*ANDBFUNACINS_FUNAC*ANDbhbkidINs_hbkid.ENDIF.IFGT_TCJ_DOCUMENTSISNOTINITIAL.*SELECT*INTOCORRESPONDINGFIELD

58、SOFTABLEgt_tcj_positionsFROMtcj_positions現(xiàn)金日記帳憑證項目*FORALLENTRIESINgt_tcj_documents*WHEREcomp_code=gt_tcj_documents-comp_code*ANDcajo_number=gt_tcj_documents-cajo_number*ANDfisc_year=gt_tcj_documents-fisc_year*ANDposting_number=gt_tcj_documents-posting_number*AND(transact_type=EORtransact_type=R).*代碼

59、優(yōu)化SELECT*INTOCORRESPONDINGFIELDSOFTABLEGT_TCJ_POSITIONSFROMTCJ_POSITIONS現(xiàn)金日記帳憑證項目WHERECOMP_CODEINR_BUKRS*ANDposting_dateINs_budatANDPOSTING_DATEp1text*-p2text*FORMFRM_DATA_PROCESS.DATA:LV_TABIXTYPESY-TABIX,LV_TABIX1TYPESY-TABIX,LV_TABIX2TYPESY-TABIX,LV_TABIX3TYPESY-TABIX,LV_CJAMOUNTTYPECJAMOUNT,LV_U

60、PNODTYPEZFIUPNOD.DATALS_T012KTYPET012K.DATA:LV_AWKEYTYPEAWKEY,LS_BKPFTYPEBKPF,LS_FAGLFLEXATYPEFAGLFLEXA.DATA:LT_TCJ_CJ_NAMESTYPETABLEOFTCJ_CJ_NAMES,LS_TCJ_CJ_NAMESTYPETCJ_CJ_NAMES.REFRESHWT_TAB.CLEAR:GS_TAB,LV_CJAMOUNT.REFRESHLT_TCJ_CJ_NAMES.SELECT*INTOTABLELT_TCJ_CJ_NAMESFROMTCJ_CJ_NAMESWHERELANGU=

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論