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

data type conversion

Former Member
0 Likes
798

Hi all

I need to convert an integer to char type.will u please tell me it.

Thanks

Regards

GIRI.

7 REPLIES 7
Read only

Former Member
0 Likes
764
data : val type i .
data : val2(10) type c.

val1 = 14.

val2 = val1. "integer to character .

write:/ val2.

regards,
vijay
Read only

Former Member
0 Likes
764

Just assign the integer to the char with "=".

data : w_char(5) type c,
         w_integer type i.

w_char = w_integer.

Hope this helps,

Erwan

Read only

0 Likes
764

I did this.

data: l_top_key type lvc_nkey,

pos type i.

l_top_key = pos.

but I am getting short dump.lvc_nkey is char type.

Thanks

Regards.

Read only

0 Likes
764

Hello !

Try the WRITE instruction instead :

WRITE pos TO l_top_key.

Regards,

Mathieu

Read only

0 Likes
764

USE THIS -

DATA: D_CHAR(4),

D_INT TYPE I.

D_INT = 12.

D_CHAR = D_INT.

WRITE: D_CHAR.

Read only

0 Likes
764

what is the Dump info .

In st22 can u see what the dump is ?Please let us know and also pass the code of urs so that we can see the same for clear picture.

data: l_top_key type lvc_nkey,
        pos type i.

pos = 12.
l_top_key = pos.
write:/ l_top_key.

" no dump for this """

regards,

vijay.

Read only

0 Likes
764

I am usng this code in the alv tree control.

data: l_top_key type lvc_nkey,

pos type i.

pos = 12.

l_top_key = pos.

if ls_alv_fields-ind ne 'X'.

on change of ls_alv_fields-bez50.

perform add_rel_line using ls_alv_fields

l_top_key

changing l_bez50.

endon.

else.

on change of ls_alv_fields-bez50_2.

perform add_rel_line using ls_alv_fields

l_top_key

changing l_bez50.

endon.

endif.

I am getting the short dump when i am calling the method fush.