AnuKass
17th January 2019, 15:19
Hi all,
i need all table field name as it as in the table.
i used rdi.table.column function but it gives the fields are ascending order .
please help me..
mark_h
17th January 2019, 16:59
Not really sure what you are trying, but in 4c4 I might just try reading ttadv422 to get the fields in the correct order.
AnuKass
18th January 2019, 05:52
Hi.. mark_h..
Thanks for your reply..
can you please explain detail???how to read ttadv422 table for particular table field??
Thanks in Advance..
mark_h
18th January 2019, 14:38
Something like this - in the below case it was basically like enter a package and domain. Go find where it is used and if the table has data in it. Never was used for anything, but I still keep most of my code around.
function find_tables()
{
long tdep,rc
tdep = 1
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
}
AnuKass
23rd January 2019, 06:27
Thanks..for your reply ...
it's working ..