AnuKass
2nd July 2018, 14:37
hii.....
is there any possible to get all field name one by one while give input as table name...????:o

mark_h
2nd July 2018, 14:57
I am not sure I understand the question - but you can use sql to read the tools table for a table layout. You might need more than the table name - like the VRC. Below is a few snippets of code I use in 4c4 to get a package and domain - never really used the program.

select ttadv422.*
from ttadv422
where ttadv422._index4 ={:field.package,:field.domain}
and ttadv422._compnr = 0
order by ttadv422._index1
selectdo
| Setup table and field names
table.name = ttadv422.cpac & ttadv422.cmod & ttadv422.flno
table.field = ttadv422.fdnm
title(table.name & "." & table.field)

| Check to make sure the field matches the specific field.
if not isspace(check.field) then
if strip$(ttadv422.fdnm) <> strip$(check.field) then
| Not the same field
continue
endif
endif

| Get starting VRC for each table. Using users current package/vrc.
get_current_pvrc()

| Search VRC will return true when the curr fields point to the lastest
| VRC for the table.
rc = 0
while rc = 0 and strip$(curr.tver(1,1)) <> ""
rc = vrc_search_table(ttadv422.cpac,ttadv422.cmod,ttadv422.flno,
tdep,curr.tver,curr.trel,curr.tcus)
if rc = 0 then
get_parent_pvrc()
endif
endwhile

| Make sure table to be exported is in the most recent VRC for that table.
if(curr.tver(1,1) = ttadv422.vers and
curr.trel(1,1) = ttadv422.rele and
curr.tcus(1,1) = ttadv422.cust) then
cvrc = curr.tver(1,1) & curr.trel(1,1) & curr.tcus(1,1)
| Only do those fields that have data.
|if field_is_used() then
table.rows = count_table_rows()
update_tuddc921_table()
|endif
endif
endselect

}
|******************************************************************************
| Used to get the users current VRC. You always want to start in that VRC.
|******************************************************************************
function get_current_pvrc()
{
select ttadv040.*
from ttadv040
where ttadv040.user = :logname$
and ttadv040._compnr = 0
as set with 1 rows
selectdo
endselect
curr.tver(1,1) = ttadv040.vers
curr.trel(1,1) = ttadv040.rele
curr.tcus(1,1) = ttadv040.cust
}

|******************************************************************************
| Used to get the "derived from" VRC for a given VRC.
|******************************************************************************
function get_parent_pvrc()
{
domain ttadv.vers tver
domain ttadv.rele trel
domain ttadv.cust tcus

tver = curr.tver(1,1)
trel = curr.trel(1,1)
tcus = curr.tcus(1,1)

select ttadv111.*
from ttadv111
where ttadv111._index1 = {:ttadv422.cpac,:tver,:trel,:tcus}
and ttadv111._compnr = 0
as set with 1 rows
selectdo
curr.tver(1,1) = ttadv111.vedf
curr.trel(1,1) = ttadv111.redf
curr.tcus(1,1) = ttadv111.cudf
selectempty
curr.tver(1,1) = ""
endselect
}

bdittmar
2nd July 2018, 16:42
hii.....
is there any possible to get all field name one by one while give input as table name...????:o

Hello,
use "print table dev" (ttadv4420m000).

It Shows all fields and Domains for a given table.

Regards

NPRao
2nd July 2018, 18:01
You can use rdi.table() (http://www.baanboard.com/programmers_manual_baanerp_help_functions_runtime_dictionary_information_rdi_table) and rdi.table.column() (http://www.baanboard.com/programmers_manual_baanerp_help_functions_runtime_dictionary_information_rdi_table_column)