anushka_17
30th August 2015, 17:47
Hello All,
I made a print session where item,wharehouse valuation group,project no are my inputs.....and i need to calculate mauc value using attr.rotate function....Can anyone pls tell me what do i need to add to my code to make it work....bcoz m getting fatal error...:Use of null pointer on ' '...cannot continue session..
below is my script:
function read.main.table()
{
currency = attr.rotate
select whina134.*
from whina134
where whina1234.index1={:i.item,:i.wvgr,:i.cprj}
selectdo
select whina135.*
from whina135
where whina135._index1={:i.item,:i.wvgr,:i.cprj}
selectdo
o.mauc(currency) =o.mauc(currency) + whina135.mauc(1)
endselect
endselect
}
plz help!!!
bdittmar
30th August 2015, 18:39
Hello,
this is a predefined variable.
Type Name Attr. Description
long attr.rotate 4 Current index in currency table (see set.currencies() function).
it's used in conjunction with set.currencies.
set.currencies()
Syntax:
function void set.currencies (long seqno, string currency(3) [, string currency.desc mb])
Description
Use this function to create and fill the multicurrency table. The function inserts a single entry in the table. Currency rotation is based on the order of currencies in this table. Make sure that all the indices of the table (seqno) form a consecutive range, starting at 1
Arguments
long seqno sequence of currency when rotating
string currency(3) currency that is assigned to attr.currency$
[string currency.desc mb ] Label referring to currency description or currency description itself. In the latter case, the currency description must start with the at sign [@]. Note that using a literal string makes the script language dependent.
Context
This function can be used in 4GL script types.
Example
set.currencies( 1, "EUR" )
set.currencies( 2, "USD" )
set.currencies( 3, "GBP" )
Example using labels for descriptions
set.currencies( 1, "EUR" , "tctcemms1000") |* Loc.Curr.
set.currencies( 2, "USD" , "tctcemms1001") |* Rep.1.Curr.
set.currencies( 3, "GBP" , "tctcmemm1002") |* Rep.2.Curr.
Example using descriptions
set.currencies( 1, tcemm170.fcua , "@" & tt.field.desc("tcemm170.fcua"))
set.currencies( 2, tcemm170.fcub , "@" & tt.field.desc("tcemm170.fcub"))
set.currencies( 3, tcemm170.fcuc , "@" & tt.field.desc("tcemm170.fcuc"))
Regards
anushka_17
30th August 2015, 21:20
I went through this in programmers guide...but m not able to understand how do I apply this in my script ....can u pls tell me how shall I use this in my script given above
sujeetkumar
3rd September 2015, 08:24
Hi,
Try the below codes, hope it will fulfill your requirement.
declaration:
extern domain tcccur ccur
extern domain tcncmp i.comp
extern domain tcpono curr.position
domain tcccur hcur(3)
domain tcmcs.long no.hcur
domain tcemm.depe g.currency.system
before.program:
handle.currency.system()
|***********************************
|*Form Field When Rotate Currency Command is Pressed
|*Based on Defined Currency System , It shows the Currency
|***********************************
field.ccur:
before.display:
ccur = attr.currency$
curr.position = attr.rotate
function read.main.table()
{
| currency = attr.rotate
select whina134.*
from whina134
where whina1234.index1={:i.item,:i.wvgr,:i.cprj}
selectdo
select whina135.*
from whina135
where whina135._index1={:i.item,:i.wvgr,:i.cprj}
selectdo
o.mauc(curr.position) =o.mauc(curr.position) + whina135.mauc(curr.position)
endselect
endselect
}
|***********************************
|* Standard dlls used to find the Currency System
|***********************************
function handle.currency.system()
{
tcemm.dll5000.get.home.currency.system(
i.comp,
hcur,
no.hcur,
g.currency.system,
ccur)
tcemm.dll5000.position.of.hcur( i.comp,
ccur,
curr.position)
}