Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

some questions about dropdown list.

Former Member
0 Kudos

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

4 REPLIES 4

surajarafath
Contributor
0 Kudos

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,

0 Kudos

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?

0 Kudos

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?

0 Kudos

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.....