Skip to Content
0
Former Member
Jan 12, 2011 at 07:11 PM

I defaulted input help field (pick list) but SAP CRM still asking for one

36 Views

We are running SAP CRM 7.0.

Some fields as you know are dialog / pick list fields.

What I mean by this is they are input help fields where you

can click a little square (in sap crm 7.0) to the right of the text box

and it brings up a dialog screen of values that you can select from.

Here is an example screen shot of what I am talking about:

http://img834.imageshack.us/img834/5676/imageschak.png

So what I have done is implemented the GETTER function for this input help field so that by default it has a value.

The code is like so:

method GET_CURRENCY.
CALL METHOD SUPER->GET_CURRENCY
  EXPORTING
    ATTRIBUTE_PATH = attribute_path
   ITERATOR       = iterator
  RECEIVING
    VALUE          = value.
 
 
      if value eq ''.
        IF sy-langu EQ 'E'.
          VALUE = 'USD'.
        elseif sy-langu EQ 'D'.
          VALUE = 'EUR'.
        ENDIF.
      endif.
endmethod.

Here even is a link to this method that I created: Field Currency of Context Node BTADMINH - How to set default

The method works great it sets the default of the currency to say USD. When I click the create button to create an opportunity the field currency is set to USD, this is great because it makes my job easier that I dont have to click the input help button and select a currency, it is already there.

But once I click the "Save" button for an opportunity I get a small error in the error notification box that tells me I need to select a currency! But why is this happening a currency already exists? So If I click the input help (the little button) and reselect the currency value USD then save my opportunity this error goes away.

The question is why does this happen? I need it so that the default currency value is recognized by the SAP CRM system. Why do I have to go back in and re-select the currency if it is already set? Is there some sort of consistency check or something I need to do to eliminate this problem?

Here is a screen shot after creating an opportunity with the default Currency set to USD (this means I did not select USD in the dialog input help it was defaulted by the getter method:

http://img832.imageshack.us/img832/3011/enteracurrency.png

Only if I go back into edit mode and actually click the little square to bring up the dialog of values and select USD does this error go away. Why does this happen ?