10-24-2011 3:41 PM
1. How can I get value of selected item? Actually i have read a lot of threads about this issue. e.g. ov_io_field is the name of i/o field on my screen. And once a item of dropdown list is selected the field is filled automatically. We can get the value directly from this field. But I am still very confused how can I declare the i/o field from screen painter. If I debug my program, the field is empty.
DATA:ov_io_field TYPE CHAR32,
ov_name TYPE vrm_id,
ot_values TYPE vrm_values.
ls_value LIKE LINE OF ot_values.
ov_name = 'ov_io_field'.
ls_value-key = 1.
ls_value-text = 'text1'.
APPEND ls_value TO ot_values.
ls_value-key = 2.
ls_value-text = 'text2'.
APPEND ls_value TO ot_values.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = ov_name
values = ot_values
EXCEPTIONS
id_illegal_name = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
2. I use function code 'CONTAINER' in PBO to process the selection. But after execution of the block 'process_boxlist_container300' the programm go back to the PAI of current screen and the i/o field of dropdown list is refreshed. The selected value is cleared.
MODULE user_command_0300 INPUT.
save_code = ok_code.
CLEAR ok_code.
CASE save_code.
WHEN 'BACK300'.
SET SCREEN 200.
WHEN 'EXIT'.
LEAVE PROGRAM.
WHEN 'CONTAINER'.
PERFORM process_boxlist_container300.
ENDCASE.
ENDMODULE. " USER_COMMAND_0300 INPUT
10-25-2011 2:01 AM
I use function code *'CONTAINER' in PBO* to process the selection. But after execution of the block 'process_boxlist_container300' the programm go back to the PAI of current screen and the i/o field of dropdown list is refreshed. The selected value is cleared.
" MODULE user_command_0300 INPUT. ..
..
ENDMODULE. " USER_COMMAND_0300 INPUT "
Can you be please clear, you used block in PAI. *MODULE user_command_0300 INPUT.*
and saying used in PBO ?
You use FM in PBO and try,
or else,
try FM DYNP_VALUES_UPDATE, DYNP_VALUES_READ
if your field declared i/o field with list box, just go to property and tick "Possible Entries" if you have data in dictionary,
10-25-2011 8:20 AM
yes.you are right. I have made a mistake. Actually I have put the block in PAI.
My question is: Is the screen refreshed again after PAI if there is no 'set screen ***' was called at the end?
10-26-2011 5:43 AM
No it will not refresh or anything, only your coding in PAI is processed,
Is your problem is after selecting from dropdown also the field is empty?
10-26-2011 8:45 AM
Yes. That was my question, it is solved now. Because I have assigned value to ov_name in lowercase. It wastes a lot of time if we dont know the problem is only because of case sensitive.....