Skip to Content

Dropdown list value not passed to program.

I have added a dropdown control in a screen. In the runtime system populating the drop down values. However, if the users selects the a value from the dropdown, the value is not getting passed to the screen element.

Please provide your inputs.

Thank you in advance.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 30, 2008 at 05:28 AM

    Usually in PAI the we can get the selected value.

    Pls check the name of the listbox and the name of correponding text box which you placed for the description. IF it is same, try to change any one of them.Also check the LISTBOX name is declared in the TOP include.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 30, 2008 at 03:41 AM

    Raja,

    You have to use below FM to get the values you selected.

    DATA : dynnum TYPE sy-dynnr,

    dynpro_values TYPE TABLE OF dynpread,

    field_value LIKE LINE OF dynpro_values.

    DATA: dynfields TYPE TABLE OF dynpread WITH HEADER LINE.

    PARAMETERS :p_mngrp LIKE viqmsm-mngrp AS LISTBOX VISIBLE LENGTH 9,

    CLEAR : field_value, dynpro_values ,i_qpcd.

    REFRESH : dynpro_values ,i_qpcd.

    field_value-fieldname = 'P_MNGRP'.

    APPEND field_value TO dynpro_values.

    CALL FUNCTION 'DYNP_VALUES_READ'

    EXPORTING

    dyname = sy-cprog

    dynumb = sy-dynnr

    translate_to_upper = 'X'

    TABLES

    dynpfields = dynpro_values.

    READ TABLE dynpro_values INDEX 1 INTO field_value.

    IF NOT field_value-fieldvalue IS INITIAL.

    IF sy-subrc = 0 AND field_value-fieldvalue = 1.

    field_value-fieldvalue = 'I&CSCR'.

    ELSEIF sy-subrc = 0 AND field_value-fieldvalue = 2.

    field_value-fieldvalue = 'I&CSCF'.

    ENDIF.

    ENDIF.

    p_mngrp = field_value-fieldvalue.

    Don't forget to reward if useful......

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 30, 2008 at 04:04 AM

    Hi Raja,

    For me this code is working fine. I have written the code in PBO of screen.

    MODULE init_screen OUTPUT.

    CLEAR wa_itab.

    SELECT matnr

    into table it_matnr

    from mara

    up to 3 rows.

    LOOP AT it_matnr

    into wa_matnr.

    z_key = z_key + 1.

    wa_itab-key = z_key.

    wa_itab-text = wa_matnr-matnr.

    APPEND wa_itab TO it_itab.

    ENDLOOP.

    CALL FUNCTION 'VRM_SET_VALUES'

    EXPORTING

    id = 'ZMATERIAL' " Field where i have created the list box

    values = it_itab

    EXCEPTIONS

    id_illegal_name = 1

    OTHERS = 2.

    ENDMODULE. " init_screen OUTPUT

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 30, 2008 at 04:25 AM

    Hi Raja,

    check this standard demo program and analyise may be u know the problem where do u hv done the error.

    <b>demo_dropdown_list_box</b>

    <b>reward if useful</b>

    regards,

    sunil kairam.

    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.