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

Convert char format to decimal format

Former Member
0 Likes
1,043

data : chrqty(4) type c,

cnvQty(14) type c,

valqty type p decimals 3.

chrqty = '1234'.

valqty = chrqty.

concatenate chrqty(1) chrqty(4) into cnvqty.

write: / chrqty, "Character Qty,

/ cnvqty,

/ valqty round +3 . "Value Qty.

*Example : string .....'1234'

  • convert val.'1.234

data : chrqty(4) type c,

cnvQty(14) type c,

valqty type p decimals 3.

chrqty = '1234'.

valqty = chrqty.

concatenate chrqty(1) chrqty(4) into cnvqty.

write: / chrqty, "Character Qty,

/ cnvqty,

/ valqty round +3 . "Value Qty.

*Example : string .....'1234'

  • convert val.'1.234

3 REPLIES 3
Read only

Former Member
0 Likes
903

Amit,

REPORT ztest MESSAGE-ID 00.

DATA: char_format(10) TYPE c VALUE '12,345.56'.

DATA: decimal_format(10) TYPE p DECIMALS 2.

REPLACE ALL OCCURRENCES OF ',' IN char_format WITH space.

CONDENSE char_format NO-GAPS.

decimal_format = char_format.

Don't forget to reward if it useful.

Read only

Former Member
0 Likes
903

hI...

u need not do all that..

just do this:

PACK CHRQTY TO VALQTY.

WRITE VALQTY.

Ram..

Read only

Former Member
0 Likes
903

hi amit,

try this

WRITE <charqty> to <another char qty> unit <qty unit>

reward points if helpful