Application Development and Automation 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: 
Read only

List box selection problem

Former Member
0 Likes
673

Hi

I could form a list box with vrm_set_values.

But the value selected is not being taken.

What to do? Please help.

Vijaya Chamundi

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
629

Hi Ramchender

I have done the same. But I am not getting.

Vijaya Chamundi

7 REPLIES 7
Read only

Former Member
0 Likes
629

Hi Vijaya,


* in PBO

module status_100.

*  in program.

module status_100.

DATA : screen_field TYPE vrm_id.
screen-field-text = 'SCREEN_FIELD-NAME'.  " Pass your List Box Screen Field Name here
** If your screen field name is MARA-MATNR, you need pass this in place of SCREEN_FIELD-NAME

CALL FUNCTION 'VRM_SET_VALUES'
  EXPORTING
    id                    = screen_field
    values                = VALUES
 EXCEPTIONS
   ID_ILLEGAL_NAME       = 1
   OTHERS                = 2

endmodule.

Cheerz

Ram

Edited by: Ramchander Krishnamraju on Nov 9, 2009 7:46 AM

Read only

Former Member
0 Likes
630

Hi Ramchender

I have done the same. But I am not getting.

Vijaya Chamundi

Read only

0 Likes
629

Hi,

try this way,

[http://wiki.sdn.sap.com/wiki/display/Snippets/Abap-Create+Listbox]

Read only

Former Member
0 Likes
629

What should I do with VRM_SET_VALUES procedure for solving my problem.

Read only

0 Likes
629

I think all you need is to access listbox name once you pick any value. It will hold selected item. Refer this program.


REPORT z_listbox NO STANDARD PAGE HEADING.

TYPE-POOLS vrm.
"screen field
DATA: listbox.

"value table
DATA: name TYPE  vrm_id,
      value_tab TYPE vrm_values WITH HEADER LINE.

CALL SCREEN 0900.


*----------------------------------------------------------------------*
*  MODULE init_listbox OUTPUT
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
MODULE init_listbox OUTPUT.

  REFRESH value_tab.
  value_tab-key = '1'.
  value_tab-text = 'TRUE'.
  APPEND value_tab.
  value_tab-key = '0'.
  value_tab-text = 'FALSE'.
  APPEND value_tab.

  name = 'LISTBOX'.

  CALL FUNCTION 'VRM_SET_VALUES'
    EXPORTING
      id              = name
      values          = value_tab[]
    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.

ENDMODULE.                    "init_listbox INPUT


*----------------------------------------------------------------------*
*  MODULE user_command_0900 INPUT
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
MODULE user_command_0900 INPUT.
  IF sy-ucomm = 'FC_LIST'.
    MESSAGE listbox TYPE 'I'.  "show what I have selected
  ENDIF.
ENDMODULE.                    "user_command_0900 INPUT

Regards

Marcin

Read only

Former Member
0 Likes
629

Tried but not getting. The value selected is not being displayed in the field.

Read only

Former Member
0 Likes
629

Solved.