Skip to Content
0
Former Member
Apr 11, 2008 at 07:00 AM

list box(drop down box) issue

15 Views

Hi experts,

I have created a list box(drop down list in module-pool program).in that values are appearing in my list box.but, when i select a row from that list it is not standing in that field.

see the code.

TYPE-POOLS:vrm.
DATA:FIELD1(10),field2(10).
DATA:lines TYPE VRM_VALUE OCCURS 0,
     line TYPE vrm_value.
DATA:t_lfa1 TYPE TABLE OF lfa1 WITH HEADER LINE.
SET SCREEN 100.

MODULE STATUS_0100 OUTPUT.
  SET PF-STATUS 'MENU'.
*  SET TITLEBAR 'xxx'.
ENDMODULE.                 " STATUS_0100  OUTPUT

MODULE list_box_0100 OUTPUT.

  SELECT * from lfa1 into table t_lfa1 UP TO 10 rows.

  clear:lines[],line-key.
  loop at t_lfa1.
    line-key = line-key + 1.
    line-text = t_lfa1-name1.
    APPEND LINE to LINES.
  endloop.

  CALL FUNCTION 'VRM_SET_VALUES'
    EXPORTING
      ID                    = 'FIELD1'
      VALUES                = lines.

ENDMODULE.                 " list_box_0100  OUTPUT

MODULE USER_COMMAND_0100 INPUT.
  CASE SY-UCOMM.
    WHEN 'BACK'.                 "Back
      set SCREEN 0.
    WHEN 'SEL'.
      MESSAGE I000(zmsg) with field1.
  ENDCASE.
ENDMODULE.                 " USER_COMMAND_0100  INPUT

flow logic for screen 100.

PROCESS BEFORE OUTPUT.
 MODULE STATUS_0100.
 MODULE list_box_0100.
*
PROCESS AFTER INPUT.
 MODULE USER_COMMAND_0100.

regards,

Hi.