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

Error using TREE class

Former Member
0 Likes
624

Hello guys,

there is a demo available showing how to use trees in ABAP Objects. This demo program name is DEMO_ABAP_OBJECTS_CONTROLS. I'm trying to customize this demo changing the select statement to get values from table MARA. I'm receiving a dump error with the message "MESSAGE_TYPE_X". I've tried even to use another fields but I'm still receiving this error. Do you have some idea why this is working only with the table shown in the demo?

Regards,

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
584

Hi guys,

I think probably some value is comming repeated and as is not possible to insert duplicate keys, then, the dump is comming. The field "node_key" holds only 12 characters, so, values are truncated to insert them in the field. Probably when some values are truncated, the duplication occurrs.

I think something like this is happening:

value 1 : AAAAAAAAAAAAAAAAAA

value 2: AAAAAAAAAAAABBBBBB

when truncate occurs:

value 1 : AAAAAAAAAAAA

value 2: AAAAAAAAAAAA

Then, duplicate key and dump error.

I'm not sure, but, may be this is the problem.

Regards,

3 REPLIES 3
Read only

Former Member
0 Likes
585

Hi guys,

I think probably some value is comming repeated and as is not possible to insert duplicate keys, then, the dump is comming. The field "node_key" holds only 12 characters, so, values are truncated to insert them in the field. Probably when some values are truncated, the duplication occurrs.

I think something like this is happening:

value 1 : AAAAAAAAAAAAAAAAAA

value 2: AAAAAAAAAAAABBBBBB

when truncate occurs:

value 1 : AAAAAAAAAAAA

value 2: AAAAAAAAAAAA

Then, duplicate key and dump error.

I'm not sure, but, may be this is the problem.

Regards,

Read only

0 Likes
584

Dear Cardoso,

Make use of Tree models for contructing Tree. For the following reasons:-

- Easy to use methods

- NODE_KEY is a string and hence any no. of characters

Following are the 3 classes you can use for Tree model:-

- CL_SIMPLE_TREE_MODEL

- CL_COLUMN_TREE_MODEL

- CL_ITEM_TREE_MODEL

Demo programs:-

- SAPSIMPLE_TREE_MODEL_DEMO

- SAPCOLUMN_TREE_MODEL_DEMO

- SAPTLIST_TREE_MODEL_DEMO

Refer thread :-

Hope it helps !!!!

Regards,

Ashish

Read only

uwe_schieferstein
Active Contributor
0 Likes
584

Hello

I guess you are quite close to the root cause of this dump. Assuming that you are using MATNR (Char18) as key for your nodes you should use only the last 12 characters of the MATNR (assumption: only numeric material numbers).

Otherwise I recommend to use an arbitrary key (counter) for the node key and add MATNR as (hidden) item to your tree.

Regards

Uwe