rwhisenant
23rd April 2014, 22:31
Hello,

I'm a newbie to Baan LN and 4gl scripting. I have a script that isn't returning data because I think it is trying to hit the wrong table. I have a current company 300 that get.compnr() returned in the script. I need to read table cisli205 using finance company 140 (I think). Is there a command or method for me to get the finance company associated with current company 300?

Thanks,

abattoir
24th April 2014, 00:13
Hi,

You can use table tfgld000 to get to the finance company from logistic company. In your case 140 from 300.
Use function to "switch.to.company" to read the tables of finance company (140).

Regards,
Abattoir

bhushanchanda
24th April 2014, 10:18
Hi,

If you use switch.to.company() do remember to switch back to original company to avoid problems. Else, you can use table_name._compnr too.

e.g.

select cisli205.*
from cisli205
where cisli205._compnr = :finance.company
selectdo
endselect

rochus
24th April 2014, 15:36
you have to use this setup to start your session in a financial company.
than you automatically in the correct company.
otherwise all data belongs to tcemm (Enterprise Management),
over department, warehouse etc ...

rwhisenant
24th April 2014, 17:02
Thanks for the information folks. I'm working with my senior mentor now using the information y'all provided.

I will give an update as soon as possible.

rwhisenant
28th April 2014, 17:52
I have now got past getting to the correct tables since my main table was cisli205, a financial table, I started off in company 140. Most of the other tables are financial tables using company 140 or 110. When I needed the logistic company to get to the correct table, tables cisli245 and cisli255 have a field SLCP which I could read in and use with _compnr to get the correct table for the logistic company.

Thanks for the input. I now have another issue which I'll open another thread and it concerns using a report script. I have a variable sprt (for summary report) that is set in the program script. In using debug for both the program and report script, I see the sprt variable set to true (boolean 1) in the program script but it is false (boolean 0) in the report script.

Thanks for you help on the initial issue. Look for the new thread shortley on the variable sprt from program to report script.

Thanks again,

RWhisenant

bhushanchanda
28th April 2014, 18:27
Hi,

Make sure you have not declared that variable in your Report Script as well as added it as Report Input Field. Do any one of these i.e. either declare it in your report script or add it as report input fields.

If you are not printing it on your report, you can avoid doing both.