‎2009 Jun 02 8:07 AM
Hi,
I am new to the sap script and i am facing a problem as i have called subroutine to convert digit amount into number but its missing some words as 57,387,916.20- [Rs. FIVE CRORE SEVENTY THREE LAKH EIGHTY SEVEN THOUSAND NINE HUNDRED SIXTEEN AND P]
and i want to display it as:- FIVE CRORE SEVENTY THREE LAKH EIGHTY SEVEN THOUSAND NINE HUNDRED SIXTEEN AND PAISE TWENTY ONLY.
plzz provide me guidelines to solve this problem.
thank you.
Edited by: Saalim on Jun 2, 2009 9:09 AM
‎2009 Jun 02 8:12 AM
Hi,
Check this FM 'HR_IN_CHG_INR_WRDS'
You need to call the perform from sapscript to fetch the text from this FM.
Split the string into two variables and display on the Sapscript. There is restriction of number of chars in the each.
‎2009 Jun 02 9:30 AM
yes i called the function module but how to split the variables,i am not getting so please tell me so it can solve my problem.
Thank you.
‎2009 Jun 02 8:12 AM
Hi,
It is better to declare the variable used to display amount in words as STRING type.
‎2009 Jun 02 8:13 AM
I think you need to check for the available space for printing this variable is sufficient or not.
And also you can try to see if all the data is populated correctly or not in that variable in debugging mode. Try this and tell me if u need any further help.
Regards,
Akanksha
‎2009 Jun 02 8:19 AM
hi,
all you have to do is to create a FM which will split the string which you want to do and put a highfen mark in between so that it might not get disformatted. you have can have a view through this FM :-
STRING_SPLIT_AT_POSITION
Just pass the value u want to split and there will be no problem in displaying the string in a formatted way. sapscript does not support the facility of displaying the string or text in it or you can have a look for the CONCATENATE statement in SAPSCRIPT. If it can be used in it?
revert back if you wanna more.
Edited by: ricx .s on Jun 2, 2009 9:19 AM
‎2009 Jun 02 8:29 AM
Hi Saalim,
I hope number display in words may not fit into the window , try to reduce the font size and check or increase the window size .
Regards,
Sandhya
‎2009 Jun 02 9:50 AM
hie Saalim
try this:
FORM get_amt_words .
DATA: x_amount TYPE p DECIMALS 2,
xwords LIKE spell.
x_amount = zxx-amount.
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
amount = x_amount
currency = 'ZWD'
IMPORTING
in_words = xwords
EXCEPTIONS
not_found = 1
too_large = 2
OTHERS = 3.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CONCATENATE xwords-word 'Dhora' xwords-decword 'Senti'
INTO zxx-amount_in_words SEPARATED BY space.
regards
Isaac Prince