01-30-2008 3:33 AM
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.
01-30-2008 5: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.
01-30-2008 3: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......
01-30-2008 4: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
01-30-2008 4: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.
01-30-2008 5: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.