The purpose of the enhancement is to provide default language as FR for the CRM UI while creating a corporate account.
Login to the CRM system and open the Web UI using the transaction CRM_UI. It will open the default screen which will have options to create a Corporate Account.
The first thing is to check the view and look for a BADI. To find the view we press F2 key in the Language field
We can go to the transaction “bsp_wd_cmpwb” and open the UI component BP_ADDR.
Browse to Request Processing and double click DO_PREPARE_OUTPUT
We will find the code below.
Double click the method do_prepare_output and it will brose to the exact line of code.
The code shows that there is a BADI which we can implement.
Copy the badi name “badi_crm_bp_uiu_defaults” and open the same in SE18.
We find that the BADI belongs to an enhancement spot.
We thus create a BADI implementation in SE19.
The method “get_default_values” is implemented here.
We double click the method and write the code for the same.
Given below is the same code:
METHOD if_uiu_bp_defaults~get_default_values.
DATA:
lr_current TYPE REF TO cl_bsp_wd_value_node,
lr_typed_contextTYPE REF TO cl_bsp_wd_context,
lr_node TYPE REF TO cl_bsp_wd_context_node,
lr_coll_wrapperTYPE REF TO cl_bsp_wd_collection_wrapper.
FIELD-SYMBOLS:
<typed_context> TYPE any,
<context_node> TYPE any.
ASSIGN cr_me->('TYPED_CONTEXT') TO <typed_context>.
IF sy-subrc= 0.
lr_typed_context ?= <typed_context>.
IF lr_typed_contextIS BOUND.
ASSIGN lr_typed_context->('STANDARDADDRESS') TO <context_node>.
IF sy-subrc= 0.
TRY.
lr_node ?= <context_node>.
CATCH cx_sy_move_cast_error. "EC_NOHANDLER
ENDTRY.
IF lr_nodeIS BOUND.
lr_coll_wrapper ?= lr_node->collection_wrapper.
IF lr_coll_wrapperIS BOUND.
TRY.
lr_current ?= lr_coll_wrapper->get_current( ).
CHECK lr_currentIS BOUND.
lr_current->set_property(iv_attr_name= 'LANGU'
iv_value= 'FR' ).
CATCH cx_sy_move_cast_error.
ENDTRY.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDMETHOD.










