Application Development 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: 

Type CX_SY_OPEN_SQL_DB occurred

Former Member
0 Kudos

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

Former Member
0 Kudos

Give the code snippet around line number 362

0 Kudos

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.

0 Kudos

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.

0 Kudos

hi,

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

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