Skip to Content
0
Former Member
Oct 24, 2011 at 02:41 PM

some questions about dropdown list.

35 Views

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