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: 

convert CURR to CHAR

Former Member
0 Kudos

Hi,

I have created a structure coping a table, but I need all fields to be char, have couple of fields as CURR which have length 13 and decimals 2. what should be the lenght when I convert it to CHAR.

example: length 15 = 13+2.

can i use same data type if for multiple field?

Please let me know, will award points

thanks in advance.

mr

6 REPLIES 6

Former Member
0 Kudos

You will have to use a char type of length 16.

16 = 1321(for decimal point).

Former Member
0 Kudos

Hi Raj,

Yes you can use move CURR data type field to CHAR with length = 15 (13+2). You can use same data type for other fields as well.

Cheers,

Vikram

Former Member
0 Kudos

Hi Raj,

Whenever you have such requirements(Convertin CURR to CHAR) for Table/Structure Fields,go to the domain of the corresponding field and check the output Length. Then give this length for the CHAR.

Consider KBETR which CURR field.

If you go into the Domain of this Data Element you will find the following Info:


                                                                                <b>Data type        CURR</b>       Currency field, stored as DEC                  
  No. characters       11                                                    
  Decimal places        2                                                                                
<b>  Output length        16</b>                                                    



So my CHAR must be of length 16.

Regards,

Arun Sambargi.

andreas_mann3
Active Contributor
0 Kudos

Hi,

you can select outpulen from view dd03m

example

select ouputlen from dd03m into lgth

where tabname = 'BSEG'

and fieldname = 'WRBTR'

..

-> result: lgth = 16

A.

Former Member
0 Kudos

Hi,

In your example better go to the data element-->Domain and check for the output length.

This should be the length of your CHAR field.

Regs,

Venkat Ramanan

former_member188685
Active Contributor
0 Kudos

Hi,

You can use the FM HRCM_AMOUNT_TO_STRING_CONVERT to convert it from amount to string format.

Regards

vijay