03-30-2008 2:59 PM
form prepare_list_box_for_wstid .
DATA: l_wstid_list TYPE vrm_id,
l_list TYPE vrm_values,
l_value LIKE LINE OF l_list.
CLEAR: l_list, l_value.
REFRESH l_list.
DATA: BEGIN OF l_t_wstid OCCURS 0,
wstid LIKE Z_tbl-wstid,
END OF l_t_wstid.
SELECT wstid
INTO TABLE l_t_wstid
FROM Z_tbl
WHERE wstid ne space.
SORT l_t_wstid.
DELETE ADJACENT DUPLICATES FROM l_t_wstid.
LOOP AT l_t_wstid.
l_value-key = l_t_wstid-wstid.
WRITE l_t_wstid-wstid TO l_value-text.
APPEND l_value TO l_list.
ENDLOOP.
SORT l_list.
Set the LOWER values
l_wstid_list = 'P_WSTID'.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = l_wstid_list
values = l_list.
Set the HIGHER values
l_wstid_list = 'P_WSTID'.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = l_wstid_list
values = l_list.
endform. " prepare_list_box_for_wstid
Whts the wrong in my above code, bcoz, am NOT getting the DROP-DOWN for P_WSTID?
thanq
03-30-2008 3:22 PM
Hi Srinivas,
First, you must declare P_WSTID as a listbox something like this.
parameters: p_wstid type z_tbl-wstid as listbox.
Call the subroutine in the AT SELECTION-SCREEN OUTPUT event as given below.
AT SELECTION-SCREEN OUTPUT.
perform prepare_list_box_for_wstid.
Hope this helps. Rwd points for helpful answers.
Check the below link for more information.
[http://sap.niraj.tripod.com/id38.html|http://sap.niraj.tripod.com/id38.html]
Thanks,
Balaji
03-30-2008 3:22 PM
Hi Srinivas,
First, you must declare P_WSTID as a listbox something like this.
parameters: p_wstid type z_tbl-wstid as listbox.
Call the subroutine in the AT SELECTION-SCREEN OUTPUT event as given below.
AT SELECTION-SCREEN OUTPUT.
perform prepare_list_box_for_wstid.
Hope this helps. Rwd points for helpful answers.
Check the below link for more information.
[http://sap.niraj.tripod.com/id38.html|http://sap.niraj.tripod.com/id38.html]
Thanks,
Balaji
03-30-2008 3:25 PM
thanq,
just curious,
Is it mandatory to use VISIBLE LENGTH, in this case?
If so, Pls. let me know that, Why particularly we need to use ADDITION of VISIBLE LENGTH, if we r implementing DROP-DOWN for my_p_parameter?
thanq
03-30-2008 3:41 PM
VISIBLE LENGTH addition is not mandatory.
In your example, you are displaying the key value as well as the description. just to accomodate those, you can have it.
Hope this helps.
Thanks
Balaji