GuiXT
Text (7,30) "Planner group" -intensified
DropDownList (8,30) "ddl_plannergroups" width=40 refer="V[plannergroup]" 

// Obtain dropdown list values from SAP customizing table
if not text[ddl_plannergroups]
  // we select a particular plant, could be obtained from user parameters
    Set V[plant] "0006" 
  // clear tables used in RFC call
	Set V[table] "T024I"
	Set V[fields] "INGRP,INNAM"
	Set V[condition] "IWERK = '&V[plant]'"
	
	CreateTable V[t1] ingrp, innam

    // read values from SAP table
    Call "/guixt/dbselect" cache="session" _
		export.TABLE="table" _
		export.FIELDS="fields" _
		export.CONDITION="condition" _
		import.values="t1"

    // put values into dropdownlist
    Set V[i] 1

  label next_entry
    if V[t1.rows>&V[i]]
      Set V[ddl_entry] "&V[t1.ingrp.&V[i]]=&V[t1.ingrp.&V[i]] &V[t1.innam.&V[i]]"
  CopyText toText="ddl_plannergroups" fromString="ddl_entry" -appendline 
Set V[i] &V[i] + 1
     goto next_entry
  endif
endif

Performance hints