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

Invalid interruption of a database selection

Former Member
0 Likes
2,327

Hi every one,

i am using SELECT & ENDSELECT statement within LOOP & ENDLOOP.

while debugging, it fetching the data but finally i am getting short dump saying that

Invalid interruption of a database selection

can anyone help me.

Regards,

Venkat

Hi every one,

i am using SELECT & ENDSELECT statement within LOOP & ENDLOOP.

while debugging, it fetching the data but finally i am getting short dump saying that

Invalid interruption of a database selection

can anyone help me.

Regards,

Venkat

12 REPLIES 12
Read only

Former Member
0 Likes
1,816

Put your code here.

Are you doing any commit in this loop?

Thanks,

Shambu

Read only

0 Likes
1,816

actually i am trying to upload vendor master data using bdc call transaction

and my code follows as

* Fetch all Vendors Based on Selection Critiria
  select lifnr adrnr kunnr from lfa1 into table gt_lfa1 where lifnr in s_lifnr.

* Loop at
  loop at gt_lfa1.

    if v_gen = 'X'.
      select single *  from adrc where addrnumber = gt_lfa1-addrnumber.
      perform refresh_variables.
      perform read_general_data.
    endif.

* Selecting Vendor Company Code Details
    if v_cmp = 'X'.
      select * from lfb1 where lifnr = gt_lfa1-lifnr .


        perform refresh_variables.
        perform read_company_codes.

      endselect.
    endif.

  endloop.

perform read_company_codes.

........

here i am doing recoding to fill company code details

.....

it fetching the data perfectly but when call transaction execute it will going to short dump

regards

venkat

Read only

0 Likes
1,816

Instead of selecting inside the LOOP, do the select using FOR ALL ENTRIES in GT_LFA1 and use a READ statement inside the LOOP.

Thanks,

Shambu

Read only

0 Likes
1,816

Hi Shamu

i done the same but they require less coding i.e, no types , no internal tables and no work areas

without these how to achive ???

thanks & regards

Venkat

Read only

0 Likes
1,816

Hi Venkat,

Instead of writing select...end select first get the data and loop it with in a loop..end loop,while looping use parallel cursor method.For this go through this link,

http://wiki.sdn.sap.com/wiki/display/Snippets/ABAP+Code+for+Parallel+Cursor+-+Loop+Processing

Read only

former_member282968
Contributor
0 Likes
1,816

Dear Venkat,

First of all using select .endselect is not recommended and using it inside the loop is not correct way of coding.

Please check the docs on best practices of programming.

With regards,

Read only

0 Likes
1,816

Hi there,

Many times within a select - endselect statement, if you set a breakpoint you will get this dump. This is normal to happen in debugging BUT you should be aware that statements such as commit work between select-endselect will trigger the above mentioned error all the time.

Can you avoid the select endselect statement within the loop ?

Can you select * into table and then loop and read the table ? It will be much better and correct.

Regards.

Read only

0 Likes
1,816

What is the debugger mode (Exclusive or Non-exclusive) ?.  If you have opened the debugger in non-exclusive mode, debugging through select - endselect will generate a short dump. 

See the help documentation http://help.sap.com/saphelp_nw70/helpdata/en/b8/e9fda496798f42ae1644318af6d67d/frameset.htm for more details.

Regards, Vinod   

Read only

0 Likes
1,816

hi

Read only

venkateswaran_k
Active Contributor
0 Likes
1,816

Hi Venkat,

Can you please paste the exact dump statement you received.

Secondly, you also paste the code loop - endloop along with select endselect....

Did you try it executing again without debugging,,  Probably it may occur only first time... 

Select endselect many times cretes dumps during debug as it is a single logical unit...

Pleaes post back with your result.

Regards,

Venkat

Read only

0 Likes
1,816

hi  Venkateswaran K

i tried without debugging also still have the same problem

and my error follows as

Runtime Errors :        DBIF_RSQL_INVALID_

Exception        :        CX_SY_OPEN_SQL_DB

Short text: Invalid interruption of a database selection.

What happened?


    Error in the ABAP Application Program

    The current ABAP program "ZTST" had to be terminated because it
     has
    come across a statement that unfortunately cannot be executed.
    Unable to perform database selection fully.

Read only

Former Member
0 Likes
1,816

Yes, You do get that dump while debugging.

I guess you would be getting dump at the start of or at the end of below select query.

select * from lfb1 where lifnr = gt_lfa1-lifnr .


        perform refresh_variables.
        perform read_company_codes.

endselect.

The trick to avoid dump is not to go on SELECT or ENDSELECT statement

So, if you are debugging, write your code as below:

select * from lfb1 where lifnr = gt_lfa1-lifnr .

BREAK-POINT.

        perform refresh_variables.
        perform read_company_codes.

BREAK-POINT.

endselect.

BREAK-POINT.

I hope you wont get dump with this.