Skip to Content
author's profile photo Former Member
Former Member

Save selected value from DropdownbyKey

Hi All,

i'm using DropdownbyKey to display a set of values. i hav two dropdown elements. one displays char type value set and another is numc type. i'm able to get and save the char type attribute, but when i try to get the numc type attribute i am getting the following error.

The value selectedKey = "422.94" in DropDownByKey "PRICE" does not exist in the value list and is not initial either

Thanks in Advance

Murli

Edited by: Murli on Oct 24, 2008 8:04 AM

Edited by: Murli on Oct 24, 2008 8:05 AM

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

8 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 24, 2008 at 06:13 AM

    Hi,

    Try to declare type as currency.

    check the price field in sflight structrure for your reference.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 24, 2008 at 10:10 AM

    Hi Uday,

    can u please tell how u set the values. the following the way how i did it. its in doinit method.

    LOOP AT lt_output INTO ls_output.

    ls_valueset_price-value = ls_output-carrid.

    ls_valueset_price-text = ls_output-price.

    APPEND ls_valueset_price TO lt_valueset_price.

    ENDLOOP.

    lo_nd_output_info->set_attribute_value_set(

    EXPORTING

    name = 'PRICE'

    value_set = lt_valueset_price ).

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 24, 2008 at 06:36 AM

    Hi Suman,

    Whr should i declare the type as currency, in Dictionary table??

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 24, 2008 at 06:58 AM

    Hi Murli,

    i trying to using numc its working.

    where you declare type numc .

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 24, 2008 at 07:13 AM

    Hi,

    Thanks for ur reply...

    I'm using the method "set_attribute_value_set" to set the value set for the dropdownbykey and all the values are getting displayed. But when i try to get the selected values by using "get_attribute method", i'm able to get the attributes for any fields related to character type. But when i do the same for any Numeric type i'm getting the error.

    for example, i'm able to get the selected values from currency and planetype fields, but not for price, seatsmax, seatsocc etc..

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Murli,

      I did try replicating the scenario for a dropdown which was displaying the PRICE values from SFLIGHT table. The get_attribute method is working perfectly fine and is able to retrieve the selected attribute. Try mention the type of the context attribute as S_PRICE. (This is the data element for the PRICE field.)

      data : lead_selection_index type i value 0,
               lv_price type sflight-price.
      
        lv_node = wd_context->get_child_node( name = 'DROPDOWN' ).
      
        lead_selection_index = lv_node->get_lead_selection_index( ). " Get the index number of the value selected from dropdown
      
        CALL METHOD lv_node->get_attribute "Get the corresponding value by using this index and passing the name of context attribute
          EXPORTING
            index = lead_selection_index
            name  = 'PRICE_VALUE'
          IMPORTING
            value = lv_price.

      At the end lv_price is having the correct value of the price selected by the user from the dropdown.

      Regards,

      Uday

  • Posted on Oct 24, 2008 at 10:45 AM

    LOOP AT lt_output INTO ls_output.

    ls_valueset_price-value = ls_output-carrid.

    ls_valueset_price-key = ls_output-carrid.

    APPEND ls_valueset_price TO lt_valueset_price.

    ENDLOOP.

    lo_nd_output_info->set_attribute_value_set(

    EXPORTING

    name = 'PRICE'

    value_set = lt_valueset_price ).

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 24, 2008 at 10:43 AM

    hi

    plz correct your code.

    LOOP AT lt_output INTO ls_output.

    ls_valueset_price-value = ls_output-carrid.

    ls_valueset_price-text = ls_output-carrid.

    APPEND ls_valueset_price TO lt_valueset_price.

    ENDLOOP.

    lo_nd_output_info->set_attribute_value_set(

    EXPORTING

    name = 'PRICE'

    value_set = lt_valueset_price ).

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 30, 2008 at 09:08 AM

    Hi.....

    For Dropdownbykey you have to pass the values like this....

    where in the LT_OUTPUT TABLE.....for example values are like...

    SLART STEXT

    10 Primary school

    20 Secondary school

    30 Higher sec.school

    40 Bachelor degree

    then...

    LOOP AT LT_OUTPUT INTO LS_OUTPUT.

    LS_VALUESET-VALUE = LS_SUBTY-SLART.

    LS_VALUESET-TEXT = LS_SUBTY-STEXT.

    APPEND LS_VALUESET TO LT_VALUESET.

    ENDLOOP.

    Thanks & regards

    Raja

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.