× 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.



Kylea,

place the following keywords in the subfile control record:

CF04
RTNCSRLOC(&REC &FLD &POS)
SFLCSRRRN(&CSR)

and define the following hidden fields in the same record:

REC           10A  H
FLD           10A  H
POS            4S 0H
CSR            5S 0H

Now, when the user places his cursor in a field in the subfile, and presses
F4, control is returned to your program.

after the exfmt, test for F4.   at this time, the fields above have the
following values:

REC = subfile record format name (not needed)
FLD = the name of the field cursor is sitting in.
POS = the position with in the field cursor is sitting at. (not needed)
CSR = reletive record number of the subfile record cursor is sitting at.

the only flds needed are FLD and CSR.   Field tells you which field is
being prompted (if more than one).   Perform your lookup, then use CSR to
CHAIN to the subfile record by rrn.  update the record with the data
retrieved from the lookup and then return to the EXFMT of the subfile
control record.  your subfile will now have the prompted data.

you will need to update the subfile record with SFLNXTCHG active if you
wish to read that record with a READC later.

hope this helps.

rick


----Original message-----
I am writing a subfile which looks similar to the following.

Opt        Order    Qty    Reason    Notes
__        12345      6        __            Test Test Test
__        45656      8        __            Test To Test To

My program basically loads the subfile

Eg.           EXSR $WS01        (this formats the data and writes each
subfile record
                WRITE    S01C
                EXFMT    S01

Then I do READC S01 to determine subfile changes - the user may choose to
place a one in one or many of the option fields or select F4=List to prompt
on a reason code.

Has anyone got an example of how this is done.  I tried the SFLNXTCHG
indicator but in all the reading I have found it to be quite confusing and
am encountering multiple problems with not knowing which relative record
number I am at when selecting F4 etc.  Basically I am in a big mess.  I
think I have two separate problems here.  1)  I don't have the SFLNXTCHG
keyword processing correct in my RPG and 2)  I don't know how to process a
function key on a subfile.

All I want to do is be able to do an F4 on the reason and have the code
returned from a selection list to the correct subfile line selected from
and if there are any errors - eg the user enters in the wrong code then
that line is highlighted and not processed and the subfile is re-written
showing the errors and removing those items already processed.

Any help would be appreciated.




As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.