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

distinct value dropdown list

Former Member
0 Likes
569

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

4 REPLIES 4
Read only

Former Member
0 Likes
543

hi,

Use

SELECT DISTINCT...

<REMOVED BY MODERATOR>

Regards,

Mansi.

Edited by: Alvaro Tejada Galindo on Feb 14, 2008 2:37 PM

Read only

Former Member
0 Likes
543

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?

Read only

Former Member
0 Likes
543

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

Read only

Former Member
0 Likes
543

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?