Skip to Content
avatar image
Former Member

setting default value in WEB UI

Hello all

I am very new in working with the CRM 2007 Web UI (and in working with SAP as well) and I have this problem that I hope some of you can help me with.

I am changing the configuration of component IUICACCPAY, view AccountData.

I want the field ACCOUNTADDRESS/STRUCT.COUNTRY to have the default value of DK (representing Denmark). How do I do that?

Should I use the SET_COUNTRY method and if yes, how do I do that (the method is not generated, it is red in the component workbench).

Kind regards

Peter

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Oct 22, 2008 at 03:15 PM

    Hi ,

    The Set_XXX Method is used when Saving the data.

    What you need is to regenerate the get_xxx Method and in that method

    you put in value what you need.

    Lilach

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 22, 2008 at 04:39 PM

    Hello Peter,

    The implementation should depend on your scenario.

    As of now i can think of the following scenario and how to implement.

    Whenever the user tries to create a new Account, the country should be populated to DK. See the code below

    1) Go to the View controller implementation cost. Redefien the method DO_INIT_CONTEXT. This method actually sets a default value to the context.

    In this method,

    data : lr_entity type ref to CL_CRM_BOL_ENTITY.

    lr_entity ?= me->typed_context->ACCOUNTADDRESS->collection_wrapper->get_current().

    call method lr_entity->SET_PROPERTY

    exporting

    IV_ATTR_NAME = 'COUNTRY'

    IV_VALUE = 'DK'.

    This intializes teh ACCOUNTADDRESS context node to the value DK.

    2) You can use the SET_METHOD of the attribute also. But you need to define your logic on when exactly you want it to be DK.

    3) Not sure whether you can use the working context to default the contry or not..

    Hope this helps.

    Thanks,

    Vinay

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 22, 2008 at 06:09 PM

    hi,

    if you want to give default value to country or currency only then ask your basis team. They will do it for you.

    If you want to give default value to other fields then you can use code given by nagur in the method he gave. Also you can write same code in wd_create_context of implementation class.

    Hope your issue is resolved

    Best regards

    Pankaj Kumar

    Add comment
    10|10000 characters needed characters exceeded