metropoj
26th April 2012, 15:01
Hi.

With LN we have a CI table 245 in 620 financial company and a logistic company of 600

So, in 620 I want to query the 600 level pci table:

select tipcf530.*
from tipcf530 ( of company level 600 )
where tipcf530._index1= {:cisli245.cpva}

Of course it is trying to retrieve ( I think ) from tipcf530620instead of 600 because i dont know how to change my query that access diferent tables in LN :) ....

CISLI contains the index field SLCP which states the "source company" of the transaction ... in this case SLCP is '600'

How to query the tipcf530 "600" level table via code based on this SLCP value ?

I am having trouble jumping the gap ... Thanks !!!!

mark_h
26th April 2012, 15:50
Use tipct530._compnr = 600 in the where clause. One example on how we pull data from a simulation company - the user provides the company on the form:

and tipgc510._index1 = {tipgc610.ccot, tipgc610.orno}
and tipgc510.stat = tipgc.stat.simulated
and tipgc610._compnr = :simulated.comp
and tirou001._compnr = :simulated.comp
and tipgc510._compnr = :simulated.comp

metropoj
26th April 2012, 20:40
Thanks Mark. That did the trick .....

I was also fooled by the fact the cisli245 table needed to also be read in first as I had assumed the invoice report was already populated with the sli245 values. It wasn't ...


select tipcf530.cpva, tipcf530.dsca, tipcf530.amnt
from tipcf530
where tipcf530._compnr = {:cisli245.slcp} and tipcf530._index1= {:cisli245.cpva}

You de man .....