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.