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: 

Listbox showing numbers at runtime & not values?

Former Member
0 Kudos
284

Hi experts

I am new in ABAP field..

I am developing one smartform..

In program I have 2 list boxes..

When I select pack type(1st listbox) then accordingly values for pack component gets populated in 2nd listbox..

But sometimes it shows me values in listbox which I have given in prg.. when I run that prg n come back to prg it shows me values like 1, or 2, or 3 in listbox & not actual values..

One more thing is when I run prg 1st time, I am able to see the values.. But when I run same prg for the 1st time but on some other machine then it shows me numbers & not values..

I think it is showing me keys (1, 2, 3) instead of values..

Kindly suggest solution

Thanks & Regards

Neha

1 ACCEPTED SOLUTION

Former Member
0 Kudos
124

hi

check this thread

provide

wa_vrm_values-key = 'Key'.

wa_vrm_values-text = 'Value'.

appendwa_vrm_values to lt_vrm_values.

4 REPLIES 4

Former Member
0 Kudos
125

hi

check this thread

provide

wa_vrm_values-key = 'Key'.

wa_vrm_values-text = 'Value'.

appendwa_vrm_values to lt_vrm_values.

Former Member
0 Kudos
124

hi,

have a look on the link below, u can get solution for ur requirement

[;

dev_parbutteea
Active Contributor
0 Kudos
124

Hi,

It actually refers to the index of the table entry with descriptions you have populate to the the first listbox.

If you want to get the selected text, you have to do a read in the table:

read table vrm_value

into wa

with key key = values you got e.g. 1,2...

Regards,

Dev.

Former Member
0 Kudos
124

Hi,

Check the below sample code,

TYPE-POOLS: vrm.

DATA: w_param TYPE vrm_id,
      it_values TYPE vrm_values,
      wa_value LIKE LINE OF it_values.

PARAMETERS: p_rec_ty AS LISTBOX VISIBLE LENGTH 10.
"p_rec_ty contains only the key
AT SELECTION-SCREEN OUTPUT.
  w_param = 'P_REC_TY'.
  wa_value-key = '1'.
  wa_value-text = 'AAAAA'.
  APPEND wa_value TO it_values.
  wa_value-key = '2'.
  wa_value-text = 'BBBBB'.
  APPEND wa_value TO it_values.
  CALL FUNCTION 'VRM_SET_VALUES'
       EXPORTING
            id     = w_param
            values = it_values.

START-OF-SELECTION.
"This is what you have to do, read int tab with key(your parameter).
  READ TABLE it_values INTO wa_value INDEX p_rec_ty.
  WRITE: wa_value-text.

Regards,

Manoj Kumar P