Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create Procedure to Populate Drop-Down List

Status
Not open for further replies.

kvang

Programmer
Oct 7, 2005
129
US
How do I create procedure so that I can use it to populate values in a drop-down list?
 
You need to return two values, one for the actual value and the other for the display value. The result then needs to be returned in XML format.

Code:
TABLE FILE MYFILE
PRINT DST.DISPLAY_VALUE
BY KEY_VALUE
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE PCHOLD FORMAT XML
END
 
Hi, you can use this sample to fill your list box.

DEFINE FILE SCO_PROCESSES
D_PRID/A10 = TRIM('B',FTOA(PROCESSES_ID,'(F10)',D_PRID),10,' ',1,'A10');
D_DESC/A100 = '<option value="'||D_PRID||'">'||PRO_CODE||'</option>';
END

TABLE FILE SCO_PROCESSES
PRINT
D_DESC
BY PRO_CODE NOPRINT
ON TABLE HOLD AS HTMP0001 FORMAT ALPHA
END


-HTMLFORM BEGIN
<html>
<body>
<select name="INT_PROC">
<option selected value="FOC_NONE">TODOS</option>
!IBI.FIL.HTMP0001;
</select>
</body>
</html>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top