‎2008 Feb 14 8:48 AM
hi, how do i pull the distinct value from the database table into the dropdown list?
my database table have 2 columns: program id and program code. how can i pull the first line of code of every program and populate them inside the dropdown list?
pls give code sample.
thanks. <REMOVED BY MODERATOR>
Edited by: Alvaro Tejada Galindo on Feb 14, 2008 2:36 PM
‎2008 Feb 14 8:52 AM
hi,
Use
SELECT DISTINCT...
<REMOVED BY MODERATOR>
Regards,
Mansi.
Edited by: Alvaro Tejada Galindo on Feb 14, 2008 2:37 PM
‎2008 Feb 14 8:55 AM
no it doesn't work. right now in my table, i have 14 programs inside (each containing many lines of codes) and the program id for the program is distinct (each program have different id). how can i get the first line of code from each program and display in the dropdown list?
‎2008 Feb 14 8:59 AM
Hi
U need to declare the structure to transfer the data to be displayed in the dropdown list:
TYPE-POOLS VRM.
DATA: NAME TYPE VRM_ID,
LIST TYPE VRM_VALUES,
VALUE LIKE LINE OF LIST.In a PROCESS ON VALUE-REQUEST, you need to populate it with the data you want to show:
REFRESH LIST.
NAME = <OUTPUT FIELD NAME>.
* Get the values:
SELECT * FROM <TABLE> WHERE ....
VALUE-KEY = <PROGRAM CODE>.
VALUE-TEXT = <PROGRAM NAME>.
APPEND VALUE TO LIST.
ENDSELECT.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = NAME
VALUES = LIST.This is an sample only, how to populate the internal table LIST depends on where you have stored the program name and code.
Max
‎2008 Feb 14 9:23 AM
what do i put for the program code and program name? i want it to retrieve from database and display accordingly..but isn't this hard coding?