Retrieve RRN from SFL within a window displayed but not active on the screen

310 pts.
Tags:
AS/400
Display File
RRN
A window displaying multiple items within an order is displayed on a screen in which additional items are to be added or an existing item, from within the window, is to be retrieved and updated. The SFL is defined as size=100 and page=7. If I click on one of the items in the window, by using the DDS command on the CTL record (SFLCSRLOC(*WINDOW &ROW &COL) I can get the row and column of the item on which I clicked, but not the RRN. Without the RRN, I can't know for sure which item has been selected. The command SFLCSRRRN doesn't return the RRN from within the window as, presumably, the window is not the active display. Other than converting the SFL to a single page only (size=page) and thus controlling and knowing the RRNs displayed at any given time, is there a way to retrieve the RRN?

Software/Hardware used:
RPGLE

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question: 7  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.
  • ToddN2000
    If you can get the row, why not put the RRN in the record as a hidden field?
    87,535 pointsBadges:
    report
  • Zack
    Never thought of that and it's a good idea. Thanks.
    310 pointsBadges:
    report
  • Zack
    On second thought, unless I've missed something, that won't work because the problem is not knowing which record in the SFL to read. For example, if there are 12 records in the subfile, where the first record on the page is in line 4, then if I click on line 6 then, depending on whether I had used "rollup", the record in line 6 would be record number 3 or 10. Again I come back to the question whether a single-page SFL is the only solution.
    310 pointsBadges:
    report
  • WoodEngineer
    ToddN's solution should work. Write the RRN with every record added to the subfile. Then regardless of the record retrieved from the subfile that record will have a hidden field your program can interogate.
    In you example, record 3 of the first page would contain record number 3, while the third record on the second page would contain record number 10.
    7,640 pointsBadges:
    report
  • WoodEngineer
    Check out DDS keyword SFLCSRRRN. That may do what you need with minimal coding.
    7,640 pointsBadges:
    report
  • Zack
    Thank you WoodEngineer for your thoughts. First, SFLCSRRRN does not work - it always comes back as 0 - since, at least as my assumption, the SFL is not the active display and thus the "program" doesn't know that I want the actual row from within the SFL. Rather the "row" is the row/line on the entire screen. Regarding the hidden RRN in every record, I must be missing something. As just mentioned, the "row", which I can indeed retrieve, is not the row within the SFL but rather the row on the entire screen. So if control is returned to my program with row=3, how am I to know to do a chain to RRN 3 or 10 (unless, of course, as I have suggested, I convert the SFL to a single page SFL).
    310 pointsBadges:
    report
  • Zack
    To clarify, if the row from the SFL that I want to select is the first row in the SFL, but it is on the 3rd line of the screen, then the value of "row" that is retrieved is "3". I can, of course, understand that this is the first row of the SFL but, again, not knowing whether a rollup has been issued or not, I don't know if the first row that appears on the page is RRN 1 or 8.
    310 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.

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

Following

Share this item with your network: