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

Problem with decimal conversion in Unicode

Former Member
0 Likes
1,025

Hello,

I am working on ECC 6.0, SAP ABAP/BASIS ver 7.0.

I have got a problem in table maintenance.

I am trying to use the event 01 of table generator.

My table has got a decimal field.

There I am writing this code snippet.

It is given in SAP help

FORM abc.

DATA: F_INDEX LIKE SY-TABIX. "Index to note the lines found

LOOP AT TOTAL.

IF <ACTION> = 'N'.

READ TABLE EXTRACT WITH KEY <vim_xtotal_key>.

IF SY-SUBRC EQ 0.

F_INDEX = SY-TABIX.

ELSE.

CLEAR F_INDX.

ENDIF.

*******(make desired changes to the line TOTAL)

*#############Code written by me##############

MOVE total TO ztable.

SELECT SINGLE name1 FROM kna1 INTO ztable-name1

WHERE kunnr = ztable-kunnr.

MOVE ztable TO total.

*#############end of my code############

MODIFY TOTAL.

CHECK F_INDX GT 0.

EXTRACT = TOTAL.

MODIFY EXTRACT INDEX F_INDX.

ENDIF.

ENDLOOP.

SY-SUBRC = 0.

ENDFORM.

Now on execution of this code I am getting a dump on line.

MOVE total TO ztable.

The dump message is "UC_OBJECTS_NOT_CONVERTIBLE"

Now when I am changing the field in the table from decimal to Numc type it is working fine.

I have two questions-

1. Are decimal numbers not supported by Unicode?

2. If they are supported, then how should I change my code to handle them ( Do they have to be converted to Char type ) ?

Regards,

Mayank

4 REPLIES 4
Read only

Former Member
0 Likes
709

Hi,

When you write the MOVE statment, that should be Charecter type or Numeric in Unicode ..

Regards

Sudheer

Read only

0 Likes
709

Hello Sudheer,

Thanks for your reply but my questions are regarding decimal points.

The questions are -

1. Are decimal numbers not supported by Unicode?

2. If they are supported, then how should I change my code to handle them ( Do they have to be converted to Char type ) ?

Regards,

Mayank

Read only

Former Member
0 Likes
709

Hi,

As per my knowledge,

1) you can use the MOVE statment to Decimals in Unicode

2) You need to convert it to Char type before moving that field

Regards

Sudheer

Read only

0 Likes
709

Hello Sudheer,

While moving the values, I am capturing DEC field in CHAR.

Now it is working fine.

Regards,

Mayank