ME21N/ME22N/ME23N屏幕增强BADI ME_GUI_PO_CUST
最近想更深入学习下classic BADI, 以前没玩过BADI屏幕增强, 所以决定玩一下.
这次的屏幕增强主要用到两个BADI: ME_GUI_PO_CUST和ME_PROCESS_PO_CUST
这两个BADI都是有例子的, 可以在se18那里按GoTo->Sample code->Display来查看, 也可以直接在SE24查看类CL_EXM_IM_ME_GUI_PO_CUST和CL_EXM_IM_ME_PROCESS_PO_CUST
现在我们对PO header加上自己的subscreen, SAP的例子提供的是对item增加subscreen.
Step 1: Create Function Group
仿照Function Group MEPOBADIEX建一个Function Group
我建的Function Group如下图所示
Step 2: 在Function Group里建Screen, screen number随便
在TOP里面加入对应屏幕的变量, 这里我是直接用tables.
Step 3: 给BADI ME_GUI_PO_CUST建一个implementation
在Public Section里加上TYPE-POOLS mmmfd .
Step 4: 在Method IF_EX_ME_GUI_PO_CUST~SUBSCRIBE, 加入custom subscreen的设置代码
- METHOD if_ex_me_gui_po_cust~subscribe.
- DATA: lw_subscribers TYPE mepo_subscribers.
- * we want to add a customer subscreen on the Header tab
- CHECK im_application = 'PO'.
- CHECK im_element = 'HEADER'.
- CLEAR lw_subscribers.
- lw_subscribers-name = subscreen1.
- lw_subscribers-dynpro = '0100'.
- lw_subscribers-program = 'SAPLZCI_EKKODB'.
- lw_subscribers-struct_name = 'CI_EKKODB'.
- lw_subscribers-label = 'Zero test2'.
- lw_subscribers-position = 11.
- lw_subscribers-height = 8.
- APPEND lw_subscribers TO re_subscribers.
- ENDMETHOD.
METHOD if_ex_me_gui_po_cust~subscribe.
DATA: lw_subscribers TYPE mepo_subscribers. * we want to add a customer subscreen on the Header tab
CHECK im_application = 'PO'.
CHECK im_element = 'HEADER'. CLEAR lw_subscribers.
lw_subscribers-name = subscreen1.
lw_subscribers-dynpro = '0100'.
lw_subscribers-program = 'SAPLZCI_EKKODB'.
lw_subscribers-struct_name = 'CI_EKKODB'.
lw_subscribers-label = 'Zero test2'.
lw_subscribers-position = 11.
lw_subscribers-height = 8.
APPEND lw_subscribers TO re_subscribers.
ENDMETHOD.
Step 5: 在IF_EX_ME_GUI_PO_CUST~MAP_DYNPRO_FIELDS, 加入代码, 使field name和它的数字编号关联起来
- FIELD-SYMBOLS: <mapping> LIKE LINE OF ch_mapping.
- LOOP AT ch_mapping ASSIGNING <mapping>.
- CASE <mapping>-fieldname.
- WHEN 'LV_TEST1'. <mapping>-metafield = mmmfd_cust_01.
- WHEN 'LV_TEST2'. <mapping>-metafield = mmmfd_cust_02.
- WHEN 'LV_TEST3'. <mapping>-metafield = mmmfd_cust_03.
- ENDCASE.
- ENDLOOP.
FIELD-SYMBOLS: <mapping> LIKE LINE OF ch_mapping. LOOP AT ch_mapping ASSIGNING <mapping>.
CASE <mapping>-fieldname.
WHEN 'LV_TEST1'. <mapping>-metafield = mmmfd_cust_01.
WHEN 'LV_TEST2'. <mapping>-metafield = mmmfd_cust_02.
WHEN 'LV_TEST3'. <mapping>-metafield = mmmfd_cust_03.
ENDCASE.
ENDLOOP.
Custom的field估计只能加9个, 因为我在TYPE-POOLS mmmfd看到最大的是mmfd_cust_09,
这里也可以把一些standard field弄到custom subscreen上.
经过以上五步, 我们可以在ME23N看到custom subscreen, 但在ME21N和ME22N依然是看不到的...这个是为什么, 我还搞不清楚.
Step 6: 给BADI ME_PROCESS_PO_CUST建一个implementation
在Public Section加入TYPE-POOLS mmmfd .
Step 7: 在Method IF_EX_ME_PROCESS_PO_CUST~FIELDSELECTION_HEADER加入代码, 改变表ch_fieldselection的field status
'-'代表hidden, '+'或'.'表示editable, '*'代表display
- METHOD if_ex_me_process_po_cust~fieldselection_header.
- DATA: lv_persistent TYPE mmpur_bool.
- FIELD-SYMBOLS: <fs> LIKE LINE OF ch_fieldselection.
- DEFINE set_input.
- read table ch_fieldselection assigning <fs> with table key metafield = &1.
- if sy-subrc = 0.
- if im_header->is_changeable( ) = mmpur_yes.
- <fs>-fieldstatus = '+'.
- else.
- <fs>-fieldstatus = '*'.
- endif.
- endif.
- END-OF-DEFINITION.
- * if the item is already on the database, we disallow to change field badi_bsgru
- lv_persistent = im_header->is_persistent( ).
- set_input mmmfd_cust_01.
- set_input mmmfd_cust_02.
- set_input mmmfd_cust_03.
- ENDMETHOD.
METHOD if_ex_me_process_po_cust~fieldselection_header.
DATA: lv_persistent TYPE mmpur_bool.
FIELD-SYMBOLS: <fs> LIKE LINE OF ch_fieldselection. DEFINE set_input.
read table ch_fieldselection assigning <fs> with table key metafield = &1.
if sy-subrc = 0.
if im_header->is_changeable( ) = mmpur_yes.
<fs>-fieldstatus = '+'.
else.
<fs>-fieldstatus = '*'.
endif.
endif.
END-OF-DEFINITION. * if the item is already on the database, we disallow to change field badi_bsgru
lv_persistent = im_header->is_persistent( ). set_input mmmfd_cust_01.
set_input mmmfd_cust_02.
set_input mmmfd_cust_03. ENDMETHOD.
这里有两点注意下:
1. im_header->is_changeable()可以判断当前这些field是不是处于可编辑状态, 如果是则为'X'. 比如刚进TCODE ME21N, ME22N它们是可编辑的, 但当按save保存成功后, 它们暂时是不可以编辑的, 要再按把它改回编辑状态才可以编辑,这里就实现了这个功能.
2. im_header->is_persistent()可以判断当这些field在数据库里有值了, 它就是'X', 当我们把数据写进表里就不想它被修改时, 可以用这个来判断, 比如把某个field设置成ME21N可编辑, ME22N不可编辑.
经过这七步, ME21N/ME22N/ME23N都可以看到这个custom subscreen, 但所有自建field都是可编辑状态, 必需做完第八步, 才能正常显示
Step 8: 在screen中调用2个module
这两个module存放在下图的程序里
注意: 如果不调用这两个module, BADI ME_GUI_PO_CUST下面的4个method都不会触发
TRANSPORT_FROM_MODEL
TRANSPORT_TO_DYNP
TRANSPORT_FROM_DYNP
TRANSPORT_TO_MODEL
Step 9: 在Method IF_EX_ME_GUI_PO_CUST~TRANSPORT_FROM_MODEL加入代码
把header的三个自建field传到attribute dynp_data_pho里
- METHOD if_ex_me_gui_po_cust~transport_from_model.
- DATA: lw_header TYPE REF TO if_purchase_order_mm,
- lw_mepoheader TYPE mepoheader,
- lw_customer TYPE ci_ekkodb.
- *--------------------------------------------------------------------*
- * system asks to transport data from the business logic into the view
- *--------------------------------------------------------------------*
- IF im_name = subscreen1.
- * is it an Header? im_model can be header or item.
- mmpur_dynamic_cast lw_header im_model.
- CHECK NOT lw_header IS INITIAL.
- * transport standard fields
- lw_mepoheader = lw_header->get_data( ).
- * store info for later use
- MOVE-CORRESPONDING lw_mepoheader TO dynp_data_pbo.
- ENDIF.
- ENDMETHOD.
METHOD if_ex_me_gui_po_cust~transport_from_model.
DATA: lw_header TYPE REF TO if_purchase_order_mm,
lw_mepoheader TYPE mepoheader,
lw_customer TYPE ci_ekkodb.
*--------------------------------------------------------------------*
* system asks to transport data from the business logic into the view
*--------------------------------------------------------------------* IF im_name = subscreen1.
* is it an Header? im_model can be header or item.
mmpur_dynamic_cast lw_header im_model.
CHECK NOT lw_header IS INITIAL.
* transport standard fields
lw_mepoheader = lw_header->get_data( ).
* store info for later use
MOVE-CORRESPONDING lw_mepoheader TO dynp_data_pbo.
ENDIF. ENDMETHOD.
Step 10: 在Method IF_EX_ME_GUI_PO_CUST~TRANSPORT_TO_DYNP加入代码
通过调用FM:ZCI_EKKODB_PUSH 把attribute
- METHOD if_ex_me_gui_po_cust~transport_to_dynp.
- IF im_name = subscreen1.
- CALL FUNCTION 'ZCI_EKKODB_PUSH'
- EXPORTING
- im_dynp_data = dynp_data_pbo.
- ENDIF.
- ENDMETHOD.
METHOD if_ex_me_gui_po_cust~transport_to_dynp. IF im_name = subscreen1.
CALL FUNCTION 'ZCI_EKKODB_PUSH'
EXPORTING
im_dynp_data = dynp_data_pbo.
ENDIF.
ENDMETHOD.
Step 11: 在IF_EX_ME_GUI_PO_CUST~TRANSPORT_FROM_DYNP加入代码
PAI事件时, 把屏幕的值传到attribute dynp_data_pai, 并且比较dynp_data_pbo和dynp_data_pai, 确定自建field的值有所改变, 把re_changed置为'X', 这样IF_EX_ME_PROCESS_PO_CUST~PROCESS_HEADER就会触发.
- METHOD if_ex_me_gui_po_cust~transport_from_dynp.
- IF im_name = subscreen1.
- CALL FUNCTION 'ZCI_EKKODB_POP'
- IMPORTING
- ex_dynp_data = dynp_data_pai.
- ENDIF.
- IF dynp_data_pai <> dynp_data_pbo.
- * something has changed therefor we have to notify the framework
- * to transport data to the model
- re_changed = mmpur_yes.
- ENDIF.
- ENDMETHOD.
METHOD if_ex_me_gui_po_cust~transport_from_dynp.
IF im_name = subscreen1.
CALL FUNCTION 'ZCI_EKKODB_POP'
IMPORTING
ex_dynp_data = dynp_data_pai. ENDIF. IF dynp_data_pai <> dynp_data_pbo.
* something has changed therefor we have to notify the framework
* to transport data to the model
re_changed = mmpur_yes.
ENDIF.
ENDMETHOD.
Step 12: 在IF_EX_ME_GUI_PO_CUST~TRANSPORT_TO_MODEL加入代码, 把修改后的数据传到bussiness object里
- METHOD if_ex_me_gui_po_cust~transport_to_model.
- DATA: lw_header TYPE REF TO if_purchase_order_mm,
- lw_mepoheader TYPE mepoheader,
- lw_customer TYPE ci_ekkodb,
- lw_po_header_handle TYPE REF TO cl_po_header_handle_mm.
- *--------------------------------------------------------------------*
- * data have to be transported to business logic
- *--------------------------------------------------------------------*
- IF im_name = subscreen1.
- * is it an item? im_model can be header or item.
- mmpur_dynamic_cast lw_header im_model.
- CHECK NOT lw_header IS INITIAL.
- lw_mepoheader = lw_header->get_data( ).
- * standard fields changed?
- IF dynp_data_pbo-lv_test1 <> dynp_data_pai-lv_test1
- OR dynp_data_pbo-lv_test2 <> dynp_data_pai-lv_test2
- OR dynp_data_pbo-lv_test3 <> dynp_data_pai-lv_test3.
- * update standard fields
- lw_mepoheader-lv_test1 = dynp_data_pai-lv_test1.
- lw_mepoheader-lv_test2 = dynp_data_pai-lv_test2.
- lw_mepoheader-lv_test3 = dynp_data_pai-lv_test3.
- CALL METHOD lw_header->set_data
- EXPORTING
- im_data = lw_mepoheader.
- ENDIF.
- ENDIF.
- ENDMETHOD.
METHOD if_ex_me_gui_po_cust~transport_to_model. DATA: lw_header TYPE REF TO if_purchase_order_mm,
lw_mepoheader TYPE mepoheader,
lw_customer TYPE ci_ekkodb,
lw_po_header_handle TYPE REF TO cl_po_header_handle_mm.
*--------------------------------------------------------------------*
* data have to be transported to business logic
*--------------------------------------------------------------------*
IF im_name = subscreen1. * is it an item? im_model can be header or item.
mmpur_dynamic_cast lw_header im_model.
CHECK NOT lw_header IS INITIAL.
lw_mepoheader = lw_header->get_data( ).
* standard fields changed?
IF dynp_data_pbo-lv_test1 <> dynp_data_pai-lv_test1
OR dynp_data_pbo-lv_test2 <> dynp_data_pai-lv_test2
OR dynp_data_pbo-lv_test3 <> dynp_data_pai-lv_test3.
* update standard fields
lw_mepoheader-lv_test1 = dynp_data_pai-lv_test1.
lw_mepoheader-lv_test2 = dynp_data_pai-lv_test2.
lw_mepoheader-lv_test3 = dynp_data_pai-lv_test3. CALL METHOD lw_header->set_data
EXPORTING
im_data = lw_mepoheader. ENDIF.
ENDIF.
ENDMETHOD.
Step 13: 如果要check这些field的值的话, 可以写在IF_EX_ME_PROCESS_PO_CUST~PROCESS_HEADER, 这里我要check field1必须是PALM.
- METHOD if_ex_me_process_po_cust~process_header.
- DATA: lw_mepoheader TYPE mepoheader,
- lw_customer TYPE ci_ekkodb.
- DATA: lv_testflag TYPE c.
- INCLUDE mm_messages_mac. "useful macros for message handling
- lw_mepoheader = im_header->get_data( ).
- IF lw_mepoheader-lv_test1 <> 'PALM'.
- * Place the cursor onto field lv_test1. The metafield was defined in BAdI ME_GUI_PO_CUST,
- * Method MAP_DYNPRO_FIELDS.
- mmpur_metafield mmmfd_cust_01.
- mmpur_message_forced 'E' 'ZDEV001' '999' '' '' '' ''.
- * MESSAGE 'This field should be filled ''PALM''' TYPE 'W'.
- * CLEAR lv_testflag.
- * lv_testflag = 'X'.
- * EXPORT lv_testflag FROM lv_testflag TO MEMORY ID 'Z_ZERO_ME22N'.
- * invalidate the object
- CALL METHOD im_header->invalidate( ).
- ENDIF.
- ENDMETHOD.
METHOD if_ex_me_process_po_cust~process_header.
DATA: lw_mepoheader TYPE mepoheader,
lw_customer TYPE ci_ekkodb. DATA: lv_testflag TYPE c. INCLUDE mm_messages_mac. "useful macros for message handling lw_mepoheader = im_header->get_data( ). IF lw_mepoheader-lv_test1 <> 'PALM'.
* Place the cursor onto field lv_test1. The metafield was defined in BAdI ME_GUI_PO_CUST,
* Method MAP_DYNPRO_FIELDS. mmpur_metafield mmmfd_cust_01.
mmpur_message_forced 'E' 'ZDEV001' '999' '' '' '' ''.
* MESSAGE 'This field should be filled ''PALM''' TYPE 'W'. * CLEAR lv_testflag.
* lv_testflag = 'X'.
* EXPORT lv_testflag FROM lv_testflag TO MEMORY ID 'Z_ZERO_ME22N'. * invalidate the object
CALL METHOD im_header->invalidate( ).
ENDIF. ENDMETHOD.
如果按回车来check的话, 它会显示error message,一次改变后按一次回车有反应, 第二次就没反应.
这里有一个缺陷, 当我们按save里, 这条message是不会显示到message表中的(研究了很久, 没研究出来怎么搞), 幸好这里有个功能十分不错, 选中PO header data still faulty这个message, 按Edit, 就可以定位到error message的field.
至此, 增强完成.
补充:
1. IF_EX_ME_PROCESS_PO_CUST~INITIALIZE: initialize function groupZCI_EKKODB的变量语句可以写在这.
- METHOD if_ex_me_process_po_cust~initialize.
- CALL FUNCTION 'ZCI_EKKODB_INIT'
- .
- ENDMETHOD.
METHOD if_ex_me_process_po_cust~initialize.
CALL FUNCTION 'ZCI_EKKODB_INIT'
.
ENDMETHOD.
2. IF_EX_ME_PROCESS_PO_CUST~OPEN: 如果要select自建表的东西可以写在这里, 这里有个field IM_TRTYP有一定的控制作用, 具体可以查看它的domain值.
3. IF_EX_ME_PROCESS_PO_CUST~POST: update自建表的语句可以写在这里.
4. Custom subscreen的field必须引用method IF_EX_ME_GUI_PO_CUST~SUBSCRIBE里的定义的那个structure, from dict要勾上.
5. 如果有自建表里面的field, 必须在method IF_EX_ME_GUI_PO_CUST~TRANSPORT_TO_MODEL判断自建表的field改变时, 加上语句CALL METHOD lw_header->set_changed( ), 不这样的话, 你的自建表的field怎么变在保存时都会提示No data changed. 下面代码是例子.
- METHOD if_ex_me_gui_po_cust~transport_to_model.
- DATA: lw_header TYPE REF TO if_purchase_order_mm,
- lw_mepoheader TYPE mepoheader,
- lw_customer TYPE ci_ekkodb,
- lw_po_header_handle TYPE REF TO cl_po_header_handle_mm.
- *--------------------------------------------------------------------*
- * data have to be transported to business logic
- *--------------------------------------------------------------------*
- IF im_name = subscreen1.
- * is it an item? im_model can be header or item.
- mmpur_dynamic_cast lw_header im_model.
- CHECK NOT lw_header IS INITIAL.
- lw_mepoheader = lw_header->get_data( ).
- * standard fields changed?
- IF dynp_data_pbo-lv_test1 <> dynp_data_pai-lv_test1
- OR dynp_data_pbo-lv_test2 <> dynp_data_pai-lv_test2
- OR dynp_data_pbo-lv_test3 <> dynp_data_pai-lv_test3.
- * update standard fields
- lw_mepoheader-lv_test1 = dynp_data_pai-lv_test1.
- lw_mepoheader-lv_test2 = dynp_data_pai-lv_test2.
- lw_mepoheader-lv_test3 = dynp_data_pai-lv_test3.
- CALL METHOD lw_header->set_data
- EXPORTING
- im_data = lw_mepoheader.
- ENDIF.
- IF dynp_data_pbo-zdamon <> dynp_data_pai-zdamon.
- CALL FUNCTION 'ZCI_EKKODB_SET_DATA'
- EXPORTING
- im_damon = dynp_data_pai-zdamon.
- CALL METHOD lw_header->set_changed( ).
- ENDIF.
- ENDIF.
- ENDMETHOD.
METHOD if_ex_me_gui_po_cust~transport_to_model. DATA: lw_header TYPE REF TO if_purchase_order_mm,
lw_mepoheader TYPE mepoheader,
lw_customer TYPE ci_ekkodb,
lw_po_header_handle TYPE REF TO cl_po_header_handle_mm.
*--------------------------------------------------------------------*
* data have to be transported to business logic
*--------------------------------------------------------------------*
IF im_name = subscreen1. * is it an item? im_model can be header or item.
mmpur_dynamic_cast lw_header im_model.
CHECK NOT lw_header IS INITIAL.
lw_mepoheader = lw_header->get_data( ).
* standard fields changed?
IF dynp_data_pbo-lv_test1 <> dynp_data_pai-lv_test1
OR dynp_data_pbo-lv_test2 <> dynp_data_pai-lv_test2
OR dynp_data_pbo-lv_test3 <> dynp_data_pai-lv_test3.
* update standard fields
lw_mepoheader-lv_test1 = dynp_data_pai-lv_test1.
lw_mepoheader-lv_test2 = dynp_data_pai-lv_test2.
lw_mepoheader-lv_test3 = dynp_data_pai-lv_test3. CALL METHOD lw_header->set_data
EXPORTING
im_data = lw_mepoheader. ENDIF. IF dynp_data_pbo-zdamon <> dynp_data_pai-zdamon.
CALL FUNCTION 'ZCI_EKKODB_SET_DATA'
EXPORTING
im_damon = dynp_data_pai-zdamon. CALL METHOD lw_header->set_changed( ).
ENDIF. ENDIF.
ENDMETHOD.
6.Method IF_EX_ME_GUI_PO_CUST~EXECUTE可以处理function code.
- METHOD if_ex_me_gui_po_cust~execute.
- IF im_fcode = 'ZZZZ'.
- MESSAGE 'Zero test' TYPE 'I'.
- ENDIF.
- ENDMETHOD.
METHOD if_ex_me_gui_po_cust~execute.
IF im_fcode = 'ZZZZ'.
MESSAGE 'Zero test' TYPE 'I'.
ENDIF.
ENDMETHOD.
ME21N/ME22N/ME23N屏幕增强BADI ME_GUI_PO_CUST的更多相关文章
- SAP采购订单屏幕增强
转自<http://blog.csdn.net/heng0757/article/details/8073875> 为采购订单增加一个页标签,在其中放入客户自定义字段, 1. CMOD 增 ...
- SAP S4/HANA BP屏幕增强添加自定义字段(BDT方式)
喜欢博主的读者也许会意识到,这是本博客中第一篇有关屏幕增强的文章.之前没有总结过相关的东西,除了因为相关经验有限之外,我个人也是不喜欢所谓dynpro编程的,它有许多“潜规则”一样的东西要记住,想要运 ...
- 【MM系列】SAP 交货单屏幕增强
公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[MM系列]SAP 交货单屏幕增强 前言部分 ...
- [转载]ME51n,ME52n,ME53n屏幕增强
原文地址:ME51n,ME52n,ME53n屏幕增强作者:cyzhang811 http://blog.sina.com.cn/s/blog_721b218c0100zch9.html 使用增强:ME ...
- 如何实现标准TCODE的屏幕增强
如何实现标准TCODE的屏幕增强(HOWTO:Implement a screen exit to a standard SAP transaction) Introduction SAP provi ...
- SAP销售订单屏幕增强行项目屏幕增强
1.在vbap表中 append一个自定义结构,如下图: 2.TCODE:SE80 程序名:SAPMV45A 屏幕:8459 如图: 3.标记增强的屏幕字段 4.屏幕增强的位置 *& ...
- SAP 金税接口增强 BADI
SAP与金税连接有两种方式:组件接口及文本接口. 文本接口为例: 1.SAP取发票数据.主要来自合同,销售订单,交货单.发票,客户供应商主数据等 2.SAP处理:合并.拆分,折扣等 3.导出TXT ...
- 增强篇4 CO01生产订单屏幕增强
Step1. 结构 CO_AUFK 里增加自定义字段:ZZZ_TRIAL 然后激活结构 查看AUFK是激活状态, 字段增强完成: Step2. CMOD 使用客户增强:PPCO0012 生产订 ...
- 【MM系列】SAP PO增强BADI
公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[MM系列]SAP PO增强BADI 前言部 ...
随机推荐
- mvc源码解读(20)-controller和view之查找view
很多时候在mvc项目中我们需要去扩展自己的视图引擎,大概看起来应该下面这个样子的: public class RazorEngineExpand : RazorViewEngine { private ...
- SCOI2010游戏
发现这题的并查集做法真是惊呆了 不过似乎匹配跑得更快? 对于一个联通块,假如不含环(就是一棵树),那么必定可以满足其中任意的p-1个点. 对于一个联通块,假如含环,那么必定全部的p个点都能满足. 那么 ...
- NOI2003 逃学的小孩
这一题不会做啊…… 我觉得真要比赛的话我可能会随机上几万次,然后再用LCA求距离,更新最优值,等到快超时的时候输出答案…… 题解请看2007年陈瑜希论文 代码: ; type node=record ...
- 【 D3.js 高级系列 — 4.0 】 矩阵树图
矩阵树图(Treemap),也是层级布局的扩展,根据数据将区域划分为矩形的集合.矩形的大小和颜色,都是数据的反映.许多门户网站都能见到类似图1,将照片以不同大小的矩形排列的情形,这正是矩阵树图的应用. ...
- Sharepoint网站创建自定义导航全记录
转:http://tech.it168.com/a2009/1207/820/000000820524_all.shtml [IT168 技术文档]在一个Sharepoint网站中可以创建子网站,页面 ...
- 29、activity横竖屏切换细节问题
1 import android.app.Activity; import android.content.Intent; import android.os.Bundle; import andro ...
- 在win64位,python64位2.7版本中安装pyHook
今天看了一篇博文说的是利用pyhook监听键盘鼠标事件(感兴趣的可以看博客园中相关文章),文章中使用的pyHook模块的官方下载地址是:http://sourceforge.net/projects/ ...
- 解决OpenCV Error:Insufficient memory(Failed to allocate 1244164 bytes) in unknown function
从师兄那拷贝过来的代码,师兄的机器上可以运行,环境为Win7+OpenCV231,编译器为Debug Win32,拷贝到自己机器上运行时出现问题. 本机的运行环境为win10+OpenCV244,编译 ...
- leetcode@ [300] Longest Increasing Subsequence (记忆化搜索)
https://leetcode.com/problems/longest-increasing-subsequence/ Given an unsorted array of integers, f ...
- HDU-4679 Terrorist’s destroy 树形DP,维护
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4679 题意:给一颗树,每个边有一个权值,要你去掉一条边权值w剩下的两颗子树中分别的最长链a,b,使得w ...