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

Listbox value

naveenvishal
Contributor
0 Likes
715

ive appended the key-value set into listbox as:

select * from zda_sntype into table lt_zda_sntype.

name = 'PS_PARM'.

loop at lt_zda_sntype into wa_zda_sntype.

value-key = wa_zda_sntype-santyp.

value-text = wa_zda_sntype-txt30.

append value to list.

endloop.

call function 'VRM_SET_VALUES'

exporting

id = name

values = list.

lst_flg = 1.

endif.

IM USING DIALOG MODULE.....

HOW TO GET THE SELECTED VALUE, At runtime....????

In dialog module.........

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
676

the value you selected will store into the variable that you declared as listbox

for eg :

see this code

PARAMETERS: division AS LISTBOX VISIBLE LENGTH 10 USER-COMMAND fcode.

AT SELECTION-SCREEN OUTPUT.

TYPE-POOLS: vrm. " For parameter drop down lists

DATA: name TYPE vrm_id,

list TYPE vrm_values,

value LIKE LINE OF list.

name = dropdown_param.

value-key = 'S'.

value-text = 'Sheets'.

APPEND value TO list.

value-key = 'B'.

value-text = 'Blocks'.

APPEND value TO list.

value-key = 'P'.

value-text = 'Panels'.

APPEND value TO list.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = name

values = list.

START-OF-SELECTION.

IF division = 'S'.

WRITE : 'Sheets Division'.

ENDIF.

IF division = 'P'.

WRITE : 'Panels Division'.

ENDIF.

so we can compare the input by 'divison' in this case.

Hope its Useful ...

6 REPLIES 6
Read only

Former Member
0 Likes
676

Hi Vishal,

U r using a list box in module pool,right..

If it so u can use search and select the list box..Its simple to do tht.From tht we can easily retrieve the value..

In thelayout u select a field from dictionary.If it is already having search help means no problem..U only want to select the listbox type..

Otherwise u want to put search help for tht field.It willbe very simple comparing to tht

reward if useful

Read only

0 Likes
676

Hi,

I think you can simply get the value in PAI.

Once user selected a value then in PAI your field 'NAME' should have the selected value.

Read only

Former Member
0 Likes
677

the value you selected will store into the variable that you declared as listbox

for eg :

see this code

PARAMETERS: division AS LISTBOX VISIBLE LENGTH 10 USER-COMMAND fcode.

AT SELECTION-SCREEN OUTPUT.

TYPE-POOLS: vrm. " For parameter drop down lists

DATA: name TYPE vrm_id,

list TYPE vrm_values,

value LIKE LINE OF list.

name = dropdown_param.

value-key = 'S'.

value-text = 'Sheets'.

APPEND value TO list.

value-key = 'B'.

value-text = 'Blocks'.

APPEND value TO list.

value-key = 'P'.

value-text = 'Panels'.

APPEND value TO list.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = name

values = list.

START-OF-SELECTION.

IF division = 'S'.

WRITE : 'Sheets Division'.

ENDIF.

IF division = 'P'.

WRITE : 'Panels Division'.

ENDIF.

so we can compare the input by 'divison' in this case.

Hope its Useful ...

Read only

Former Member
0 Likes
676

Hi,

In the screen layout editor set the field type as list box.

Then write the code u gave above in a PBO Module.

Specify the name as the screen field name.

Regards,

Renjith Michael.

Read only

0 Likes
676

Also see the sample program demo_dynpro_dropdown_listbox

Read only

Former Member
0 Likes
676

hi

good

check this code ,hope this would help you to solve your problem.

REPORT ZLIST.

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.

thanks

mrutyun^