Subfile code for AS/400

510 pts.
Tags:
AS/400
AS/400 Subfiles
RPG
Subfile
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

Answer Wiki

Thanks. We'll let you know when a new response is added.

OPT :____
ShipQuantity : ________
QuantityToShip :100
Item# :ABC1
CustomerOrder# :CO100010

************************************************
OPT :____
ShipQuantity : ________
QuantityToShip :10
Item# :WQE1
CustomerOrder# :CO100010

Rep

Discuss This Question: 6  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Koohiisan
    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! ;)
    5,020 pointsBadges:
    report
  • CharlieBrowne
    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.
    39,815 pointsBadges:
    report
  • 22917
    actually its a project modifications, SomeBody'S logic,if i got this answer i can move on to next step,so only
    510 pointsBadges:
    report
  • TomLiotta
    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
    125,585 pointsBadges:
    report
  • 22917
    [...] 4. Koohiisan, CharlieBrowne, and TomLiotta did their best to help with one member’s subfile code for AS/400. [...]
    0 pointsBadges:
    report
  • pdraebel
    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.
    2,380 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following