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

Display Amount in different Format based on user setting

0 Likes
2,085

Hi All,

I have created one screen on which with one Input/Output field, I am

displaying the Amount (Bseg-wrbtr).

But I need to dispaly this amount using the folowing formats based on user setting.

If USR01-DCPFM = 'X'

then display Bseg-wrbtr in 1,234,567.89 format

elseif USR01-DCPFM = 'Y'

then display Bseg-wrbtr in 1 234 567,89 format

elseif USR01-DCPFM = BLANK

display Bseg-wrbtr in 1.234.567,89 format

endif.

I have issue that how to convert my Amount in different formats.

Is there a standard Fun Mod whom I pass the Amount and USR01-DCPFM value,

so that it can convert the Amount in required format.

Currently Amount is coming as 486956380.60.

I need to format this amount to different formats based on condition.

Please guide soon.

Hi All,

I have created one screen on which with one Input/Output field, I am

displaying the Amount (Bseg-wrbtr).

But I need to dispaly this amount using the folowing formats based on user setting.

If USR01-DCPFM = 'X'

then display Bseg-wrbtr in 1,234,567.89 format

elseif USR01-DCPFM = 'Y'

then display Bseg-wrbtr in 1 234 567,89 format

elseif USR01-DCPFM = BLANK

display Bseg-wrbtr in 1.234.567,89 format

endif.

I have issue that how to convert my Amount in different formats.

Is there a standard Fun Mod whom I pass the Amount and USR01-DCPFM value,

so that it can convert the Amount in required format.

Currently Amount is coming as 486956380.60.

I need to format this amount to different formats based on condition.

Please guide soon.

2 REPLIES 2
Read only

LucianoBentiveg
Active Contributor
0 Likes
1,036

DATA: lc_wrbtr(16) TYPE c.

WRITE Bseg-wrbtr to lc_wrbtr.

Regards.

Read only

Former Member
0 Likes
1,036

HI,

Take a Decimal variable

data : v_curr type p decimals 2.

v_curr = '486956380.60'

If USR01-DCPFM = 'X'

then display Bseg-wrbtr in 1,234,567.89 " No Conversion is requried taken care automatically

elseif USR01-DCPFM = 'Y'

replace ',' with space into v_curr.

replace '.' with ',' into v_curr.

then display Bseg-wrbtr in 1 234 567,89 format

elseif USR01-DCPFM = BLANK

replace '.' with '#' into v_curr.

replace ',' with '.' into v_curr.

replace '#' with ',' into v_curr

display Bseg-wrbtr in 1.234.567,89 format

endif.

Thanks,

Mahesh