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: 

generate value in list box in dialog programming

Former Member
0 Kudos

Hi experts

i have created a input/output field with list box. But in list box nothing value is given. this field is a type of id field, but now i need description is to be selected for that field , so what should i do? please describe some process and code

5 REPLIES 5

Former Member
0 Kudos

Hi,

In the PBO of the screen , Use FM 'VRM_SET_VALUES' , pass ur value into parameter 'VALUES' in the form of internal table.

Reagards,

Talwinder

0 Kudos

hi

can you describe elaborately with some sample code?

Former Member
0 Kudos

Hi

pls. chk the below program.

TYPE-POOLS: VRM.

DATA: NAME TYPE VRM_ID,

LIST TYPE VRM_VALUES,

VALUE LIKE LINE OF LIST.

PARAMETERS: PS_PARM(10) AS LISTBOX VISIBLE LENGTH 10.

AT SELECTION-SCREEN OUTPUT.

NAME = 'PS_PARM'.

VALUE-KEY = '1'.

VALUE-TEXT = 'LINE 1'.

APPEND VALUE TO LIST. VALUE-KEY = '2'.

VALUE-TEXT = 'LINE 2'.

APPEND VALUE TO LIST.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

ID = NAME

VALUES = LIST.

START-OF-SELECTION.

WRITE: / 'PARAMETER:', PS_PARM.

Former Member
0 Kudos

Hi ,

In that PBO use the below coding:



NAME = 'PS_PARM'. " Here u pass the listbox field name 
  VALUE-KEY = '1'.
  VALUE-TEXT = 'LINE 1'.
  APPEND VALUE TO LIST.
  VALUE-KEY = '2'.
  VALUE-TEXT = 'LINE 2'.
  APPEND VALUE TO LIST.
  CALL FUNCTION 'VRM_SET_VALUES'
  EXPORTING
  ID = NAME
  VALUES = LIST. 

Regards,

Dhina..

Former Member
0 Kudos

Hi,

Check below code.

In this method we set the value list attribute to 'A'.The value list will be filled in the PBO by using FM VRM_SET_VALUES .

TYPE-POOLS : VRM

DATA : field_id TYPE VRM_ID ,

values TYPE VRM_VALUES,

value LIKE LINE OF values.

PROCESS BEFORE OUTPUT

MODULE list_fill_100

MODULE list_fill_100 OUTPUT

SELECT f1 f2 f3 FROM tab WHERE condition.

value-KEY = f1.

value-TEXT = f2

APPEND value TO VALUES

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = 'i/o screen field'

values = values.

ENDMODULE.

Ram.