2009 Jan 30 4:39 AM
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
2009 Jan 30 4:46 AM
2009 Jan 30 4:46 AM
2009 Jan 30 4:50 AM
2009 Jan 30 4:50 AM
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.
2009 Jan 30 5:36 AM
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