Aedat

数据集

http://dvsact16.s3.wasabisys.com/data-list.html?sort=lastmod&sortdir=desc
http://www2.imse-cnm.csic.es/caviar/MNISTDVS.html
http://research.ibm.com/dvsgesture/
http://rpg.ifi.uzh.ch/davis_data.html

with

with open(aedat[‘importParams’][‘filePath’], ‘rb’) as aedat[‘importParams’][‘fileHandle’]:

with open(‘file_name’,‘r’) as f:
r=f.read()

字典

adeat = {}
adeat[“importParams”] = {}

读取文件

is_comment = ‘#’ in str(fileHandle.read(1))

report zz . tables : ekko, ekpo. data : gt_ekko type standard table of ekko, "po header gs_ekko type ekko, gt_ekpo type standard table of ekpo, "po item gs_ekpo type ekpo. "varaibles data : gv_ebelp type ekpo-ebelp, gv_max_ebelp type ekpo-ebelp. "for dynamic table field-symbols : <dyn_table> type table, <dyn_wa> type any, <dyn_field> type any, <fs1>. * Create the dynamic internal table *data : NEW_TABLE TYPE REF TO DATA, * NEW_LINE TYPE REF TO DATA. data: fieldname(20) type c, fieldvalue(60) type c. data: it_fldcat type lvc_t_fcat, wa_fldcat type lvc_s_fcat, gs_layout1 type lvc_s_layo. "slis_layout_alv, select-options s_ebeln for ekko-ebeln. select-options s_aedat for ekko-aedat. select-options s_bsart for ekko-bsart. start-of-selection. perform get_data. perform build_dynamic_table. perform build_data. perform alv_display. end-of-selection. *&---------------------------------------------------------------------* *& Form GET_DATA *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text * <-- p2 text *----------------------------------------------------------------------* form get_data . "select header data select * from ekko into corresponding fields of table gt_ekko where ebeln in s_ebeln and aedat in s_aedat and bsart in s_bsart. "select line item if not gt_ekko[] is initial. select * from ekpo into corresponding fields of table gt_ekpo for all entries in gt_ekko where ebeln = gt_ekko-ebeln. sort gt_ekpo descending by ebelp. clear : gs_ekpo. read table gt_ekpo into gs_ekpo index 1. gv_max_ebelp = gs_ekpo-ebelp. sort gt_ekpo by ebeln ebelp. endif. endform. *&---------------------------------------------------------------------* *& Form BUILD_DYNAMIC_TABLE *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text * <-- p2 text *----------------------------------------------------------------------* form build_dynamic_table . data: wa_fldcat type lvc_s_fcat, it_fldcat type lvc_t_fcat. clear wa_fldcat. wa_fldcat-fieldname = 'EBELN'. wa_fldcat-coltext = 'PO No.'. wa_fldcat-datatype = 'CHAR'. wa_fldcat-outputlen = '10'. wa_fldcat-emphasize = 'C5'. append wa_fldcat to it_fldcat. gv_ebelp = 10. do. clear wa_fldcat. concatenate gv_ebelp '_MATNR' into wa_fldcat-fieldname. concatenate 'Material Code_' gv_ebelp into wa_fldcat-coltext. wa_fldcat-datatype = 'CHAR'. wa_fldcat-outputlen = '18'. wa_fldcat-no_zero = 'X'. append wa_fldcat to it_fldcat. clear wa_fldcat. concatenate gv_ebelp '_TXZ01' into wa_fldcat-fieldname. wa_fldcat-coltext = 'Description'. wa_fldcat-datatype = 'CHAR'. wa_fldcat-outputlen = '40'. append wa_fldcat to it_fldcat. clear wa_fldcat. concatenate gv_ebelp '_MENGE' into wa_fldcat-fieldname. wa_fldcat-coltext = 'Quantity'. wa_fldcat-datatype = 'CURR'. append wa_fldcat to it_fldcat. clear wa_fldcat. concatenate gv_ebelp '_NETWR' into wa_fldcat-fieldname. wa_fldcat-coltext = 'Amount'. wa_fldcat-datatype = 'CURR'. append wa_fldcat to it_fldcat. if gv_ebelp = gv_max_ebelp. exit. else. gv_ebelp = gv_ebelp + 10. endif. enddo. data: new_table type ref to data, lt_alv_cat type table of lvc_s_fcat, ls_alv_cat like line of lt_alv_cat. call method cl_alv_table_create=>create_dynamic_table exporting * I_STYLE_TABLE = it_fieldcatalog = it_fldcat * I_LENGTH_IN_BYTE = importing ep_table = new_table * E_STYLE_FNAME = exceptions generate_subpool_dir_full = 1 others = 2 . if sy-subrc <> 0. * Implement suitable error handling here endif. assign new_table->* to <dyn_table>. data : new_line type ref to data. * Create dynamic work area and assign to FS create data new_line like line of <dyn_table>. assign new_line->* to <dyn_wa>. endform. *&---------------------------------------------------------------------* *& Form BUILD_DATA *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text * <-- p2 text *----------------------------------------------------------------------* form build_data . sort gt_ekko by ebeln. sort gt_ekpo by ebeln ebelp. loop at gt_ekko into gs_ekko. clear : <dyn_wa>. clear : fieldname, fieldvalue. fieldname = 'EBELN'. fieldvalue = gs_ekko-ebeln. condense fieldvalue. assign component fieldname of structure <dyn_wa> to <fs1>. <fs1> = fieldvalue. loop at gt_ekpo into gs_ekpo where ebeln = gs_ekko-ebeln. clear : fieldname, fieldvalue. concatenate gs_ekpo-ebelp '_MATNR' into fieldname. fieldvalue = gs_ekpo-matnr. condense fieldvalue. assign component fieldname of structure <dyn_wa> to <fs1>. <fs1> = fieldvalue. clear : fieldname, fieldvalue. concatenate gs_ekpo-ebelp '_TXZ01' into fieldname. fieldvalue = gs_ekpo-txz01. condense fieldvalue. assign component fieldname of structure <dyn_wa> to <fs1>. <fs1> = fieldvalue. clear : fieldname, fieldvalue. concatenate gs_ekpo-ebelp '_MENGE' into fieldname. fieldvalue = gs_ekpo-menge. condense fieldvalue. assign component fieldname of structure <dyn_wa> to <fs1>. <fs1> = fieldvalue. clear : fieldname, fieldvalue. concatenate gs_ekpo-ebelp '_NETWR' into fieldname. fieldvalue = gs_ekpo-netwr. condense fieldvalue. assign component fieldname of structure <dyn_wa> to <fs1>. <fs1> = fieldvalue. clear : gs_ekpo. endloop. append <dyn_wa> to <dyn_table>. clear : gs_ekko. endloop. endform. *&---------------------------------------------------------------------* *& Form ALV_DISPLAY *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text * <-- p2 text *----------------------------------------------------------------------* form alv_display . call function 'REUSE_ALV_GRID_DISPLAY_LVC' exporting i_callback_program = sy-repid is_layout_lvc = gs_layout1 it_fieldcat_lvc = it_fldcat[] * I_GRID_SETTINGS = gs_grid * IT_EVENTS = lt_evts[] * IT_EVENTS = I_EVENTS i_default = 'X' i_save = 'A' * IS_VARIANT = GS_VARIANT1 * IMPORTING * E_EXIT_CAUSED_BY_CALLER = * ES_EXIT_CAUSED_BY_USER = tables t_outtab = <dyn_table> exceptions program_error = 1 others = 2. if sy-subrc <> 0. * Implement suitable error handling here endif. 出現 RAISE_EXCEPTION Exception condition "NO_FIELDCATALOG_AVAILABLE" raised. 為何?
最新发布
07-31
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值