I wrote a JSP to enquery sales order header and detail. I prepared 2 4GL and put them on AppServer. When the Order Header 4GL is called, it returned temp-table, so that I can do looping and put them all. Reference field on Order Header will be used to invoke another 4GL (Detail) and print out all SO details.

When they are called seperatedly, there's no problem. But when I call the SO detail 4GL while looping the SO header, it caused error list this :

com.progress.open4gl.ProSQLException: Attempt to access data in incorrect order, or without calling next() (at column 1). (7181)

Can somebody help?