Convert amount to char
Hi Experts,
Here i have one question and that was how to convert amount like 345 into words like THREE HUNDRED FORTY FIVE.......
Thanks,
Natala
Hi. Welcome to SDN! If you are asking how to do this using ABAP, then first you should know that ABAP related questions should be asked in the ABAP forum. This will provide you with quicker answers.
To answer your question you can use the function module SPELL_AMOUNT. This will convert your number to words.
For example.
report zrich_0004.
data: i type i value '345'.
data: words type spell.
call function 'SPELL_AMOUNT'
exporting
amount = i
* CURRENCY = ' '
* FILLER = ' '
language = sy-langu
importing
in_words = words
exceptions
not_found = 1
too_large = 2
others = 3.
write:/ words-word.
Again, welcome to SDN.
Regards,
Rich Heilman
Similar Messages
-
Function Module to convert amount to amount in words
Dear Guru ,
I want to know is there any sap standard Function Module to convert amount value to amount in words
Thanks & RegardsHi..
Use FM SPELL_AMOUNT.
This function module converts an amount or number into words. It can be used as follows:
Convert a number into words
To do this, the transfer parameters LANGUAGE and AMOUNT have to be entered.
Convert an amount into words
To do this, the fields LANGUAGE, CURRENCY, and AMOUNT have to be entered.
Program RF_SPELL contains a sample call of the function module. You can use it for test purposes.
REPORT ZSPELL.
TABLES SPELL.
DATA : T_SPELL LIKE SPELL OCCURS 0 WITH HEADER LINE.
DATA : PAMOUNT LIKE SPELL-NUMBER VALUE '1234510'.
SY-TITLE = 'SPELLING NUMBER'.
PERFORM SPELL_AMOUNT USING PAMOUNT 'USD'.
WRITE: 'NUMBERS', T_SPELL-WORD, 'DECIMALS ', T_SPELL-DECWORD.
FORM SPELL_AMOUNT USING PWRBTR PWAERS.
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
AMOUNT = PAMOUNT
CURRENCY = PWAERS
FILLER = SPACE
LANGUAGE = 'E'
IMPORTING
IN_WORDS = T_SPELL
EXCEPTIONS
NOT_FOUND = 1
TOO_LARGE = 2
OTHERS = 3.
ENDFORM. " SPELL_AMOUNT
I hope it helps.
Reward pts if helpful
Regards
- Rishika Bawa -
How to convert amount which is in text to numeric..
Hi all,
Can anyone tell me how to convert amount which is in text to numeric..
i am having the value as ' three hundred '
it has to be converted to numeric as 300.
ofcourse its surprising ...but required
Any help will be greatful.
rgds,
rajhi Ravi,
Check out <b>PSSV_TEXT_INTO_FIELD_CURRENCY</b> FM
Regards,
Santosh -
How to convert Amount which is in figure to words
How to convert Amount which is in figure to words like :
Rs 1005.70 into 'Rupees One Thousand Five and 70 Paise'
Thanks
kumar nhiii
use FM
SPELL_AMOUNT
WA_AMOUNT = '10000'.
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
AMOUNT = WA_AMOUNT
CURRENCY = PWAERS
FILLER = SPACE
LANGUAGE = 'E'
IMPORTING
IN_WORDS = WA_SPELL
EXCEPTIONS
NOT_FOUND = 1
TOO_LARGE = 2
OTHERS = 3.
regards
twinkal -
Reg: Convert amount in values to amount in words
Dear All,
Want to convert amount value into words and it will displays on UDF which is created in Marketing document. How can i do that.
Plese help me
Thanks & Regards
Venkatesh NHi,
Check Re: Amount in Words in INR for solution.
Create function in SQL and then apply FMS to get that function in udf.
Thanks,
Neetu -
Convert amount in no's to words
hi sapiens,
I need a code or Fm to convert amount in numbers to words
eg) 1500 ---> one thousand and five hundredHi,
Use FM SPELL_AMOUNT
Pass the below value only
Import parameters Value
AMOUNT 1234
CURRENCY
FILLER
LANGUAGE EN
Export parameters Value
IN_WORDS 000000000001234000 0 ONE THOUSAND TWO HUNDRED THIRTY-FOUR
Regards
Shiva -
How to convert amount data element to number data element
Dear Gurus,
I have a requirement to get the data by calling BRF+ and then pass them to BAPI 'BAPI_ASSET_ACQUISITION_POST', in the BRF+ export structure, there is a field 'AMOUNT', I bind it to DDIC element 'BF_ANBTR', the type is Number.
In BRF+, I call another global function to calculate the value, I define a local variant LV_VALUE to get export value from this function, this local variant's type is Amount, now I need to move this local variant value to the export field 'AMOUNT'.
But BRF+ doesn't allow to convert amount data element to number data element directly, and I find there is no formula function available. Only there is a function 'TO_AMOUNT' to convert number data element to amount data element.
Please help to get a solution for above solution.
Thanks.Hi,
within the formula expression within the category "Mathematical functions" you will find the function "TONUMBER". This converts a data element of type currency to a number. According to the help of this function:
"The following conversion rules apply:
<Amount>: The number part is returned. The currency unit is omitted."
This is what you are looking for.
For the other way round you already mentioned the correct function "TO_AMOUNT"
BR
Christian -
Converting a 6 char string to date
Please help..
How can I convert a 6 char date (ddmmyy) to date format
that can be passed as input to function module?Hi,
Try FM,
CONVERT_DATE_TO_INTERNAL
Run this sample code,
DATA:
my_date(6) TYPE c VALUE '300708',
w_date TYPE sy-datum.
CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
EXPORTING
date_external = my_date
* ACCEPT_INITIAL_DATE = ACCEPT_INITIAL_DATE
IMPORTING
date_internal = w_date
EXCEPTIONS
date_external_is_invalid = 1.
WRITE: w_date.
Regards
Adil -
Convert amount from flat file format to user format
hi,
how to convert amount from flat file format to user specific format.
input: 1000.00
output: 1.000,00 (user specific)
thanks in advancemove that value to a type WRBTR variable
and use write statement.
data v_wrbtr type wrbtr.
data v_char(20).
v_wrbtr = 1000.
write v_wrbtr to v_char.
v_char will contain the amount in user format.
Prerequsite, go to SU3 transaction.
Defaults tab, chose the decimal notation .
Regards,
Ravi -
(v urgent) converting amount in figures to amount in words ina spec languag
Hi All,
I have a requirement like i need to convert amount i n figures to amount in words, and that too for a specific language (eg., portuguese and not english) . This needs to be done in the SAPSCRIPT and not in the program as the program is a standard one.
Please help me out as it is v urgent.
Regards,
PriyaUse FM
HR_IN_CHG_INR_WRDS
Award points if answer is useful
tc
saji -
FM to convert amount from one currency to another currency?
HI Experts
is thier any Fucnction module to convert amount from one currency to another currency?
please help me.
ThanksHi,
data: lv_foramt TYPE vbap-netpr VALUE 40,
lv_forcurr TYPE string VALUE 'USD',
lv_loccurr TYPE string VALUE 'INR',
lv_locamt TYPE vbap-netpr.
CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'
EXPORTING
CLIENT = SY-MANDT
DATE = sy-datum
FOREIGN_AMOUNT = lv_foramt
FOREIGN_CURRENCY = lv_forcurr
LOCAL_CURRENCY = lv_loccurr
RATE = 0
TYPE_OF_RATE = 'M'
READ_TCURR = 'X'
IMPORTING
* EXCHANGE_RATE =
* FOREIGN_FACTOR =
LOCAL_AMOUNT = lv_locamt
* LOCAL_FACTOR =
* EXCHANGE_RATEX =
* FIXED_RATE =
* DERIVED_RATE_TYPE =
EXCEPTIONS
NO_RATE_FOUND = 1
OVERFLOW = 2
NO_FACTORS_FOUND = 3
NO_SPREAD_FOUND = 4
DERIVED_2_TIMES = 5
OTHERS = 6
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
write:/ lv_locamt.
P.S. Please test your FM in SE37. When I tested, it worked only between USD and INR. -
Hi!..
I have a problem!...
I need to convert integers to chars, but i`m using char(int)....
So, only accept until ascii code 128..
Please, What can I do?
This is my code:
Thanks!
public Convert() {
public static void main(String[] args) {
Convert convert1 = new Convert();
System.out.print(f_Transforma("ABCD"));
public static String f_Transforma(String Password)
int IntStrLong=Password.length();
String StrResultado=new String();
while (IntStrLong >=1)
int tmpchar=(int)Password.charAt(IntStrLong-1); //valor ascii
tmpchar=256-tmpchar+IntStrLong;
String aChar = new Character((char)tmpchar).toString(); //ASCII code to String
StrResultado=StrResultado+aChar;
IntStrLong-=1;
return (StrResultado);
}I did what you told me and nothing happened...
int tmpchar=(int)Password.charAt(IntStrLong-1); //valor ascii
tmpchar=256-tmpchar+IntStrLong;
tmpchar=tmpchar>>8;
String aChar = new Character((char)tmpchar).toString(); //ASCII code to String -
FM to convert double byte chars
Hi All,
Is there anyone know what are the function module to convert double-byte chars? Thanks.Seems like Blue Sky is not clear
You want to convert what into what?
Whats the purpose of this requirement, kindly give more details.
Regards
Karthik D -
How to convert ASCII to CHAR?
Hi, experts.
Now I want to convert ASCII to CHAR, can you give me some methods? And I also want to know what's my ABAP Version.
Thanks in advance!*After look so bad code that no work i did my own code, a gift for all you:*
FORM CHARACTER_ASCII using p_letra
changing p_nro type i.
field-symbols: <n> type x.
assign p_letra to <n> casting.
move <n> to p_nro.
ENDFORM.
FORM ASCII_CHARACTER using p_nro type i
changing p_letra.
DATA: c TYPE c,
x(4) TYPE x.
FIELD-SYMBOLS: <fc> TYPE c.
x = p_nro.
ASSIGN x to <fc> CASTING TYPE c.
MOVE <fc>+1(1) to p_letra.
ENDFORM. -
Hi SDN,
I have to convert raw to char.
data : lv_raw(16) type RAW.
data : lv_char(16) type c.
lv_raw = some value.
i want to convert this value in lv_raw to lv_char in character format.
please let me know.
i tried the FM BANK_API_PP_UT_CHAR16_TO_RAW16 but no use.
Regards,
Rahul WaghHI Vikranth,
i tried that FM also but it is not giving me correct value.
my hex value = 16D7A4FCA7442DDA3AD93C9A726597E4
the character value for this should come as = test1234
but FM given by u gives me junk values.
is there any other way for this
Regards,
Rahul
Maybe you are looking for
-
Error in MIGO against Outbound delivery in INTRA STO
Hi, I'm doing intra company STO. I've done all the settings for STO for both the plants under different comp codes. Now against my scheduling ageement, material is issed from supplied plant. When I'm trying to do GR against outbound delivery, system
-
I am about to give up the idea of ever finding a native Mac OS application for addresses and just keep using the 10-year old Parsons Address Book Windows software that I currently run using Virtual PC. It may be clunky and it may be creaky but, by go
-
Having problem with jumping tables
Hi guys, my website is www.njtraininggrounds.com I can't figure out why on both the Pricing page: http://www.njtraininggrounds.com/pricing.html and the Members page: http://www.njtraininggrounds.com/mm2.3/control_panel.php the entire table shifts. Ev
-
Panic message restart grey and black screen
WOONT RE BOOT OR START Computer froze and after manual power down and restart, grey and black screen appeared with a message to hold powwer button down to power off and then hold power button again to restart. I did and got same screen and message. "
-
Scrolling Mobile List in Pure AS3?
I'd like to use a scrolling list in one of my AS3 mobile projects. I like the one built for Flex, but I do not wish to use flex as that would be overkill and I already have the project written in AS3. Does anyone know of any pure AS3 scrolling list c