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: 

Changing structure of Data Cluster

Former Member
0 Kudos

Hi,

When using a data cluster and writing to and reading using export to database and import to database, any change to the structure of the datacluster will result in a short dump when importing or exporting "CONNE_IMPORT_WRONG_COMP_LENG". An example of this is where I have 3 fields, field1 char 10, field2 char 8, and field3 char 6. I field2 changes to char 10, the above short dump will result. Is there anyway of regenerating the data cluster after there is a change to the data cluster?

Best regards,

James.

1 ACCEPTED SOLUTION

marina_plag
Explorer
0 Kudos

Hi,

I know a similar problem in our code. We save a version number with the data. There is a constant with the number of current version, too.

Before reading the data, the version is checked. Then a routine can read the data into appropriate data structure, move it to the new one and save it on database again (if necessary). If the version = current version the data is just read.

If you add a new field at the end of your structure then you will get no short dump. But you get a short dump if you change something in the middle of your structure.

We replaced the above solution with using of class CL_DATA_CONTAINER, because we had many problems with cluster data. But it is only available in ABA 710.

Reward points if useful.

Regards, Marina

6 REPLIES 6

Former Member
0 Kudos

Hi james,

1. Ya, u are right, the system will give error,

and its perfectly fine that it gives error.

(if it wud not give error, the data may be interpreted wrongly)

2. So before changing the structure,

we need to

a) read the data in cluster in OLD Format

b) convert in new format

c) Write back the same record in NEW Format.

3. One general program can be written for thing before

doing any strucutural changes.

regards,

amit m.

Former Member
0 Kudos

Hi,

I think there is no way of regenerating it. Inorder to apply the new changes, write a program totake back-up of all the data from the cluster into file and change the length as 10 and again upload the data to cluster with new lenght..

Former Member
0 Kudos

Thanks both, I will try reading the datacluster, making the change to the new length, the writing back to the cluster.

Best regards,

James.

marina_plag
Explorer
0 Kudos

Hi,

I know a similar problem in our code. We save a version number with the data. There is a constant with the number of current version, too.

Before reading the data, the version is checked. Then a routine can read the data into appropriate data structure, move it to the new one and save it on database again (if necessary). If the version = current version the data is just read.

If you add a new field at the end of your structure then you will get no short dump. But you get a short dump if you change something in the middle of your structure.

We replaced the above solution with using of class CL_DATA_CONTAINER, because we had many problems with cluster data. But it is only available in ABA 710.

Reward points if useful.

Regards, Marina

0 Kudos

Thanks for all the helpful responses. Just one other question, is there a way of reading all the data in a cluster in one hit rather than having to build the key for each record in the cluster. I have tried leaving the ID blank during the import blank but this give a subrc = 4.

Regards,

James.

0 Kudos

Since the data in the clsuter will be huge and it is not advisable to pick them once as far as the performance is considered..

So split the key into some sets and try to fetch the data in some n times..