Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Filling Dropdown list box

Hi All,

In PBO module I have aritten the code for dropdown list box.

In the screen design I have named the listbox as I am filling it.

But still data is not getting displayed. Any idea may be something missing in screen design.

Regards,

Jeetu

Tags:
Former Member
Former Member replied

Hi,

plz do following way :

In TOP declare this :

TYPE-POOLS: VRM.

DATA: g_name1  TYPE vrm_id,
      g_list1  TYPE vrm_values,
      g_wa_list LIKE LINE OF g_list1,
      g_value_1 LIKE LINE OF g_list1.

Then in PBO :

MODULE f4_scr OUTPUT.


  REFRESH g_list1.
  g_name1 = c_status.
  g_value_1-key = c_to_be_sub.
  g_value_1-text = c_to_be_sub.
  APPEND g_value_1 TO g_list1.

  g_value_1-key = c_sub.
  g_value_1-text = c_sub.
  APPEND g_value_1 TO g_list1.

  g_value_1-key = c_chg_needed.
  g_value_1-text = c_chg_needed.
  APPEND g_value_1 TO g_list1.

  g_value_1-key = c_app.
  g_value_1-text = c_app.
  APPEND g_value_1 TO g_list1.

  IF NOT g_list1 IS INITIAL.
    CALL FUNCTION 'VRM_SET_VALUES'
      EXPORTING
        id     = g_name1
        values = g_list1.
  ENDIF.

ENDMODULE.                 " F4_SCR  OUTPUT

In PAI:

MODULE user_command_9000 INPUT.
....
* function module to get the list box values.

  g_name1 = c_status.
  CALL FUNCTION 'VRM_GET_VALUES'
    EXPORTING
      id           = g_name1
    IMPORTING
      values       = g_list1
    EXCEPTIONS
      id_not_found = 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.

  READ TABLE g_list1 INTO g_wa_list WITH KEY key = g_status.
  IF sy-subrc EQ 0.
    g_status = g_wa_list-text.
  ENDIF.
....
ENDMODULE.                 " USER_COMMAND_9000  INPUT

thanx.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question