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

ABAP Runtime error in debug mode

Former Member
0 Likes
1,583

Hi all,

I am facing foll. run time error in debug mode

Runtime Error DBIF_RSQL_INVALID_CURSOR

Except. CX_SY_OPEN_SQL_DB

Possible causes in the application program:

Within a loop (SELECT/LOOP/EXEC SQL), one of the following

statements is used:

- MESSAGE (apart from MESSAGE S...)

- COMMIT WORK

- ROLLBACK WORK

- CALL SCREEN

- CALL DIALOG

- CALL TRANSACTION

- SUBMIT

- BREAK-POINT

- WAIT

.

In debugging mode, a program sometimes triggers

a "COMMIT WORK" during the database selection. As a result

this termination may also occur in debugging mode with a correct

program.

A "COMMIT WORK" during debugging may be due to the following reason

1. A program or screen was regenerated

and updated in the database.

2. Each user needs a private process in debugging mode, but

the number of available processes is restricted. If this

limit is exceeded, each debugging step then requires a

"COMMIT WORK".

its urgent.

if i run the prg directly to tcode der is not ne error.

but i want to execute the prg. in the debug mode.

its a ZPRG.

with regards,

Purva.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,022

Hi,

Just check if you are using a commit work or message statment between your select statements.

Shruthi R

5 REPLIES 5
Read only

Former Member
0 Likes
1,023

Hi,

Just check if you are using a commit work or message statment between your select statements.

Shruthi R

Read only

0 Likes
1,022

hi shruti,

no i didnt use ne commit work or select statement in my select stmt.

wat do u mean by commit work?

here are d select querries dat i hv used.

select vbeln kunrg zterm bukrs knumv netwr kunrg from vbrk into corresponding fields of itab

where vbeln = docno.

select matnr posnr arktx fkimg meins netwr werks aubel from vbrp into corresponding fields of itab

where vbeln = itab-vbeln.

select name1 stras pstlz ort01 land1 from kna1 into corresponding fields of itab

where kunnr = itab-kunrg.

select preprn exdat docno from j_1iexchdr into corresponding fields of itab

where rdoc = itab-vbeln.

select j_1ichid from j_1imtchid into corresponding fields of itab

where matnr = itab-matnr.

append itab.

endselect.

endselect.

endselect.

endselect.

endselect.

select eikto from knb1 into table wa_knb1

where kunnr = itab-kunrg

and bukrs = itab-bukrs.

select kawrt kbetr kwert kschl kposn knumv from konv into corresponding fields of wa_konv

where knumv = itab-knumv

and kposn = itab-posnr.

append wa_konv.

endselect.

plz let me know abt dis.

thanks & Regards

Read only

0 Likes
1,022

Hi,

you are using nested select statements which may cause implicit commits which is resulting in your dump. I assume itab is an internal table.

data : wa_itab like line of itab.

select vbeln kunrg zterm bukrs knumv netwr kunrg from vbrk into corresponding fields of wa_itab

where vbeln = docno.

if sy-subrc = 0.

select single matnr posnr arktx fkimg meins netwr werks aubel from vbrp into corresponding fields of wa_itab

where vbeln = itab-vbeln.

select single name1 stras pstlz ort01 land1 from kna1 into corresponding fields of wa_itab

where kunnr = itab-kunrg.

select single preprn exdat docno from j_1iexchdr into corresponding fields of wa_itab

where rdoc = itab-vbeln.

select single j_1ichid from j_1imtchid into corresponding fields of wa_itab

where matnr = itab-matnr.

append wa_itab to itab.

endif.

endselect.

Hope this helps.

Also , using select...endselect is not a good option in terms of performance, you may have to alter your queries to include joins.

Read only

Former Member
0 Likes
1,022

If you put the break point between select and endselect. program will terminate during debugging. put break point before or after select endselect. Or change the select statements to INTO TABLE and mofidy the logic.

Read only

Former Member
0 Likes
1,022

hi,

You need to change your logic.

Then , i hope your problem wil be solved.

Because of nested select statements, you are getting that error.

Declare seperate Internal tables for VBRK,VBRP, KNA!,j_1iexchdr, j_1imtchid.

Declare Itab_final with all required fields from all tables.

Dont use select-endselect anywhere.

I am giving Pseudo code here.

Try to use this logic.

I used question mark in code : there you need to use ur required field names.

Hope it wil help you.

select vbeln kunrg zterm bukrs knumv netwr kunrg from vbrk into corresponding fields of table itab1

where vbeln = docno.

select matnr posnr arktx fkimg meins netwr werks aubel from vbrp into corresponding fields of table itab2 for all entries in itab1

where vbeln = itab-vbeln.

select name1 stras pstlz ort01 land1 from kna1 into corresponding fields of table itab3 for all entries in itab1

where kunnr = itab1-kunrg.

select preprn exdat docno from j_1iexchdr into corresponding fields of table itab4 for all entries in itab1

where rdoc = itab1-vbeln.

select j_1ichid from j_1imtchid into corresponding fields of table itab5 for all entries in itab2

where matnr = itab2-matnr.

Loop at itab1 into wa_itab1.

read table itab2 into wa_itab2 index sy-tabix.

read table itab3 into wa_itab2 index sy-tabix.

read table itab4 into wa_itab2 index sy-tabix.

read table itab5 into wa_itab2 index sy-tabix.

itab_final = itab1-?

itab_final = itab1-?

itab_final = itab2-?

itab_final = itab3-?

itab_final = itab4-?

itab_final = itab5-?

append itab.

endloop.

select eikto from knb1 into table wa_knb1

where kunnr = itab_fianl-kunrg

and bukrs = itab-bukrs.

select kawrt kbetr kwert kschl kposn knumv from konv into corresponding fields of wa_konv

where knumv = itab_fianl-knumv

and kposn = itab_final-posnr.

append wa_konv.

endselect.

Regards

Sandeep Reddy