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

type numc

MariaJooRocha
Contributor
0 Likes
3,833

Hi,

A field type has changed from NUMC(3) to NUMC(4) in an active database table with data already.

Now coexits boths values with and without leading 0. Example: 101 and 0101.

How is it possible?

Already adjust the table but with no effect.

I suppose that just one value was possible: 0101!

Can you explain please?

Thanks.

Regards,

Maria João Rocha

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,290

Hi Maria,

try SE14 with Menu Extras -> Force Conversion

Regards,

Klaus

13 REPLIES 13
Read only

Former Member
0 Likes
3,290

Hi Maria

I am expecting that the data base table was adjusted using the database utility (SE14).

Once that is done, the old values remain (in your case 101) and you can enter new values (0101). They both are treated differently.

As we use conversion exists to add/remove additional characters on the field to fetch them from the table.

Hope this helps.

Harsh

Read only

0 Likes
3,290

Hi,

As I said, the adjut was made (SE14), but the old entries (without the leading 0) persist.

Regards,

Maria João Rocha.

Read only

Former Member
0 Likes
3,290

Hi Maria,

Please write one time program to convert the old value without leading zero's to with leading zeroes. This once time program is must necessary in this cases. I would advice just pick all the entries and add leading zeroes and that's it. You are consistent again and your query shall work fine.

Thanks,
Abhishek

Read only

former_member226225
Contributor
0 Likes
3,290

HI Maria,

In the domain you can create the conversion routine and assign it to the domain.

in this you can create the two fm conversion_exit_XXXX_Input , conversion_exit_XXXX_output and assign to it domain.

In the settings of your databrowser select user parameters and activate the Check Conversion Exits for the table.

I hope this will be helpful.

Thanks & Regards,

Raghunadh Kodali.

Read only

Former Member
0 Likes
3,290

Dear

you have to adjust the database table through se14 then new value will be fectched

and check the indexes also

Regards

Read only

Former Member
0 Likes
3,290

NUMC is a character type basically.

So, 101 is 3 chars while 0101 is 4 chars thus making them different.

Read only

Former Member
0 Likes
3,291

Hi Maria,

try SE14 with Menu Extras -> Force Conversion

Regards,

Klaus

Read only

0 Likes
3,290

Hi,

Thanks.

That field is the only key of the table (unique key). Let's say fieldkey. So I have 2 fields at the table, the key and one field for the description.

' 101' - Description old

'0101'- Description.new

Using that SE14 option (force conversion) wich entry will persist?

I know that it is possible to do a conversion program, but that is the situation that I encontoured... Also that table is external key from other...

Just want to understand SAP behaviour... as the field is numc thought that it was not possible to have entries without the leading 0!

Regards,

Maria João Rocha

Read only

0 Likes
3,290

Hi Maria,

sorry, I didn't know that the field is a key field.

In this case I would suggest to use a program for table entry conversion:

  1. Read all entries into an internal table
  2. List and Convert all key entries in a loop (list with old key value)
  3. Delete all database table entries
  4. Remove duplicates from your internal table
  5. Write your internal table to the database table
  6. Check all duplicates from your list with table content

Alternatively you can create a new database  table of the same structure, fill the new table from the old (with correct key and without duplicates) and rename the tables after that. So you can keep the old table as a copy with the original entries.

Regards,

Klaus

Read only

0 Likes
3,290

Hi,

But if SAP says that the numc it's a character string that may only contais digits (help at the dictionary), how is it possible to have a numc with leading space?

Regards,

Maria João Rocha

Read only

0 Likes
3,290

Hi Maria,

I think that is a keyfield issue. If you had a nonkey field to be changed. SAP would have adjusted it automatically with SE14. But for keyfields I think that isn't possible because of database restrictions.

Regards,

Klaus

Read only

0 Likes
3,290

Hi,

Also thought the same.. but it was nice to have

Regards,

Maria João Rocha

Read only

Former Member
0 Likes
3,290

Dear

Have your problem have been solved

Regards