Badi增强 MIRO

BADI_FDCB_SUBBAS01

BADI_FDCB_SUBBAS02

BADI_FDCB_SUBBAS03

BADI_FDCB_SUBBAS04

BADI_FDCB_SUBBAS05

BADI_FDCB_SUBBAS06

此6个badi可以增强MIRO的界面

  1. 由于此6个badi都不支持多实例,因此先查看哪个badi能用于增强SXC_EXIT 查询
    MIRO 增强_SAP刘梦__c++
    MIRO 增强_SAP刘梦__python_02
    有两个实例 ( 只能有一个实例激活,否则激活,再查看又非激活)
    SXC_ATTR
    MIRO 增强_SAP刘梦__python_03
    (发现 FM_BADI_FDCB_BAS 是激活的)

查询发现 BADI_FDCB_SUBBAS04 没有实例

  1. SE19 创建实例MIRO 增强_SAP刘梦__c++_04
    点 创建实施
    MIRO 增强_SAP刘梦__python_05

实现方法: 可以参考 示例实施类的代码。

MIRO 增强_SAP刘梦__c++_06

MIRO 增强_SAP刘梦__c++_07

 

MIRO 增强_SAP刘梦__c++_08

已调用程序是 function 的主程序SAPLZBADI_FDCB_SUBBAS01_BADI, 屏幕是增强的屏幕

3.

MIRO 增强_SAP刘梦__php_09

以击函数名, 点主程序

MIRO 增强_SAP刘梦__python_10

SAPLZBADI_FDCB_SUBBAS01_BADI 主程序名

在top中声明变量

MIRO 增强_SAP刘梦__c++_11

创建screen(由于只是显示RBKP 里的字段 xref3,因此不用增强结构,其他需要增强结构)

MIRO 增强_SAP刘梦__python_12

MIRO 增强_SAP刘梦__mysql_13

代码实现

MIRO 增强_SAP刘梦__c++_14

MIRO 增强_SAP刘梦__java_15

然后激活程序后运行MIR4,效果图如下

MIRO 增强_SAP刘梦__python_16

合同(手工) 就是新增上去的

MODULE get_instance OUTPUT.

IF o_badi_fdcb_subbas04 IS INITIAL.

 

CALL METHOD cl_exithandler=>get_instance_for_subscreens

CHANGING

instance = o_badi_fdcb_subbas04

EXCEPTIONS

no_reference = 1

no_interface_reference = 2

no_exit_interface = 3

data_incons_in_exit_managem = 4

class_not_implement_interface = 5

OTHERS = 6.

IF sy-subrc <> 0.

* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

 

ENDIF.

 

* object created ?

CHECK NOT o_badi_fdcb_subbas04 IS INITIAL.

 

* get data from main screen

 

CALL METHOD o_badi_fdcb_subbas04->get_data_from_screen_object

IMPORTING

ex_invfo = invfo.

 

ENDMODULE.

 

 

 

MODULE screen_modify OUTPUT.

 

 

Loop at screen.

case sy-tcode.

when 'FB60' or 'FB65' or 'FB70' or 'FB75'

or 'MIRO' or 'MIRA' or 'MIR7'.

screen-input = 1.

when others.

screen-input = 0.

endcase.

modify screen.

endloop.

ENDMODULE.

 

MODULE receive_actual_data INPUT.

** object created ?

CHECK NOT o_badi_fdcb_subbas04 IS INITIAL.

 

* get data from main screen

CALL METHOD o_badi_fdcb_subbas04->get_data_from_screen_object

IMPORTING

ex_invfo = invfo.

ENDMODULE. " RECEIVE_ACTUAL_DATA INPUT

 

 

MODULE user_command_9000 INPUT.

CHECK NOT o_badi_fdcb_subbas04 IS INITIAL.

 

* put data to main screen

CALL METHOD o_badi_fdcb_subbas04->put_data_to_screen_object

EXPORTING

im_invfo = invfo.

ENDMODULE. " USER_COMMAND_9000 INPUT

 

 


欢迎关注订阅号:SAP学习记录 (SAPlearning )

PO <wbr><wbr>text <wbr><wbr>copy <wbr><wbr>rules <wbr><wbr>:copy <wbr><wbr>PR <wbr><wbr>item <wbr><wbr>text <wbr><wbr>to <wbr><wbr>PO