In Subfile,
OPT ShipQuantity QuantityToShip Item# CustomerOrder# ___ ____________ 100 ABC1 CO100010 ___ ____________ 10 WQE1 CO100010 This is my SFL Records, Here 2 items,same CustOrder, Qty to ship is 100 & 10,So user can give SHIPQTY <=100 for item(ABC1) and second item wqe1 as SHIPQTY <=10 Selling Price is 100...
I have entered 5 for first item(ABC1) and 5 for second item(WQE1)... After i give these values,i m displaying another screen and coming back here to this subfile....
Now if i press F2,it should calculate as Temp=(5*100)+(5*100) so Temp = 1000... But without pressing F2 if i changes values ie in SHIPQTY for both items , say as I have entered 3 for first item(ABC1) and 1 for second item(WQE1)... Now if i press F2,it should calculate as Temp=(3*100)+(1*100) so Temp = 400...
but i am getting as Temp = 1000 + 400= 1400... How to resolve this... if i change the value,the previous value shud get erased.. so oly it will work...but how the code is... Pls rep as soon...
Software/Hardware used:
As400
ASKED:
May 3, 2011 11:36 AM
UPDATED:
June 10, 2011 7:44 AM
I think we need to see pertinent portions of the source code that does your calculations in order to really answer this question properly. Be sure to format using the ‘code’ style! I always forget!
Be sure to put in your DDS as well as your RPG code for us to figure it out.
First though, you should used DEBUG to step through your code to see what is happening.
actually its a project modifications,
SomeBody’S logic,if i got this answer i can move on to next step,so only
Without seeing the code, we probably can’t say much more than to stop accumulating the values each time; clear (initialize to zero) the summary variables before reading the subfile.
Tom
Looks like the value of TEMP should be reinitialised before processing the changes in the subfiles again and recalculating the TEMP value. If the first time you do a READC to the Subfile to calculate the value, you should update the subfile record with the SFLNEXTCHG indicator on. That will insure that you will READ all values entered in the subfile again, even if they are not changed by the user.