Calculate Value hook

Use this hook to calculate the value for the calculated field. The calculated value must be the return value of the function.

In this hook, all fields of the current table record are available. The hook is called when the staged data is published.

In the code example, the Business Partner data of table tccom100 is published and requires the number of Purchase Orders for the Business Partner.

function extern domain tcmcs.long ext.no.po.calculate()
{
        domain  tcmcs.long    retval

        select  count(*):retval
        from    tdpur400
        where   tdpur400.otbp = :tccom100.bpid
        selectdo
        endselect

        return(retval)
}