2008 Oct 23 11:10 AM
hi ,
i have prepared an invoice bill in smartform.i want the grandtotal value to be displayed in words..is there any function module what we have script like convert_amount_in_words...do we have any such in smartforms.
2008 Oct 23 11:13 AM
hi ,
i have prepared an invoice bill in smartform.i want the grandtotal value to be displayed in words..is there any function module what we have script like convert_amount_in_words...do we have any such in smartforms.
2008 Oct 23 11:11 AM
2008 Oct 23 11:12 AM
u this Fm
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
amount = a
IMPORTING
in_words = gv_words.
2008 Oct 23 11:13 AM
2008 Oct 23 11:14 AM
Hi,
this is my own customised Function Module..You can use this...
import
AMOUNT TYPE KONV-KAWRT Condition base value
CURRENCY TYPE CHAR3 3-Byte field
export
WORDS TYPE C
FUNCTION zconvert_amnt_to_words.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(AMOUNT) TYPE KONV-KAWRT
*" REFERENCE(CURRENCY) TYPE CHAR3
*" EXPORTING
*" REFERENCE(WORDS) TYPE C
*"----------------------------------------------------------------------
DATA: w_amount(255) TYPE c,
w_out_amt(255) TYPE c,
amt_in_inr TYPE pc207-betrg.
amt_in_inr = amount.
IF currency = 'INR'.
CALL FUNCTION 'HR_IN_CHG_INR_WRDS'
EXPORTING
amt_in_num = amt_in_inr
IMPORTING
amt_in_words = w_amount
EXCEPTIONS
data_type_mismatch = 1
OTHERS = 2.
IF sy-subrc <> 0.
* RAISE data_type_mismatch.
ENDIF.
IF w_amount CS 'Rupee' AND w_amount NS 'Rupees'.
IF w_amount CS 'Paise'.
REPLACE 'Rupee' WITH 'And' INTO w_amount.
ELSE.
REPLACE 'Rupee' WITH space INTO w_amount.
ENDIF.
CONCATENATE w_amount ' Only' INTO w_amount.
ELSEIF w_amount CS 'Rupees'.
IF w_amount CS 'Paise'.
REPLACE 'Rupees' WITH 'And' INTO w_amount.
ELSE.
REPLACE 'Rupees' WITH space INTO w_amount.
ENDIF.
CONCATENATE w_amount ' Only' INTO w_amount.
ELSE.
CONCATENATE w_amount ' Only' INTO w_amount.
ENDIF.
TRANSLATE w_amount TO UPPER CASE.
words = w_amount.
ENDIF.
ENDFUNCTION.
i think this will help you.
Arunima
2008 Oct 23 11:15 AM
PERFORM convert_2_words USING EXCISE_AMT
CHANGING EXCISE_WRDS.
&----
*& Form convert_2_words
&----
text
----
-->AMT text
-->WRDS text
----
FORM convert_2_words USING amt
CHANGING wrds.
DATA : input TYPE pc207-betrg.
input = amt.
CALL FUNCTION 'HR_IN_CHG_INR_WRDS'
EXPORTING
amt_in_num = input
IMPORTING
amt_in_words = wrds
EXCEPTIONS
data_type_mismatch = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. "convert_2_words
2008 Oct 23 11:16 AM
Hi:
the same function module can be used in Smartform.
Regards
Shashi
2008 Oct 23 11:17 AM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |