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

FM to remove comma

Former Member
0 Likes
4,590

Hi All,

I am facing a problem with comma,

The number is coming with comma like 12,000.00

Need to remove the comma for my internal calculation.

Can any one can suggest me any Function module

Available for this.

Regards,

Rajib

Hi All,

I am facing a problem with comma,

The number is coming with comma like 12,000.00

Need to remove the comma for my internal calculation.

Can any one can suggest me any Function module

Available for this.

Regards,

Rajib

9 REPLIES 9
Read only

Former Member
0 Likes
1,825

Hi Rajib,

please try this..

data: quant(17) type c.

  • value from mseg-menge to quant

quant = mseg-menge.

replace ',' with space into quant.

condense quant no-gaps.

Write:/ quant.

Read only

0 Likes
1,825

replace ',' with space into quant.

condense quant no-gaps.

Here should take a loop to replace all ','

Read only

Former Member
0 Likes
1,825

Hi,

Look at the function module BAPI_CURRENCY_CONV_TO_INTERNAL

Regards

Sudheer

Read only

Former Member
0 Likes
1,825

Hi Rajib,

I think you probably taking that value from screen and then you are calculating.

Use REPLACE .

replace ',' in x with space.

Regards,

Tanmay

Read only

Former Member
0 Likes
1,825

Hi,

<b>The number always stored internally without ","</b> .

You need not exlicitly remove them.

For ex:

Parameters:

p_pack type p decimals 2.

if we enter <b>12,000.00 it internally stores as 12000.00</b>

What is ur case?? exactly tell me what r u trying to do with that number.??

Ram

Read only

0 Likes
1,825

hi,

I am fetching a data from the screen using a function module

called DYNP_VALUES_READ the field name is for PRPS-USR04

for the T-code CJ20n for the user field tab..My requirement is to fetch

the quantity and value and multiply the both and show it the third field

Read only

0 Likes
1,825

Hi,

lv_text = 12,000.

CALL FUNCTION 'STRING_REPLACE'

EXPORTING

pattern = ','

substitute = space

changing

text = lv_text

EXCEPTIONS

WRONG_STRING_LENGTH = 1

OTHERS = 2.

reward points if useful.

regards,

santosh

Read only

0 Likes
1,825

Hi Rajib,

then this is the solution..

<b>PARAMETERS: P_F1 TYPE P DECIMALS 2.

DATA: W_F1(30) TYPE C.

W_F1 = P_F1.

REPLACE ALL OCCURRENCES OF ',' IN W_F1 WITH SPACE.

CONDENSE W_F1 NO-GAPS.

WRITE W_F1.</b>

Read only

0 Likes
1,825

I have this same problem, but some users have as thousand separator the comma ',' and sometimes the '.' dot. How can I make it work for any case?

Thanks!