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: 

ABAP on HANA Dump

mser
Explorer
0 Kudos

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

1 ACCEPTED SOLUTION

horst_keller
Product and Topic Expert
Product and Topic Expert

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

8 REPLIES 8

horst_keller
Product and Topic Expert
Product and Topic Expert

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

0 Kudos

Hi Horst thanks but not really helpful

horst_keller
Product and Topic Expert
Product and Topic Expert
0 Kudos

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

0 Kudos

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

matt
Active Contributor
0 Kudos

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

0 Kudos

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

0 Kudos

+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 Kudos

Hi,

You could use if sy-subrc is initial XXX endif.

after read statement.

if sy-subrc is initial.

DELETE tb_output INDEX sy-tabix.

endif.