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

currancy field convert into character type

Former Member
0 Likes
875

Hi,

How can i convert currancy field in character format .give example

thanks in advanced.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
840

Hi ravindra,


DATA : Cur TYPE CHAR16.

cur  =  itab-curr . " Currency field...

WRITE :/ cur.

that's all..

in more detail..

DATA : text type char18.
text = itab-kwmeng.      "field with value 1,0000.00
 
REPLACE ALL OCCURRENCES OF   ',' IN  text
  WITH ' '.
CONDENSE text.
 
  WRITE :/ text.


Message was edited by:

Perez C

Hi ravindra,


DATA : Cur TYPE CHAR16.

cur  =  itab-curr . " Currency field...

WRITE :/ cur.

that's all..

in more detail..

DATA : text type char18.
text = itab-kwmeng.      "field with value 1,0000.00
 
REPLACE ALL OCCURRENCES OF   ',' IN  text
  WITH ' '.
CONDENSE text.
 
  WRITE :/ text.


Message was edited by:

Perez C

6 REPLIES 6
Read only

Former Member
0 Likes
841

Hi ravindra,


DATA : Cur TYPE CHAR16.

cur  =  itab-curr . " Currency field...

WRITE :/ cur.

that's all..

in more detail..

DATA : text type char18.
text = itab-kwmeng.      "field with value 1,0000.00
 
REPLACE ALL OCCURRENCES OF   ',' IN  text
  WITH ' '.
CONDENSE text.
 
  WRITE :/ text.


Message was edited by:

Perez C

Read only

Former Member
0 Likes
840

Hi Ravindra,

do like this

data: var1(10) type p decimals 2 value '123.50',
      var2(15) type c.

var2 = var1.

write var2.

Reward Points if it helps,

Satish

Read only

Former Member
0 Likes
840

Hi,

Define a variable of type C.

and move the currency field value to the variable.

Read only

former_member188827
Active Contributor
0 Likes
840

data zch(25).

write zcurrency to zch.

Read only

Former Member
0 Likes
840

Hi,

The currency field is itself a char type with length 5.

Read only

Former Member
0 Likes
840

Hi Ravindra,

For Converting currency field in char type, Just do

DATA : ZCHAR(20) TYPE C.

MOVE CURRENCY TO ZCHAR.

<b>if anything else you are looking for kindly revert back.

Reward if useful

Rohit G</b>