Registration

Dear SAP Community Member,
In order to fully benefit from what the SAP Community has to offer, please register at:
http://scn.sap.com
Thank you,
The SAP Community team.
Skip to end of metadata
Go to start of metadata

The BADI CRM_BP_UIU_DEFAULTS is used to set default values to fields on account screen on SAP CRM Web UI

Per thread:

https://www.sdn.sap.com/irj/scn/thread?threadID=1100863&tstart=0

The code below will allow us to default the country field as "US" each time a user creates an new account.

ASSIGN cr_me->('TYPED_CONTEXT') TO <typed_context>.
  IF sy-subrc = 0.
    lr_typed_context ?= <typed_context>.
    IF lr_typed_context IS 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_node IS BOUND.
          lr_coll_wrapper ?= lr_node->collection_wrapper.
          IF lr_coll_wrapper IS BOUND.
            TRY.
                lr_current ?= lr_coll_wrapper->get_current( ).
                CHECK lr_current IS BOUND.
                lr_current->set_property( iv_attr_name = 'COUNTRY'
                           iv_value = 'US' ).
              CATCH cx_sy_move_cast_error.
 
            ENDTRY.
 
          ENDIF.
        ENDIF.
      ENDIF.
    ENDIF.
  ENDIF.

 
 
 
  • No labels

1 Comment

  1. Guest

    Hi,

         Thank you.

        The Code is Really informative.