﻿
// Create a GuiXT table variable for the dropdownlist
CreateTable V[ddltab_mm01_mtvfp] key text

// Prepare parameters for reading the text table

// we join the check table "TMVF" and the text table "TMVFT"
Set V[table] "TMVF left outer join TMVFT on TMVFT~MTVFP = TMVF~MTVFP and TMVFT~SPRAS = '&V[_language]'"

// we use an outer join together with the "coalesce" function
// in order to replace non-existing texts with the key value
Set V[fields] "TMVF~MTVFP, COALESCE( TMVFT~BEZEI | TMVF~MTVFP ) as F2"

// Read table via RFC call
Call /guixt/dbselect -bundle _
  export.table="table" _
  export.fields="fields" _
  import.values="ddltab_mm01_mtvfp"
