kuldeepsharma
31st May 2007, 14:17
Hi All,

Sir, I am printing targets and actuals on a report.
in after.field for territory I am printing totals for targets and actuals by ticking aggrigate.

Now i need to print % as actuals / tragets x 100.

I am unable to get total for target and actual in variable.

I have tried to do it using following report script.

declaration:

extern domain tcamnt hwl.bud.qty, hwl.act.qty


detail.1:
before.layout:

hwl.bud.qty = hwl.bud.qty + bud.qty
hwl.act.qty = hwl.act.qty + act.qty

but this is not giving me the total at after.field layout.
moreover when I tried to print these total on the details layout. I have found out that its not being added. it is showing only the current transaction value.

Please help me I will thankful to you

regards
kuldeep sharma

mark_h
31st May 2007, 15:10
Do you have a detail.1 layout? If you plan on using the detail.1 in the script you need an empty detail.1 layout. In debug mode do you see where this code is getting executed. Are the totals correct as it moves through this code. Also make sure on the report that where you print hwl.bud.qty and hwl.act.qty you do not have totals turned on.

Here is a sample that works for me:

detail.1:
before.layout:
if(mhrs>0) then
detail.perform = (production.time/mhrs)*100
else
detail.perform = 0
endif

after.layout:
sub.wc.prod.time = sub.wc.prod.time + production.time
sub.wc.expended.hours = sub.wc.expended.hours + mhrs
main.wc.prod.time = main.wc.prod.time + production.time
main.wc.expended.hours = main.wc.expended.hours + mhrs
site.prod.time = site.prod.time + production.time
site.expended.hours = site.expended.hours + mhrs

after.main.wc.1:
before.layout:
if(main.wc.expended.hours>0) then
main.wc.perform = (main.wc.prod.time/main.wc.expended.hours)*100.00
else
main.wc.perform = 0
endif

after.layout:
main.wc.prod.time = 0.0
main.wc.expended.hours = 0.0


I only included a couple of the layout calculations.

bdittmar
31st May 2007, 15:23
Hi All,

Sir, I am printing targets and actuals on a report.
in after.field for territory I am printing totals for targets and actuals by ticking aggrigate.

Now i need to print % as actuals / tragets x 100.

I am unable to get total for target and actual in variable.

I have tried to do it using following report script.

declaration:

extern domain tcamnt hwl.bud.qty, hwl.act.qty


detail.1:
before.layout:

hwl.bud.qty = hwl.bud.qty + bud.qty
hwl.act.qty = hwl.act.qty + act.qty

but this is not giving me the total at after.field layout.
moreover when I tried to print these total on the details layout. I have found out that its not being added. it is showing only the current transaction value.

Please help me I will thankful to you

regards
kuldeep sharma

Hello,
i see your declaration is from type amount (tcamnt). Maybe you will calculate quantities from type tcqana.

The way you are will be right, for amounts i've realized it in a report like this :

detail.1:
before.layout:

sum.soll.mo=sum.soll.mo+soll.mo
sum.ae.mo=sum.ae.mo+ae.mo
sum.ums.mo=sum.ums.mo+ums.mo
sum.soll.ja=sum.soll.ja+soll.ja
sum.ae.ja=sum.ae.ja+ae.ja
sum.ums.ja=sum.ums.ja+ums.ja
sum.ums.vj=sum.ums.vj+ums.vj

In layout after field :


| Column /Row : 32 / 14 |----------------------------------------------------
| Print Expression : sum.soll.mo |
| Domain : tc amnt Double
| Link with Domain : Nein
| - Print Length : 9
| - Print Format : ZTZZZTZZZ


Regards

kuldeepsharma
4th June 2007, 07:51
Dear Mark and bdittmar

I have used detail.1 at in the report layout.

i have tried to debugged this.

The totals are executed in the before. layout.

but these are again getting to zero at
"function extern r.read.seq.file()"

i dont know why ?

I have not used any function by this name in the report script.
kindly tell how to rectify it.

Thanks

csecgn
4th June 2007, 13:42
Just one question: Did you define your vars as report input fields also (session ttadv3132s000)? If yes, remove them there. All vars declared there become initialized during every detail execution. And in your case this is 0.00.
The warning message during editing the fields on the report you can ignore.

hth

Regards
Christof

kuldeepsharma
4th June 2007, 14:33
Yes Sir,
I have defined these variables at Input fields.
Now I will remove these and try it.

Thanks

kuldeepsharma
5th June 2007, 09:36
Thank u all sir,
its working ,
Thanks
Kuldeep Sharma