Page 1 of 1

Looping through subfile

Posted: Thu Feb 15, 2024 6:34 pm
by FBuckham
Good day

I have a grid in my front end but I have a subfile in the 5250 screen. The subfile has maximum on 14 entries per page and i can only have 7 pages. I can set the subfile and get the entries on the first page up until the 14th entry. But if I need to page down and hit enter I get a multiple key entry error and it just breaks everything. Can you please assist if possible on the matter. My code is below:

#pages := 7
#entries := 14

Begin_Loop To(#pages)
#STD_COUNT := 1
#POSCONN.getvalue From("WSLYN") Value(#STD_INT) Index(#STD_COUNT)
#POSCONN.getvalue From("WSBESKR") Value(#CXLBSE) Index(#STD_COUNT)

Begin_Loop To(#entries)

If Cond((#STD_INT = 0) *Or (#CXLBSE = *BLANK))

#POSCONN.setvalue Infield('WSVELD') Value(#CDX) Index(#STD_COUNT)
#POSCONN.setvalue Infield('WSHOEV') Value(#CDXQUANTI) Index(#STD_COUNT)
#POSCONN.setvalue Infield('WSKORTP') Value(#CardexDiscount) Index(#STD_COUNT)
Leave

Endif

#STD_COUNT += 1
#POSCONN.getvalue From("WSLYN") Value(#STD_INT) Index(#STD_COUNT)
#POSCONN.getvalue From("WSBESKR") Value(#CXLBSE) Index(#STD_COUNT)
End_Loop
If Cond(#STD_COUNT = 15)
#POSCONN.sendkey Key(#POSCONN.KeyPageDown)

Else
#POSCONN.sendkey Key(#POSCONN.KeyEnter)
Leave
Endif

End_Loop

Re: Looping through subfile

Posted: Thu Feb 15, 2024 7:48 pm
by René Houba
Hi FBuckham,

Can you give more details about the front-end.

Is this a Windows front-end?
Web?
Is this RAMP perhaps?

Kind regards,
René

Re: Looping through subfile

Posted: Thu Feb 15, 2024 7:56 pm
by FBuckham
It is a windows Front-end with a grid on it.

Re: Looping through subfile

Posted: Thu Feb 15, 2024 8:01 pm
by jtaljaard
We are using RAMP to retrieve information from our backend subfile and populating it into our front-end windows grid control.

Re: Looping through subfile

Posted: Fri Mar 01, 2024 10:56 am
by Tim McEntee
Hi FBuckham,

It looks like you are trying to seven page down keys in a row. What you need to is do one at a time, wait for the screen to come back and press again.

Tim