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 CASTING IN SAP

Former Member
0 Likes
374

HI,

how to convert the int data to char format in abap/4.

Thanx.

2 REPLIES 2
Read only

Former Member
0 Likes
354

Hi Santosh,

you may use WRITE... TO... command. For example:


DATA: d_integer  TYPE i VALUE 123.
DATA: d_char(10) TYPE c.

START-OF-SELECTION.
  WRITE: / d_integer.
  WRITE d_integer TO d_char.
  WRITE: / d_char.

I hope this helps. Best regards,

Alvaro

Read only

former_member156446
Active Contributor
0 Likes
354

if you want to covert 1 to one use this FM:

CALL FUNCTION 'SPELL_AMOUNT'

EXPORTING

AMOUNT = WA_RWBTR

  • CURRENCY = ' '

  • FILLER = ' '

  • LANGUAGE = SY-LANGU

IMPORTING

IN_WORDS = WORD

EXCEPTIONS

NOT_FOUND = 1

TOO_LARGE = 2

OTHERS = 3

if you want to move an integer value into char.. just use move..

data: lv_char type char5,

data:lv_num type numc5 value '123'.

lv_char = lv_num.

write:/ lv_char.