on 06-11-2008 4:18 PM
hi
i want to convert the rupees into word so that i used spell_word function module,
this i have to print through smartform, in one window i written the code in program line before that i declare one types for structure (tp_spell) and through this i declare one internal table in global definition as t_spell type table of tp_spell these for internal table for passing the structure to that function module
after declaring i used function module in main window program lines
DATA: PWAERS LIKE EKKO-WAERS.
DATA : PAMOUNT TYPE P DECIMALS 2.
PAMOUNT = GV_TOT.
PWAERS = IS_EKKO-WAERS.
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
AMOUNT = PAMOUNT
CURRENCY = PWAERS
FILLER = ' '
LANGUAGE = SY-LANGU
IMPORTING
IN_WORDS = T_SPELL[]
EXCEPTIONS
NOT_FOUND = 1
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
like this i written the code in that window program lines and executed its giving short dump.
and i tried to findout the error, pamount variable was getting data and pwaers also getting the data and it was not entered into function module
so please give me solution for this problem
thanks
pallavi
data : V_TEXT type SPELL.
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
AMOUNT = v_balance
CURRENCY = 'INR'
FILLER = SPACE
LANGUAGE = SY-LANGU
IMPORTING
IN_WORDS = V_text
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Pallavi,
Do not pass WAERS value directly with the type EKKO-WAERS, instead assign this value to a variable of type CURRENCY in SPELL_AMOUNT function module so that you dont get dump.
This applies good for PAMOUNT value as well.
Thanks,
Koteswar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi
i taken pwaers as currency even though its given short dump
here i will show the msg which appears for dump observe and pls give the solution for this
Short text
Type conflict when calling a function module (field length).
What happened?
Error in the ABAP Application Program
The current ABAP program "/1BCDWB/SAPLSF00000131" had to be terminated because
it has
come across a statement that unfortunately cannot be executed.
A function module was called incorrectly.
Error analysis
An exception occurred that is explained in detail below.
The exception, which is assigned to class 'CX_SY_DYN_CALL_ILLEGAL_TYPE', was
not caught in
procedure "%CO45" "(FORM)", nor was it propagated by a RAISING clause.
Since the caller of the procedure could not have anticipated that the
exception would occur, the current program is terminated.
The reason for the exception is:
The call to the function module "SPELL_AMOUNT" is incorrect:
In the function module interface, you can specify only
fields of a specific type and length under "IN_WORDS".
Although the currently specified field
"T_SPELL" is the correct type, its length is incorrect.
source code
7994 * FORM %CO45
7995 * NODE %CODE2
7996 *----
7997
7998 FORM %CO45.
7999
8000 DATA: PWAERS type currency.
8001 DATA : PAMOUNT TYPE P DECIMALS 2.
8002 BREAK-POINT.
8003 PAMOUNT = GV_TOT.
8004 PWAERS = IS_EKKO-WAERS.
>>>> CALL FUNCTION 'SPELL_AMOUNT'
8006 EXPORTING
8007 AMOUNT = PAMOUNT
8008 CURRENCY = PWAERS
8009 FILLER = ' '
8010 LANGUAGE = SY-LANGU
8011 IMPORTING
8012 IN_WORDS = T_SPELL[]
8013 EXCEPTIONS
8014 NOT_FOUND = 1
8015 TOO_LARGE = 2
8016 OTHERS = 3
8017 .
8018 IF SY-SUBRC <> 0.
8019 MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
8020 WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
8021 ENDIF.
8022
8023 ENDFORM. " %CO45
8024
pls give the solution as early as possible
hi..
use the same data elements for the field or use the same length char field for that ...
DATA : money TYPE p DECIMALS 2,
in_letters LIKE spell.
money = '1000.00'.
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
amount = money
IMPORTING
in_words = in_letters
EXCEPTIONS
not_found = 1
too_large = 2
OTHERS = 3.
WRITE : / in_letters-WORD.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
here you are declarinf T_SPELL as table type. But that is nt table type.
Check the data type for IN_WORDS (importing parameter) and declare with the same data type.
Regards
Sandeep Reddy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hai Pallavi,
Try the following
***TO spell the amount in words.
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
amount = l_totamount
CURRENCY = 'INR'
FILLER = ' '
LANGUAGE = SY-LANGU
IMPORTING
in_words = l_amountwords
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.
***TO make the words to small letters
TRANSLATE l_amountwords-word+1(253) TO LOWER CASE.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.