Skip to Content
author's profile photo Former Member
Former Member

STACK_BLOCK_ILLEGAL_STATE inside LOOP

At the end of the loop

LOOP AT lt_partners INTO ls_partner.

SELECT SINGLE COUNT(*) INTO counter FROM DFKKBPTAXNUM

WHERE partner = ls_partner-partner AND taxtype = 'RU1'

GROUP BY TAXNUM.

ENDLOOP.

I encounter dynamical error STACK_BLOCK_ILLEGAL_STATE. I suppose the reason is using ls_partner-partner inside the select statement. Changing select statement to

SELECT SINGLE COUNT(*) INTO counter FROM DFKKBPTAXNUM

elemenates a stack dump. Could you please suggest the reason for such a behavior?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Dec 07, 2012 at 07:11 AM

    Please refer sap note

    Note 1489228 - STACK_BLOCK_ILLEGAL_STATE for ENDSELECT and count( * )

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.