Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Type CX_SY_OPEN_SQL_DB occurred

Former Member
0 Likes
902

Hi guys,

sorry if you see the same post in another thread.

I got an BSP error like this

SAP Note

  • The following error text was processed in the system:

An exception with the type CX_SY_OPEN_SQL_DB occurred, but was neither handled locally, nor declared in a RAISING clause

Exception Class CX_SY_OPEN_SQL_DB

Error Name DBIF_RSQL_INVALID_CURSOR

Program /CAG/SAPLCSV_EXPORT

Include /CAG/LCSV_EXPORTU01

Line 362

Long text: A database COMMIT occurred during an Open SQL database selection. This selection was to have then continued. However, all database selections must be completed before a database COMMIT.

The most strange is that the same thing I did in Developement System works well, but in Test System I got this error message. Actually I don't have any commit in SQL selections like th message says.

What's wrong with it?

Thanks for ur suggestion

Regards,

Liying

4 REPLIES 4
Read only

Former Member
0 Likes
746

Give the code snippet around line number 362

Read only

0 Likes
746

the line 362 is "IF sy-subrc <> 0." of the following code.

In debug mode, I saw that it works once, but the second one (in loop) it shrows this error .

...

OPEN CURSOR WITH HOLD dbcur2 FOR

SELECT ainconuserid ainconfirstname ainconlastname ainconbu aconfirstname aconlastname aconemail aexconpower aexcon~influence

FROM zbrap_apro AS apro INNER JOIN zbrap_aincon AS aincon ON aproproject_id = ainconproject_id

INNER JOIN zbrap_aexcon AS aexcon ON aproproject_id = aexconproject_id

INNER JOIN zbrvp_acon AS acon ON aexconcprnr = aconcprnr

WHERE apro~project_id = project_no.

DO.

FETCH NEXT CURSOR dbcur2 INTO (userid, int_fname, int_lname, bu, ext_fname, ext_lname, email, power, influence).

IF sy-subrc <> 0.

EXIT.

endif.

.....

enddo.

Read only

0 Likes
746

How many rows does this SQL returns:

SELECT ainconuserid ainconfirstname ainconlastname ainconbu aconfirstname aconlastname aconemail aexconpower aexcon~influence

FROM zbrap_apro AS apro INNER JOIN zbrap_aincon AS aincon ON aproproject_id = ainconproject_id

INNER JOIN zbrap_aexcon AS aexcon ON aproproject_id = aexconproject_id

INNER JOIN zbrvp_acon AS acon ON aexconcprnr = aconcprnr

WHERE apro~project_id = project_no.

Read only

0 Likes
746

hi,

more than one row. But I don't know exactly...

I think it is the problem in codes between "where" and "endselect".