|
Douglas, In your first post you said that you READC on sub file A but then you did not mention that fact in your reply to Ron. Do you READC on sub file A when a user presses F4? If not then what I would do is code... A SFLCSRRRN(&CSRRRN) ... A CSRRRN 5S 0H TEXT('SFLCSRRRN') After you press F4 with the cursor in the sub file detail you will get the record number of that sub file record. You can chain to sub file A before or after going to sub file B. Unless I needed data from the sub file I would chain afterwards to prevent accidental data overlays. Then update the account information field in sub file A and update sub file A. However, in the situation you are building, I would recommend against doing a READC on sub file A when a user presses F4, since each time you READC you set off the modified data tag for the sub file record. If you depend on a READC later to update the database from sub file A the READC would not find any changed records. Plus, if you READC when the user presses F4, you have no way of knowing which sub file A record they were on with out something like SFLCSRRRN() keyword. Chaining to sub file A to update the account information is a better way to go. When you do that set on an indicator that conditions the sub file detail keyword, SFLNXTCHG. This way you will ensure that the database update routine, should it happen to process sub file A by READC, get changed sub file records. Thank you, Matt Tyler WinCo Foods, LLC mattt@xxxxxxxxxxxxxx -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Douglas W. Palme Sent: Wednesday, January 11, 2006 1:39 PM To: RPG programming on the AS400 / iSeries Subject: Re: updating windowed subfile Actually after the F4 is processed I am doing a READC on SUBFILE A. Which should be writing that data to the subfile. On Wed, 11 Jan 2006 14:23:58 -0600, Booth Martin wrote > ah. been there. I suspect that you are loosing the entered data > because it was never received by your program? You processed F4 > without first reading the subfileA's fields and saving/writing the data. > > Douglas W. Palme wrote: > > Ron, > > Here is what I am doing: > > > > I load a blank record into subfile A and display it. The user can enter in > > some data and then select F4 (which is coded CF04) which if they select F4 > > it will load subfile B with a list of accounts, the user selects one and > > hits enter, the program does a READC on subfile B to find any selections, > > moves that to the appropriate field in Subfile A and updates subfile A. > > > > Similar to what you suggested, but if say I enter the date into the DDATE > > field, and then select F4 make my account selection and hit enter which > > should get rid of subfile B and update A with the account selection....that > > part works except for the date is gone...... > > > > > > > > On Wed, 11 Jan 2006 16:12:09 -0330, RPower wrote > > > >>You should be able to do the following (pseudo code) > >> > >>Load subfilea > >>display subfilea > >>readc subfilea > >>load subfileb > >>display subfileb > >>readc subfileb > >>return those values to subfilea > >>update subfilea > >> > >>That should work with no issues.... > >> > >>Ron Power > >>Programmer > >>Information Services > >>City Of St. John's, NL > >>P.O. Box 908 > >>St. John's, NL > >>A1C 5M2 > >>709-576-8132 > >>rpower@xxxxxxxxxx > >>http://www.stjohns.ca/ >
As an Amazon Associate we earn from qualifying purchases.
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.