How to set a Default Value in the drop down on Account Creation ?

Hi,
i have to set a default value in the drop down as soon as a User in a particular business role clicks on New Account. I have written the following code in do_prepare_output method. But this code is executed in the 2nd server round trip after entering some value or pressing enter. so i am not getting as soon as user clicks on the New Account.
How to set that default value when user clicks on New Account ? and where should i code ?
  IF lv_icwc_profile = 'ZCSALESPRO' or lv_icwc_profile = 'Z_SALESPRO' .
  try.
              lr_entity ?= me->typed_context->header->collection_wrapper->get_current( ).
              lv_current = lr_entity->create_related_entity(
                                              iv_relation_name = 'BuilRolesRel' ).
                             lv_current->set_property(
                                iv_attr_name = 'PARTNERROLE'
                                iv_value     =  'BUP002' ).
               CATCH cx_sy_ref_is_initial cx_sy_move_cast_error
               cx_crm_genil_model_error.
               return.
        ENDTRY.
Thanks and Regards
Raman Khurana

Hi,
I have some idea abt it, it is also used in account life cycle.
Please refer SAP note 1097651, Defaulting a life cycle stage.
Let me know if useful.
rgds,
Vinay

Similar Messages

  • How to set a default value for a drop down list box and then apply cascading based on the default value in Infopath 2010.

    Hello Everyone
    I have two drop downs. Both are coming from look up fields from two lists. i want to set a default value(first list item) for the first drop down list box and then apply cascading based on the default value for the next drop down list box. I found one article(http://www.bizsupportonline.net/infopath2010/display-first-item-drop-down-list-box-infopath-2010.htm)
    where in i can set a default value but i can't apply cascading based on that default value. Any suggestions would be highly appreciated.
    Thanks
    Ramanjulu Naidu N

    Hey Ramanjulu,
    Take a look at the below article which I believe will answer your question.
    http://basquang.wordpress.com/2010/03/29/cascading-drop-down-list-in-sharepoint-2010-using-infopath-2010/
    Daniel Christian (MCTS)

  • Default value in the drop down by index

    Hi Experts,
    I have a drop down by index to which i binded one internal table,but m not able to get the default value
    i want the first value to be selected in the drop down by default,Pls give me suggestion for solving this problem

    Hi Shan,
    As per your requirement,When ur binding the internal table to the  drop down by index ,but your are not able to get the default value.
    For this please check this code.
    In this I hv taken a node - dropdown1 and within this attribute of type Land1 and I hv set the cardinality to 0..n.
    Then I hv bind the text property of the dropdownbyidx ui element to the node attribute.
    then i hv call this code in the init method of view.
    DATA lo_nd_dropdown1 TYPE REF TO if_wd_context_node.
      DATA lo_el_dropdown1 TYPE REF TO if_wd_context_element.
      DATA lt_dropdown1 TYPE wd_this->elements_dropdown1.
      DATA ls_dropdown1 LIKE LINE OF lt_dropdown1.
      navigate from <CONTEXT> to <DROPDOWN1> via lead selection
      lo_nd_dropdown1 = wd_context->get_child_node( name = wd_this->wdctx_dropdown1 ).
      @TODO handle not set lead selection
      IF lo_nd_dropdown1 IS INITIAL.
      ENDIF.
      get all declared attributes
      lo_nd_dropdown1->get_static_attributes_table(
        IMPORTING
          table = lt_dropdown1 ).
      SELECT land1 FROM t005 INTO CORRESPONDING FIELDS OF TABLE lt_dropdown1.
      CALL METHOD lo_nd_dropdown1->bind_table
        EXPORTING
          new_items            = lt_dropdown1
          set_initial_elements = abap_true .
    Regards
    Manoj Kumar

  • How to set a default value in the "Our reference"-field in purchse orders?

    Hi!
    When creating a purchase order the "Our reference"-field in the Communication-tab is empty. Is it possible to configure this so that the field is filled by default with the name of the person who is creating the PO?

    Hi,
    There is a button named Personal Settings on ME21N screen. Click on that button --> Click on second tab of Default Values --> Click on More fields --> Select Our reference and maintain the default value. This will always come up at the time of creation of PO.
    Hope this serves the purpose.
    Thanks...
    Edited by: vilas amrutkar on Feb 17, 2009 5:17 AM

  • How to set a default value to t-list when creating t-list programmatically

    hi,
    I'm creating a t-list programmatically
    by calling
    n = populate_group('groupname');
    populate_list('form.list','groupname');
    In this case how to set a default value for the t-list
    thanks
    rani

    I am not sure how it works in Web Dynpro for ABAP, but in Web Dynpro for Java to set default drop down value you will have to set the value for particular attribute (which is linked to the dropdown element)  in the context
    like
    wdContext.currentContext<nodeName>Element.set<FieldName>(<defalut value>)
    This generally done in Initialization method of the controller.

  • How to set a default value in my DropDown using the key  ?

    Hello All,
      Can someone advose how I can achieve the above ? I will like to know how to select a default value for the dropdown by key using the key value instead of description.
      The reason why I need to do so instead o fusing description is because my application will populate the dropdown using web services based on the language selection. Hence, if I were to set the default value using description, den other languages will not work anymore.
      Any help will be greatly appreciated. Thank you !!
    from
    KWok Wei

    Kwok,
    Assuming that:
    1. You have a node NodeX, where attribute TargetAttr defined
    2. You have a DropDownByKey UI control, its property selectedKey bound to NodeX.TargetAttr attribute
    Then:
    Place in your code:
    wdContext.currentNodeXElement().setTargetAttr("yourKey");
    VS
    P.S. This topic was raised several times, and forum search works good enough to find an answer

  • How to set a default value in Select one choice.

    Hi
    I'm using ADF BC, in that how to set a default value in select one choice.
    pls. help on this.
    regards

    set the default value on the underlying EO or VO attribute
    john

  • How to set a default value for particular field in SRM PO Portal

    Dear Gurus,
    Im desparetly need a help in web dynpro on how to set a default value for a field(flag) in PO header tab in portal.
    My requirement is whenever the user press the edit button in PO screen,automatically a flag field should be set as abap_false.
    I dont think this will handle in check badi or change badi. i tried this part in onbuttonpressed overwriteexit in CNR_VIEW views,i can get the function EDIT in debugging mode,but dont know how to proceed further.....
    Many of them suggested to go with get attribute and set attribute for changing any particular field in web dynpro,but im not very familiar in using those get and set attributes.I request you people can give me sample code on how to identify my target field in the node and set the values while pressing EDIT Button.
    Thanks in advance...
    Regards,
    Sathish

    Dear Laurent,
    Thanks for your response,
    But i searched in enhancement spot of WD_BADI, but couldnt get the exact way to change the coding,
    My real requirement is, that particular flag should be enable and disable dynamically by checking a condition in my header values.So in that case i dont know how to proceed further to handle in the PO screen.
    Kinly guide me how to get the particular node of field in the Purchase order screen.
    Thanks you in advance,
    Sorry for the inconvenience if any
    Regards,
    sathish

  • How to set a variable value on the BPC Data Manager

    Hello BPC Experts,
    I'm creating a BPC10 NW version demo environment for our prospect customer.
    I made a data manager to import  BW data into BPC model from BW cube.
    I need to import just one month data into BPC from the BW cube that has more than one month data.
    When I run the data package manually, I can select a member of the time dimension prompt and I can import specific month data I want.
    But, in a case where the program (data manager) runs by JOB monthly,
    I can't select a member of the time dimension prompt manually.
    So I want to know how to set a  variable value to the time dimension prompt from a system date etc. automatically.
    Are there any way to set a variable value to the time dimension prompt on the data manager automatically from a system date?
    Or, do you have any other solution to import just one month data into BPC from the BW cube that has more than one month data  by the data manager running on JOB ?
    (without selecting a member of the time dimension prompt of the data package manually)
    Thanks in advance,
    Keisuke

    Hi Gersh
    Sorry for my late reply and thanks for your helpful information.
    I tried the second way of your information and I could configure it.  
    And I 'll try first way of your information.
    Regards,
    Keisuke

  • Can we set a default value for the container variable in BPM?

    Can we set a default value for the container variable.?
    Suppose if i have a loop step and i have given a container variable i=5 as end condition.What value will it take during its first execution?Can we set the value for container before a recieve step?

    Hi
    Define Container Variable of Type integer and Category Simple Type .Use Condtion in Loop.
    In Container Operation Step Assign value and Use Expression to
    Increase or Decrease Valus according to your operation.
    look Pattern 4 in this blog to understand Container Operation
    /people/sharathchandra.girmaji/blog/2008/09/11/bpm-with-patterns-explained-part-1

  • Restricting values on the drop down list, while creating a PO

    Hello SAP Experts,
       Could you help me with the following.
      While creating a PO (ME21N), based on the Account Assignment Category(KNTTP) entered , I have to restrict the values in the drop down list for selecting the material group (MAKTL). I have searched some in SDN, but couldn't find anything suitable. Appreciate any help.
    Thank you,
    Sorab

    Could anyone tell me , if it is possible. Has anyone tried this before.
    Thank you,
    Sorab

  • Display pages that reacts to different values in the drop down list.

    I currently did up a simple drop down list that stores values retrieved from the database. I would like the program to display pages that reacts to the selected value without the press of any button, which means, if I select any value from the drop down list, the page will be displayed according to the value selected.
    Below are the codes that I did for the retrieval of data from the database.
    <%
            String username = "test";
            String password = "test";
            String thinConn = "jdbc:oracle:thin:@dbdev:1521:ORCL";
            Connection conn;
            Statement stm;
            ResultSet rs;
            String baseQuery ="SELECT DISTINCT ID FROM STAFF ORDER BY ID ASC";
            try {
                conn = DriverManager.getConnection(thinConn,username,password);
                stm = conn.createStatement();
                rs = stm.executeQuery(baseQuery);
    %>
    <strong>Retrieve ID from Database</strong>
        <select size="1" name="dropdown">
        <%
        while (rs.next()) {
            String id = rs.getString("ID");
            out.write("<option value=\"" + id + "\">" + "level " + id + "</option>");
                    conn.close();
                } catch (SQLException e) {
        %>
        </select>Would appreciate if someone might offer some help to what I have to do next
    Edited by: wyndsor on Jun 26, 2008 7:34 PM

    cotton.m wrote:
    [_An instant classic_|http://www.webdeveloper.com/forum/showthread.php?t=184937]
    Sometimes I find myself wondering why people think they won't get caught with their cross forum cross posting. Then I realize that if they knew about Google they wouldn't have needed to ask the question in the first place.
    It's kind of funny in an ironic sort of way.

  • How to set a default value in a dropdownlistbox

    Hi,
    In CRM 2007 WEBUII have created a dropdownlistbox (ddlb)  filled with currency codes.
    Now I want the default value of the ddlb to be the currency of the country of the loggedin user, ie : 'EUR'
    Anyone an creative idea how I can achieve this ?
    In first place I need to know how I can set a default value of a ddlb.
    --> ddlb type ref to CL_CRM_UIU_DDLB.
    regards,
    Abjuh

    Hello Wolfgang,
    If the method does not exist yet, you can create it in your enhanced (Z) context node.
    Definition:
    ATTRIBUTE_PATH Importing     Type                  STRING
    ITERATOR          Importing           Type Ref To     IF_BOL_BO_COL_ITERATOR
    VALUE                    Returning        Type                  STRING
    Implementation:
    method GET_BP_GROUP.
        DATA: current TYPE REF TO if_bol_bo_property_access.
        DATA: dref    TYPE REF TO data.
        if iterator is bound.
          current = iterator->get_current( ).
        else.
          current = collection_wrapper->get_current( ).
        endif.
      TRY.
        TRY.
            dref = current->get_property( 'BP_GROUP' ). "#EC NOTEXT
          CATCH cx_crm_cic_parameter_error.
        ENDTRY.
        CATCH cx_sy_ref_is_initial cx_sy_move_cast_error
              cx_crm_genil_model_error.
          RETURN.
      ENDTRY.
        IF dref IS NOT BOUND.
          value =''
          RETURN.
        ENDIF.
        TRY.
            value = if_bsp_model_util~convert_to_string( data_ref = dref
                                        attribute_path = attribute_path ).
          CATCH cx_bsp_conv_illegal_ref.
            FIELD-SYMBOLS: <l_data> type DATA.
            assign dref->* to <l_data>.
    *       please implement here some BO specific handler coding
    *       conversion of currency/quantity field failed caused by missing
    *       unit relation
    *       Coding sample:
    *       provide currency, decimals, and reference type
    *       value = cl_bsp_utility=>make_string(
    *                          value = <l_data>
    *                          reference_value = c_currency
    *                          num_decimals = decimals
    *                          reference_type = reference_type
            CONCATENATE <l_data> '-CURR/QUANT CONV FAILED-' INTO value
                        SEPARATED BY space.                 "#EC NOTEXT
          CATCH cx_root.
            value = '-CONVERSION FAILED-'.                  "#EC NOTEXT
        ENDTRY.
        if value is initial.
         value = 'Your default value'.
        endif.
    endmethod.
    Regards,
    Fabian

  • How to set a default value in a DateTime field?

    Hi!, how do you set a default value in a DateTime field in a user table to the value of "today"?
    Thank you!

    It's in SAP Business One 2007, in User-Defined-Fields, under User Tables, Iam trying to add a field to a Table I created in the User-Defined-Tables-Setup menu.
    I click Add then type the field name, description and then I select the Type, which is DateTime, then the SelectDefault Value For Field get's grayed out.
    Thank you!

  • How to set a default value in dropdown list in Wendynpro ABAP? Help!

    Hi Experts,
           I have Webdynpro for ABAP application that shows a DropdownwithKey UI element.
    1. I am able to populate the dropdown list. But by default the list is not showing any value. Only when I select a value from the list then it shows it.
    So how to set the default value to the first value in the list? Any code sample will be really helpfull.
    I have written the following code:
    method WDDOINIT .
      DATA:
        node_category TYPE REF TO if_wd_context_node_info.
      node_category = WD_CONTEXT->GET_NODE_INFO( ).
      node_category = node_category->GET_CHILD_NODE( 'CATEGORY' ).
      data:    LT_VALUESET type WDR_CONTEXT_ATTR_VALUE_LIST,
               L_VALUE type WDR_CONTEXT_ATTR_VALUE.
    L_VALUE-VALUE      = 'V1'.
    L_VALUE-TEXT    = 'yesterday'.
    INSERT L_VALUE into table LT_VALUESET.
    L_VALUE-VALUE      = 'V2'.
    L_VALUE-TEXT    = 'today'.
    INSERT L_VALUE into table LT_VALUESET.
    L_VALUE-VALUE      = 'V3'.
    L_VALUE-TEXT    = 'tomorrow'.
    INSERT L_VALUE into table LT_VALUESET.
    node_category->SET_ATTRIBUTE_VALUE_SET(
                 NAME = 'CAT_VALUE'
                 VALUE_SET = LT_VALUESET ).
    endmethod.
    Note that: I am using webdynpro for ABAP.
    Thanks
    Gopal

    I am not sure how it works in Web Dynpro for ABAP, but in Web Dynpro for Java to set default drop down value you will have to set the value for particular attribute (which is linked to the dropdown element)  in the context
    like
    wdContext.currentContext<nodeName>Element.set<FieldName>(<defalut value>)
    This generally done in Initialization method of the controller.

Maybe you are looking for

  • Please help with A record and MX record!

    Guys please help - our IT guy disappeared and we changed the hosting over the weekend. He did setup exchange server for all the emails so now i am trying to recreate all the settings in bluehost for email and the bluehost is asking whats A record for

  • Up to 13 days standby time.....

    The claim is, that stadby. time is 13 days. Can somebody specify this? My phone only holds power for about 2 days and a re-charge is necc. I have  Model STL100-3. Does network need to be turned off during stadby.? Up to 13 days standby time *Note: Ba

  • PL SQL File  Download - file name shows up as procedure name?

    Hello, I have been following the article below to create a download link to my db blobs, however when downloading the files, the file name appears as the procedure name as opposed to the desired file name. http://download.oracle.com/docs/cd/E10513_01

  • HTTP Header not showing up

    I am trying to add a authorization header to the HTTP Post, but it isn't showing up when my end point is https. It only shows up when my end point is http. This is how my header is supposed to look like, but it only works when my end point is http. C

  • SQL statement running balance query with previous balance taken into account

    Hi Guys I have a SQL statement which caclulates the running balance for a list of transactions in a transactions table. This SQL statement is as follows: SELECT transID, debit, credit, (SELECT SUM(debit-credit) FROM transactions as D1 WHERE D1.transI