Problem updating last record written at sort break in QTP
Pickering, John (NORBORD)
John.Pickering@norbord.com
Thu, 9 Dec 2004 14:32:27 -0500
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C4DE25.D13C1B30
Content-Type: text/plain;
charset="iso-8859-1"
Tim
When does Qtp retrieve the record that you are asking it to update when a
rounding error update is needed? My guess is that it is not when you hope it
will be, i.e. "at item-no". Probably it tries the retrieval at the start of
output processing for the transaction set -- at which point the new
transaction record doesn't yet exist.
I can think of a couple of choices. If extra records in the transaction file
don't bother you then just add the balancing record instead of attempting to
update the last one written. If extra records are a problem then put the
unique key and the correct value into a subfile and process these as updates
in a new request.
Regards,
JWP
-----Original Message-----
From: Tim Cummings [mailto:tim.cummings@frequencymarketing.com]
Sent: Thursday, December 09, 2004 2:11 PM
To: Cognos Powerhouse List (E-mail)
Subject: RE: Problem updating last record written at sort break in QTP
I'm not allowed to send out actual code, so I have to cut out some stuff
and change the names of other stuff. The code below is all I can share.
The problem I believe the problem is in the phases of QTP processing (I'm
guessing).
Tim
CAN CLE
ACCESS ORDER-ITEMS &
LINK XXX OF ORDER-ITEMS &
TO PR-XXX OF XXX-RATIO
DEFINE SPOILED-CREDITS INTEGER SIGNED SIZE 4 = BR-CREDITS of order-items
&
* QUANTITY-ON-HAND of
order-items &
* (PR-PERCENT of XXX-ratio /
100)
TEMPORARY CREDIT-TOTAL NUM*8
SORT ON ITEM-NO
ITEM CREDIT-TOTAL SUBTOTAL SPOILED-CREDITS RESET AT ITEM-NO
OUTPUT TRANSACTIONS ADD NOITEMS ALIAS Oo-TRX
ITEM UNIT OF Oo-TRX INITIAL "9999999999"
ITEM TRAN-KEY OF Oo-TRX INITIAL "Oo" + ITEM-NO + PR-PREFIX
ITEM CREDITS OF Oo-TRX FINAL SPOILED-CREDITS
OUTPUT TRANSACTIONS UPDATE ALIAS LASTOo AT ITEM-NO &
VIA TRAN-KEY USING "Oo" + ITEM-NO + PR-PREFIX &
IF 0 <> (BR-CREDITS * QUANTITY-ON-HAND - CREDIT-TOTAL)
ITEM CREDITS OF LASTOo = CREDITS OF LASTOo+ ((BR-CREDITS *
QUANTITY-ON-HAND - CREDIT-TOTAL * -1))
GO
------_=_NextPart_001_01C4DE25.D13C1B30
Content-Type: text/html;
charset="iso-8859-1"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>Problem updating last record written at sort break in QTP</TITLE>
<META content="MSHTML 5.50.4522.1800" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=296373419-09122004><FONT face=Arial color=#0000ff
size=2>Tim</FONT></SPAN></DIV>
<DIV><SPAN class=296373419-09122004><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=296373419-09122004><FONT face=Arial color=#0000ff size=2>When
does Qtp retrieve the record that you are asking it to update when a rounding
error update is needed? My guess is that it is not when you hope it will be,
i.e. "at item-no". Probably it tries the retrieval at the start of output
processing for the transaction set -- at which point the new transaction record
doesn't yet exist. </FONT></SPAN></DIV>
<DIV><SPAN class=296373419-09122004><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=296373419-09122004><FONT face=Arial color=#0000ff size=2>I can
think of a couple of choices. If extra records in the transaction file don't
bother you then just add the balancing record instead of attempting to update
the last one written. If extra records are a problem then put the unique key and
the correct value into a subfile and process these as updates in a new
request.</FONT></SPAN></DIV>
<DIV><SPAN class=296373419-09122004></SPAN><FONT face=Tahoma><FONT size=2><SPAN
class=296373419-09122004><FONT face=Arial
color=#0000ff></FONT></SPAN></FONT></FONT> </DIV>
<DIV><FONT face=Tahoma><FONT size=2><SPAN class=296373419-09122004><FONT
face=Arial color=#0000ff>Regards,</FONT></SPAN></FONT></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=296373419-09122004>JWP</SPAN></FONT></DIV>
<DIV><FONT face=Tahoma><FONT size=2><SPAN
class=296373419-09122004></SPAN></FONT></FONT> </DIV>
<DIV><FONT face=Tahoma><FONT size=2><SPAN
class=296373419-09122004> </SPAN></FONT></FONT></DIV>
<DIV><FONT face=Tahoma><FONT size=2><SPAN
class=296373419-09122004> </SPAN>-----Original Message-----<BR><B>From:</B>
Tim Cummings [mailto:tim.cummings@frequencymarketing.com]<BR><B>Sent:</B>
Thursday, December 09, 2004 2:11 PM<BR><B>To:</B> Cognos Powerhouse List
(E-mail)<BR><B>Subject:</B> RE: Problem updating last record written at sort
break in QTP<BR><BR></DIV></FONT></FONT>
<DIV><FONT face=Arial><SPAN class=625244418-09122004><FONT color=#0000ff
size=2></FONT> </DIV>
<DIV><FONT face="Courier New" color=#0000ff size=2><SPAN
class=625244418-09122004>I'm not allowed to send out actual code, so I have to
cut out some stuff</SPAN></FONT></DIV>
<DIV><FONT face="Courier New" color=#0000ff size=2><SPAN
class=625244418-09122004>and change the names of other stuff. The code
below is all I can share.</SPAN></FONT></DIV>
<DIV><FONT face="Courier New" color=#0000ff size=2><SPAN
class=625244418-09122004></SPAN></FONT> </DIV>
<DIV><FONT face="Courier New" color=#0000ff size=2><SPAN
class=625244418-09122004>The problem I believe the problem is in the phases of
QTP processing (I'm guessing).</SPAN></FONT></DIV>
<DIV><FONT face="Courier New" color=#0000ff size=2><SPAN
class=625244418-09122004></SPAN></FONT> </DIV>
<DIV><FONT face="Courier New" color=#0000ff size=2><SPAN
class=625244418-09122004></SPAN></FONT> </DIV>
<DIV><FONT face="Courier New" color=#0000ff size=2><SPAN
class=625244418-09122004>Tim</SPAN></FONT></DIV>
<DIV>
<P><FONT color=#0000ff><FONT size=2><FONT face="Courier New">CAN CLE</FONT>
</FONT></FONT></P>
<P><FONT color=#0000ff><FONT size=2><FONT face="Courier New"> ACCESS
ORDER-ITEMS &</FONT> <BR><FONT face="Courier New">
LINK XXX OF ORDER-ITEMS &</FONT> <BR><FONT
face="Courier New"> TO PR-XXX OF
XXX-RATIO</FONT> <BR><FONT face="Courier New"> </FONT><BR><FONT
face="Courier New"> </FONT><BR><FONT face="Courier New">
DEFINE SPOILED-CREDITS INTEGER SIGNED SIZE 4 = BR-CREDITS of order-items
&</FONT> <BR><FONT
face="Courier New">
* QUANTITY-ON-HAND of order-items &</FONT> <BR><FONT
face="Courier New">
* (PR-PERCENT of XXX-ratio / 100) </FONT></FONT></FONT></P>
<P><FONT color=#0000ff><FONT size=2><FONT face="Courier New">
TEMPORARY CREDIT-TOTAL NUM*8</FONT> </FONT></FONT></P>
<P><FONT color=#0000ff><FONT size=2><FONT face="Courier New"> SORT
ON ITEM-NO</FONT> </FONT></FONT></P>
<P><FONT color=#0000ff><FONT size=2><FONT face="Courier New"> ITEM
CREDIT-TOTAL SUBTOTAL SPOILED-CREDITS RESET AT ITEM-NO</FONT> </FONT></FONT></P>
<P><FONT color=#0000ff><FONT size=2><FONT face="Courier New">
OUTPUT TRANSACTIONS ADD NOITEMS ALIAS Oo-TRX</FONT> <BR><FONT
face="Courier New"> ITEM
UNIT OF Oo-TRX
INITIAL "9999999999"</FONT> <BR><FONT face="Courier New"> ITEM
TRAN-KEY OF Oo-TRX INITIAL "Oo" + ITEM-NO +
PR-PREFIX</FONT> <BR><FONT face="Courier New"> ITEM
CREDITS OF Oo-TRX FINAL
SPOILED-CREDITS</FONT> </FONT></FONT></P>
<P><FONT color=#0000ff><FONT size=2><FONT face="Courier New">
OUTPUT TRANSACTIONS UPDATE ALIAS LASTOo AT ITEM-NO &</FONT> <BR><FONT
face="Courier New"> VIA TRAN-KEY USING "Oo"
+ ITEM-NO + PR-PREFIX &</FONT> <BR><FONT
face="Courier New"> IF 0 <>
(BR-CREDITS * QUANTITY-ON-HAND - CREDIT-TOTAL)</FONT> <BR><FONT
face="Courier New"> ITEM CREDITS OF LASTOo = CREDITS OF
LASTOo+ ((BR-CREDITS * QUANTITY-ON-HAND - CREDIT-TOTAL * -1))</FONT> <BR><FONT
face="Courier New">GO</FONT>
</FONT></FONT></P></SPAN></FONT></DIV></BODY></HTML>
------_=_NextPart_001_01C4DE25.D13C1B30--