版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.26.27.28.29.30.31.程序代碼:TYPE-POOLS:vimty.TYPES:BEGINOFty_mod,rowTYPEi,ENDOFty_mod.DATA:g_containergrid1TYPEscrfnameVALUE'CUSTOM_CONTAINERTYPEREFTOcl_gui_alv_grid,g_custom_containerTYPEREFTOcl_gui_custom_container.DATA:i_tableTYPEREFTOdata,wa_allTYPEREFTOdata.DATA:org_crit_instTYPEvimty_oc_type,old_rcLIKEsy-subrc,act_levelLIKEauthb-actvt,only_show_allowedTYPEc,i_excludeTYPEui_functions.DATA:i_modTYPESTANDARDTABLEOFty_mod,i_delTYPESTANDARDTABLEOFty_mod.FIELD-SYMBOLS:<i_itab>TYPEtable,<wa_tab>TYPEANY.DATA:BEGINOFheaderOCCURS1.INCLUDESTRUCTUREvimdesc.DATA:ENDOFheader.DATA:BEGINOFnamtabOCCURS50.INCLUDESTRUCTUREvimnamtabDATA:ENDOFnamtab.
DATA:vim_wheretabLIKEvimwheretbOCCURS10.DATA:dba_sellistLIKEvimsellistOCCURS10.SELECTION-SCREENBEGINOFBLOCKbbWITHFRAMETITLEtext-100PARAMETER:viewnameTYPEtvdir-tabname.SELECTION-SCREENSKIP2.SELECTION-SCREENBEGINOFLINE."Display"Change"Display"ChangeSELECTION-SCREEN PUSHBUTTON36(10) text-102 USER-COMMAND b2.SELECTION-SCREEN ENDOFLINE.SELECTION-SCREEN ENDOFBLOCKbb.42.ATSELECTION-SCREEN.CASEsy-ucomm.WHEN'B1'.SETPF-STATUS'ALV'.CALLSCREEN9001.WHEN'B2'.SETPF-STATUS'ALV1'.CALLSCREEN9001.ENDCASE.*ClassusedtogetchangeddataCLASSlcleventhandlerDEFINITION.PUBLICSECTION.METHODS:handle_data_changedFOREVENTdata_changedOFcl_gui_alv_gridIMPORTINGer_data_changed.ENDCLASS. "lcl_event_handlerDEFINITION*ClassusedtogetchangeddataCLASSlcl_event_handlerIMPLEMENTATION.*HandleDataChangedMETHODhandle_data_changed.63.PERFORMhandle_data_changedUSINGer_data_changed.63.64.65.66.67.68.69.70.71.72.73.74.75.76.77.78.79.80.81.82.83.84.85.86.87.88.89.90.91.92.93.94.95.ENDCLASS."lcleventhandlerIMPLEMENTATIONENDCLASS.*&*&*&ModuleSTATUS9001OUTPUT*&textMODULEstatus9001OUTPUT.DATA:lifieldcatTYPElvctfcat.DATA:lwafieldcatTYPElvcsfcat.DATA:lh_flag(1).DATA:gr_event_handlerTYPEREFTOlcl_event_handler.handlerCreatinganinstancefortheeventhandlerCREATEOBJECTgr_event_handler.TRY.CREATEDATAitableTYPETABLEOF(viewname).ASSIGNitable-CREATEDATAitableTYPETABLEOF(viewname).ASSIGNitable-〉*TO<iitab>.CREATEDATAwaallLIKELINEOF<iitab>.CREATEDATAwaallLIKELINEOF<iitab>.ASSIGNwaall->*TO<watab>.ASSIGNwaall->*TO<watab>.SelectingdatadynamicallySELECT*FROM(viewname)INTOTABLE<i_itab>.BuildingthefieldcatelogCALLFUNCTION'LVCFIELDCATALOGMERGE'EXPORTINGistructurename=viewnameistructurename=viewnameCHANGINGctfieldcat=lifieldcatEXCEPTIONSinconsistentinterface=1program_error3.OTHERS3.96.IFsy-subrc<>0.97.MESSAGEIDsy-msgidTYPEsy-msgtyNUMBERsy-msgno98.WITHsy-msgv1sy-msgv2sy-msgv3sy-msgv4.99.ENDIF.100.*Makingfieldseditableexceptkeyfields101.IFsy-ucomm='UPD'ORsy-ucomm='CHANGE'.102.LOOPATli_fieldcatINTOlwa_fieldcat.103.IFlwa_fieldcat-key=space.104.lwa_fieldcat-edit='X'.105.MODIFYli_fieldcatFROMlwa_fieldcat.106.ENDIF.107.ENDLOOP.108.ENDIF.109.*Makingfieldseditable110.IFsy-ucomm='NEW'.111.LOOPATli_fieldcatINTOlwa_fieldcat.112.lwa_fieldcat-edit='X'.113.MODIFYli_fieldcatFROMlwa_fieldcat.114.ENDLOOP.115.lh_flag='X'.116.CLEAR:<i_itab>.117.DO100TIMES.118.APPEND<wa_tab>TO<i_itab>.119.ENDDO.120.ENDIF.121.*Excludebuttons122.PERFORMexclude_tb_functionsCHANGINGi_exclude.123.IFg_custom_containerISINITIAL.124.CREATEOBJECTg_custom_container125.EXPORTING126.container_name=g_container.127.CREATEOBJECTgrid1
128.EXPORTING129.i_parent=g_custom_container.130.ENDIF.131.*Makingallfieldsnon-editableifdisplaymode132.IFsy-ucomm='SHOW'.133.LOOPATli_fieldcatINTOlwa_fieldcat.134.lwa_fieldcat-edit=''.135.MODIFYli_fieldcatFROMlwa_fieldcat.136.ENDLOOP.137.ENDIF.138.IFsy-ucomm='SAVE'.139.LOOPATli_fieldcatINTOlwa_fieldcat.140.IFlwa_fieldcat-keyNEspace.141.lwa_fieldcat-edit=space.142.MODIFYli_fieldcatFROMlwa_fieldcat.143.ENDIF.144.ENDLOOP.145.ENDIF.146.*DisplayingALVGrid147.CALLMETHODgrid1->set_table_for_first_display148.EXPORTING149.i_structure_name =viewname150.it_toolbar_excluding=i_exclude151.CHANGING152.it_outtab =<i_itab>153.it_fieldcatalog =li_fieldcat.154.IFsy-subrcNE0.155.EXIT.156.ENDIF.157.*Gettingthechangeddata158.SETHANDLERgr_event_handler->handle_data_changedFORgrid1.159.CATCHcx_sy_create_data_error.ENDTRY.ENDMODULE.*&"STATUS9001OUTPUT160.161.162.163.164.165.166.167.168.169.170.171.172.173.174.175.176.177.178.179.180.181.182.183.184.185.186.187.188.189.190.191.*&*&ModuleUSERCOMMAND9001INPUT*&textMODULEusercommand9001INPUT.DATA:lhnorecTYPEi,lh_total(5)TYPEc,lh_succ(40)TYPEc,lwadelTYPEty_mod,lhnorecTYPEi,lh_total(5)TYPEc,lh_succ(40)TYPEc,lwadelTYPEty_mod,lh_totdelTYPEi.*lh_flagTYPEc,*li_fieldcatTYPElvc_t_fcat,*lwa_fieldcatTYPElvc_s_fcat.lwamodty_mod,TYPECASEsy-ucomm.WHEN'CHANGE'.SETPF-STATUS'ALV1'.WHEN'SAVE'.LockthetableCALLFUNCTION'ENQUEUE_E_TABLE'EXPORTINGmoderstable'E'tabname=viewnameEXCEPTIONSforeign_locksystem_failure=23.OTHERS3.IFsy-subrc<>0.
192.193.192.193.194.195.196.197.198.199.200.201.202.*204.205.206.207.208.209.210.211.212.*214.215.216.217.218.*220.221.*222.WITHsy-msgv1sy-msgv2sy-msgv3sy-msgv4.ENDIF.IFNOTgrid1ISINITIAL.CALLMETHODgrid1->check_changed_data.ENDIF.SORTi_modBYrow.DELETEADJACENTDUPLICATESFROMi_modCOMPARINGrow.lh_norec=LINES(i_mod).lh_total=lh_norec.SHIFTlh_totalLEFTDELETINGLEADINGspace.StandardTableUpdateIFi_mod[]ISNOTINITIAL.LOOPATi_modINTOlwa_mod.READTABLE<i_itab>INTO<wa_tab>INDEXlwa_mod-row.IFsy-subrc=0.IFlh_flagNE'X'.MODIFY(viewname)FROM<wa_tab>.ELSE.INSERT(viewname)FROM<wa_tab>.IFsy-subrcNE0.MESSAGEe009.ENDIF.ENDIF.ENDIF.ENDLOOP.CONCATENATElh_total' 'text-S01INTOlh_succSEPARATEDBYMESSAGEi000WITHlh_succ.ELSE.MESSAGEi000WITHtext-S02.space.ENDIF.space.223.*Unlockthetable224.225.226.227.228.229.230.231.232.233.234.235.236.237.238.239.240.241.242.243.244.245.246.247.248.249.250.251.252.253.254.255.CALLFUNCTION'DEQUEUE_E_TABLE'EXPORTINGmode_rstable='E'tabname =viewname.CLEAR:i_mod[],lh_flag.WHEN'DELETE'.SelectingSelectedRowsPERFORMhandle_user_commandUSINGsy-ucomm.IFi_del[]ISNOTINITIAL.LOOPATi_delINTOlwa_del.del-row.READTABLE<i_itab>INTO<wa_tab>INDEXlwadel-row.IFsy-subrc=0.DELETE(viewname)FROM<wa_tab>.ENDIF.ENDLOOP.lh_totdel=LINES(i_del).MESSAGEi011WITHlh_totdel.CLEAR:i_del[],lh_totdel.ELSE.MESSAGEi000WITHtext-S03.ENDIF.WHEN'EXIT'OR'BACK'OR'CANCEL'.CLEAR:li_fieldcat[],i_exclude[],i_del[],lh_totdel.LEAVETOSCREEN0.ENDCASE.ENDMODULE."USERCOMMAND9001INPUT*& **& Formhandle_data_changed*& *FORMhandle_data_changedUSING p_er_data_changedTYPEREFTOcl_alv_changed_data_protocol.DATA:lwa_mod_cell TYPE lvc_s_modi,lwa_mod TYPE ty_mod.LOOPATp_er_data_changed->mt_good_cellsINTOlwa_mod_cell.lwa_mod-row =lwa_mod_cell-row_id.APPENDlwa_modTO i_mod.ENDLOOP.ENDFORM. "handle_data_changed*& **& Formexclude_tb_functions*& *FORMexclude_tb_functionsCHANGINGpt_excludeTYPEui_functions.DATA:lwa_excludeTYPEui_func.lwa_exclude=cl_gui_alv_grid=>mc_fc_loc_append_row.APPENDlwa_excludeTOpt_exclude.lwa_exclude=cl_gui_alv_grid=>mc_fc_loc_copy.APPENDlwa_excludeTOpt_exclude.lwa_exclude=cl_gui_alv_grid=>mc_fc_loc_copy_row.APPENDlwa_excludeTOpt_exclude.lwa_exclude=cl_gui_alv_grid=>mc_fc_loc_cut.APPENDlwa_excludeTOpt_exclude.lwa_exclude=cl_gui_alv_grid=>mc_fc_loc_delete_row.APPENDlwa_excludeTOpt_exclude.lwa_exclude=cl_gui_alv_grid=>mc_fc_loc_insert_row.APPENDlwa_excludeTOpt_exclude.lwa_exclude=cl_gui_alv_grid=>mc_fc_loc_move_row.
APPENDlwa_excludeTOpt_exclude.lwa_exclude=cl_gui_alv_grid=>mc_fc_loc_paste.APPENDlwa_excludeTOpt_exclude.lwa_exclude=cl_gui_alv_grid=>mc_fc_loc_paste_new_row.APPENDlwa_excludeTOpt_exclude.ENDFORM. "exclude_tb_functions*& **& Formhandle_user_command*& *FORMhandle_user_commandUSINGp_ucommTYPEsyucomm.DATA:i_selected_rows TYPE lvc_t_roid.DATA:lwa_selected_row TYPE lvc_s_roid,lwa_del TYPE ty_mod.CALLMETHODgrid1->get_selected_rowsIMPORTINGet_row_no=i_selected_rows.LOOPATi_selected_rowsINTOlwa_selected_row.lwa_del-row=lwa_selected_row-row_id.APPENDlwa_delTOi_del.ENDLOOP.ENDFORM. "handle_user_command復(fù)制代碼PS:1、 container名稱:CUSTOM_CONTAINER2、 創(chuàng)建PFStatus——“ALV”“ALVT
Textsymbols 5已I已ctioritExfcs 'LjtHeadings4、創(chuàng)建4、創(chuàng)建T-code-SE93Textd...m…H100OMhJ5 *101Lusplay17 ■102Change66SOIRazord(S)Saved1
溫馨提示
- 1. 本站所有資源如無(wú)特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2023年國(guó)家公務(wù)員錄用考試《申論》真題(地市卷)及答案解析
- 中班 秋天課件
- 2024年1月福建省普通高中學(xué)業(yè)水平合格性考試化學(xué)試題(原卷版)
- 社區(qū)少先隊(duì)課件
- 蘇教版科學(xué)課件
- 西南林業(yè)大學(xué)《材料研究及分析方法實(shí)驗(yàn)》2022-2023學(xué)年第一學(xué)期期末試卷
- 西京學(xué)院《新媒體短視頻運(yùn)營(yíng)實(shí)訓(xùn)》2023-2024學(xué)年第一學(xué)期期末試卷
- 西京學(xué)院《前端開發(fā)技術(shù)》2021-2022學(xué)年期末試卷
- 頜下腺結(jié)石課件
- 西京學(xué)院《句法學(xué)概論》2022-2023學(xué)年期末試卷
- 遼寧交投物產(chǎn)有限責(zé)任公司招聘筆試題庫(kù)2024
- 合肥包河區(qū)人力資源開發(fā)有限公司招聘筆試題庫(kù)2024
- 4.2.2指數(shù)函數(shù)的圖像和性質(zhì)教學(xué)說課課件高一上學(xué)期數(shù)學(xué)人教A版
- 肺結(jié)節(jié)診治中國(guó)專家共識(shí)(2024年版)解讀
- GB/T 44464-2024汽車數(shù)據(jù)通用要求
- 2024-2025一年級(jí)上冊(cè)科學(xué)教科版1.6《校園里的植物》課件
- 統(tǒng)編版(2024新版)七年級(jí)上冊(cè)道德與法治第九課第一框《增強(qiáng)安全意識(shí)》教學(xué)設(shè)計(jì)
- 老舊小區(qū)整體改造施工投標(biāo)方案(技術(shù)標(biāo))
- 新湘教版八年級(jí)上數(shù)學(xué)復(fù)習(xí)計(jì)劃
- GB/T 44200-2024建筑垃圾再生骨料生產(chǎn)成套裝備技術(shù)要求
- 幼兒園小班科學(xué)活動(dòng)《小手摸一摸》課件
評(píng)論
0/150
提交評(píng)論