A tip on implement SAP note 2923340

Background

After finished all the step from the tutorial, I still can not see the button ‘Copy Accounts to new CoCd’.

Analysis

First I get the FPM event id of this new button, which is if_usmd_generic_bolui_const=>gc_action_copy_cc
Then I try to debug the feeder class on method IF_FPM_GUIBB_LIST~GET_DATA to check the buttons visibility in table CT_ACTION_USAGE, then I found it was 01(not visible). So I try to figure out where its value was changed, I made a full text search(maybe where used list) with key word ‘gc_action_copy_cc’ in feeder class and its super class, then I found the following one.
在这里插入图片描述with the code

  WHEN if_usmd_generic_bolui_const=>gc_action_copy_cc. "( with MDGF CC2020 )
         cs_action_usage-enabled = boolc( lines( me->mt_entity_sel ) > 0 ).
         IF cl_mdg_bs_fin_switch_check=>mdg_cc_2020_232583( ) = abap_false.
          cs_action_usage-visible = '01'.
         ENDIF.

the method mdg_cc_2020_232583 itself always returns ABAP_FALSE, but when you change to enhancement view, you will found an overwrite_exit for all check method.
在这里插入图片描述lets get into the overwrite exit for real logic.

CONSTANTS:
     lc_switch_id TYPE sfw_switch_id VALUE 'GV_MDG_CC_2020_232583'.

    " Check whether switch exists 
    
    IF cl_abap_switch=>check_switch( p_switch_id = lc_switch_id ) = abap_false.
      rv_active = abap_false.
    ELSE.
      " Determine switch is on or off
      IF cl_abap_switch=>get_switch_state( p_switch_id = lc_switch_id ) = cl_abap_switch=>c_on.
        rv_active = abap_true.
      ELSE.
        rv_active = abap_false.
      ENDIF.
    ENDIF.

But I have already created and active the switch ‘GV_MDG_CC_2020_232583’, so I checked SFW1 once again for the Switch properties, then I realized that the field ‘Global status’ is incorrect, just turn it on.
在这里插入图片描述

Reference

About the how to change the global status, you can refer to
Switch Framework – A simple demo on creation and usage of a custom switch
Just use tcode SFW2/SFW3/SFW5 one by one.
在这里插入图片描述在这里插入图片描述Finally,

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值