Hi all,
I'm trying to debug in SE37 'BAPI_GL_ACC_GETPERIODBALANCES' RFC-FM but, in a select loop (within READ_BALANCES_HW form), I'm able to see the first select loop but, when the system tries to process the second one, this dump occurs:
Run-time error DBIF_RSQL_INVALID_CURSOR
Exception CX_SY_OPEN_SQL_DB
I've already found and read OSS Notes 2104 and 675, but no COMMIT WORK message appears in the ABAP debugger and, however, we extended available number of work processes for debugging in the profile parameters (rdisp/wpdbug_max_no = 8)...
Within the select loop there is also a COLLECT (related to an internal table) after a MOVE-CORRESPONDING...can this statement lead to a database commit that causes the database to lose the cursor ?
Here is the standard code...
SELECT * FROM GLT0
WHERE RLDNR = '00'
AND RRCTY = '0'
AND RVERS = '001'
AND BUKRS = COMP_CODE
AND RYEAR = FISC_YEAR
AND RACCT = GL_ACCOUNT
AND RPMAX = '016'.
MOVE-CORRESPONDING GLT0 TO GLTAB.
COLLECT GLTAB.
ENDSELECT.
By the way, how can I do my debug analysis ?
Thanks in advance !
Bye,
Roberto
Hi Roberto,
this time in another forum. The reason for your dump is, that the debugging procedure causes a commit work. This closes your current cursor. You should try the following code:
SELECT * into corresponding fields of gltab FROM GLT0
WHERE RLDNR = '00'
AND RRCTY = '0'
AND RVERS = '001'
AND BUKRS = COMP_CODE
AND RYEAR = FISC_YEAR
AND RACCT = GL_ACCOUNT
AND RPMAX = '016'.
As data is not summarized in this case you need to sum it in a following loop or using
select sum(field1) sum(field2) ...
But in this case you also need to implement a group by clause in your select statement.
If you need more information, let me know.
regards
Siggi
I've had this same problem in the past. If you don't really need to debug that select loop, just put a breakpoint after it and blow right passed it.
Regards,
Rich Heilman
A standard in Screen Processing with ABAP is that the system performs a COMMIT before each screen is presented to the user. This needs to be well understood if you are programming database updates and doing Screen Processing. The debugger is presenting a new screen with every step that you ask it to present, so a COMMIT is performed and the cursor is lost.
The COLLECT command has nothing to do with database calls. It is used to update an internal table which is held in memory so that is not the cause of the abend that you are receiving.
Rich has the right suggestion. Before the SELECT starts, double click a line after the ENDSELECT to set a break point and then use the 4th button - CONTINUE, to skip to the next breakpoint. You can also put the cursor on the line where you want it to stop and hit CONTINUE.
Let us know how it goes.
Add a comment