Skip to Content
-2

ABAP on HANA Dump

Oct 18, 2017 at 05:00 PM

67

avatar image
Former Member

Hi All,

the following code dumps in some cases, not always:

SELECT * FROM jest INTO TABLE tb_jest
FOR ALL ENTRIES INtb_output
WHERE objnr = tb_output-objnr
AND stat IN rs_stat AND inact = ' '.

LOOP AT tb_jest INTO wa_jest.
READ TABLE tb_output WITH KEY objnr = wa_jest-objnr.
DELETE tb_output INDEX sy-tabix.
ENDLOOP.The dump happens on line

DELETE tb_output INDEX sy-tabix.

because read table returns sy-subrc <> 0.

Can someone spot the problem ?

thanks a lot

Filippo

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Horst Keller
Oct 18, 2017 at 05:04 PM
2

Debug and read the documentation about the statements involved ...

Show 6 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Horst thanks but not really helpful

0

Why? What's the contents of sy-tabix? What does the short dump say?

0
Former Member

found the problem.

In some minor cases, the table tb_jest have some duplicate entries(same objnr). So the first value in tb_jest deletes the corresponding entry in table tb_output and when it reaches the second value in tb_jest, it can't find a corresponding value in tb_output.

Thanks

Filippo

0

Which could only be determined by knowing your data, and debugging, as Horst said...

0

... and please don't do SELECT * on HANA (or any other database, but especially HANA)

0

+1 to Horst. As the short dump indicates probably an "index error" on the DELETE statement, read the ABAP documentation - DELETE itab - itab_line - Alternative 2 INDEX idx :

If idx contains a value of 0 or less, an exception is raised that cannot be handled.
Then debug and you'll see the value of sy-tabix after READ TABLE is zero when the line is not found (if you read the documentation again, you'll see it only states that sy-tabix is set when a line is found, so consider that you shouldn't use sy-tabix if the line is not found.
0