× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.




OK. The program is a huge program with a lot of processing, ill try and keep it to the point.
Program1 - Subfile program Order header details.
Program2 - Order Detail Program

Select order number from subfile, and press Enter, Program2 is called.

Program2 performs some calculations and writes the record format on the screen. Performs some more calculations and EXFMT the same record format on the screen. Now when i change the value of the new field on this screen say FIELDA. and press Enter it takes me to another subfile in program2 , where i have the option to press F5 for Update/Accept.
Now on pressing F5 = Accept the changes to FIELDA is updated in the database, it takes me back to program1 for order number selection subfile screen(The field that was updated is not on this subfile screen, it is only in program2 Display screen). Ok now when i select any other order# on the subfile screen, it goes to program 2, but the value of the field that was updated for a different order# is still shown on the screen(whereas in the database the value is different). And the file from which the field is populated, has 4 fields which are all displayed, the problem is only with the new field that i have added in the display file, i am just moving the value from the databse to the display file. Just before the EXFMT of the screen in Program2, if i check the value of the field, it shows the correct value from the database, but once the screen is EXFMT, it shows the value that was updated for the previous order#. Its like the value of the field on the display file is the same for all the order#, which should not be the case.



From: Buck <kc2hiz@xxxxxxxxx>
Reply-To: RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx>
To: rpg400-l@xxxxxxxxxxxx
Subject: Re: Wrong data being displayed.
Date: Wed, 04 Apr 2007 10:16:22 -0400

> Should i use RSTDSP(*YES) for compiling
> the calling program DSPF OR
> called program DSPF?

RSTDSP(*YES) tells OS400 to save a copy of the display panel that
PROGRAM1 creates when it calls PROGRAM2. When PROGRAM2 returns, OS40
will restore that saved image to the display. You might want to do that
anyway, depending on the way PROGRAM2 overwrites the screen from
PROGRAM1, but that doesn't seem to be the problem. Does PROGRAM2 call
another program that writes to the display?

> order number is reflected for all
> the order numbers on the screen but
> not in the databse), but during
> debug, before the screen is EXFMT, the
> value is the actual value moved from the
> database file, but displayed value is
> the value entered the first time.

This description is mixing me up :-)
PROGRAM1 - subfile, select order
PROGRAM1 - call PROGRAM2
PROGRAM2 - order detail, update LCPLT,LCWGT,LCWOOD,LCPLTP

... at this point, do all 4 fields in the database file have the values
you changed them to on the display?

PROGRAM2 - RETURN
PROGRAM1 - subfile

... at this point, are the 4 fields displayed on the subfile? If so,
how did you get the new values out of the database? (RSTDSP won't do it
for you.)

PROGRAM1 - select order
PROGRAM1 - call PROGRAM2
PROGRAM2 - order detail

... here, before updating anything, are the 4 fields displaying what's
in the database?

I'm trying to understand which display is showing wrong data, and at
what point in the business logic that's happening.
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.