cancel
Showing results for 
Search instead for 
Did you mean: 

How to convert Dec to string

Former Member
0 Kudos

I need to send the text 'N / A' for the internal table (t_tcurr) but in time to run the program because of dumping occurs move text to number.

How do I make this command work (move 'N/A' to t_tcurr-ukurs). ?:

select fcurr tcurr ukurs

from tcurr

into CORRESPONDING FIELDS OF TABLE t_tcurr

where fcurr eq coin and

tcurr eq coin2.

IF t_tcurr[] IS INITIAL.

move 'N/A' to t_tcurr-ukurs. (** the problem is here **)

How to convert the field (t_tcurr-ukurs to string?)

ENDIF.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

REPORT  ztest_dec_to_string.

DATA: ld_dec        TYPE z_dec9411, "DEC 9,4 Length 11
      ld_char11     TYPE char11,
      ld_string     type string.

CLEAR: ld_dec.

ld_dec = 1234. "1234.0000

CALL FUNCTION 'CONVERSION_EXIT_DEC4_OUTPUT'
 EXPORTING
   INPUT         = ld_dec
 IMPORTING
   OUTPUT        = ld_char11.

ld_string = ld_char11.

WRITE ld_string. "1.234,0000

You can use the conversion exit for packed values to get it to char then convert it to string.

Edited by: Mario Schmidt on Jul 18, 2011 8:00 AM

Answers (0)