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

Currency Field format Validation

Former Member
0 Likes
1,346

Hi All,

Are Commas accepted in a Currency Fieldsi.e.,

I have to update a currency field in the Database Table.

If the user provides entries as 23,000.0000 the ',' is not accepted.

Is it possible to eliminate this , programatically?

Please note : he can also enter 23,330,340.00 also.

Any input on this will be of great help.

Thanks and Regards,

Pavithra

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,017

Hi Pavithra,

Generally there are Conversion routiines , it will take care of all these things .

If we give teh currency as 23046521 it automatically converts in to 23,046,521.00 will storing in database.

Best regards,

raam

Hi Pavithra,

Generally there are Conversion routiines , it will take care of all these things .

If we give teh currency as 23046521 it automatically converts in to 23,046,521.00 will storing in database.

Best regards,

raam

7 REPLIES 7
Read only

Former Member
0 Likes
1,018

Hi Pavithra,

Generally there are Conversion routiines , it will take care of all these things .

If we give teh currency as 23046521 it automatically converts in to 23,046,521.00 will storing in database.

Best regards,

raam

Read only

0 Likes
1,017

Hi Ram,

Thanks a lot for your response.

But the idea is the user is providing the Currency Field in my case. So i need to validate this before updating. Any input on this is highly appreciated.

Thanks

Pavithra

Read only

0 Likes
1,017

Hi,

You can refer to this thread.

Hope this will solve your problem.

Read only

0 Likes
1,017

Hi All,

Thanks a lot for your time.

Problem resolved.

It can be done as follows :

Before updating the Database Table we need to check for ',' and manipulate the value accordingly. Below is the code snippet that accomplishes this :

DATA : t_sal TYPE String,

v_sal TYPE string,

it_tab_sal TYPE TABLE OF string,

wa_tab_sal TYPE string.

CLEAR wa_tab_sal.

t_sal = '23,500,450.0000'.

SPLIT t_sal at ',' INTO TABLE it_tab_sal.

Loop at it_tab_sal INTO wa_tab_sal.

CONCATENATE v_sal wa_tab_sal into v_sal.

CLEAR wa_tab_sal.

ENDLOOP.

WRITE : v_sal.

Regards,

Pavithra

Read only

0 Likes
1,017

Hi,

You need not even split, You can use REPLACE ALL OCCURANCES OF and CONDENSE to achieve the Same.

Edited by: Siva Prakash on Jul 4, 2008 4:17 AM

Read only

0 Likes
1,017

Hi Pratibha..

The SU3 settings have a role to play here..go to su3>defaults>there u can change the currency type...no need to changein program...the format of currency printing will automatically change...

Read only

0 Likes
1,017

Hi Siva!!

Thanks!!!

This Replace all did occur to me but i wasnt aware of the CONDENSE Keyword. I was trying to find if there is any other method to compress space in the string!!

Thanks a lot for your time. Your time is much appreciated and points rewarded