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

Replace comma and period from a variable.

Former Member
0 Likes
776

Hi all.

I am having a variable with data 452,42.53 which i have to convert to 452.42,53.

Kindly  advice how to get this through program.

Rohini

4 REPLIES 4
Read only

former_member249399
Active Participant
0 Likes
643

try REPLACE ALL OCCURRENCES.

Read only

Former Member
0 Likes
643


Hi Rohini Waghel ,

I think you want to convert the currenyc amount or quantity as per the user decimal format.

You can use write statment as shown below for currecy and quantity fields. Define it as chatacter type. This will solve your issue.

WRITE wf_amount TO wf_amount1 CURRENCY 'EUR'.

WRITE wf_quantity TO wf_quantity1 UNIT 'EKPO-MENGE'.

Regards,

Pravin

Read only

Former Member
0 Likes
643

Try to do something like this:


DATA: v_kbetr TYPE konv-kbetr ,

      v_wrbtr TYPE c LENGTH 16.

v_kbetr = '45242.53'.

v_wrbtr = v_kbetr.

CONDENSE v_wrbtr NO-GAPS.

TRANSLATE v_wrbtr USING '.,'.

Read only

Former Member
0 Likes
643

Hi Rohini Waghel,