on 02-11-2008 7:45 AM
Hi all,
I am trying to modify the standard form : RVINVOICE01.
In main window i am getting the total Amount in Numbers. My requirement is to print that total Amount in Words in a Footer Window.
Example:
In Main Window if i get Total : 1160 (KOMK-FKWRT)
Then in Footer Window i have to display like this
Total in words :One Thousand One hundred sixty.
for this i am using Subrotines, but it is giving Dump. Check my code below and correct me .
I have written like this in Footer Window..
/: PERFORM ZK_WORD IN PROGRAM ZADIN01
/: USING &KOMK-FKWRT&
/: CHANGING &WORD1&
/: ENDPERFORM
AS Total in Words : &WORD1&
-
And in SE38 i have created a Subroutine Pool program ZADIN01 as follows.
FORM ZK_WORD tables input structure ITCSY
output structure ITCSY.
DATA: v_int type p decimals 2.
words like spell.
READ table input index 1.
if sy-subrc = 0.
move input-value to v_int.
endif.
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
AMOUNT = V_INT
IMPORTING
IN_WORDS = WORDS
EXEPTIONS
NOT_FOUND = 1
TOO_LARGE = 2
OTHERS = 3.
-
I am getting the Dump with the above code.
The error that i am getting is : Unable to interpret '1160' as a number , but since the value contravences
the rules for correct number formats, this was not possible.
and it is stating that the error is in move input-value to v_int.
How to solve this ?
Thanks in advance
KR
try to add the below code..
DO.
REPLACE ',' WITH ' ' INTO v_int.
IF SY-SUBRC NE 0.
CONDENSE v_int NO-GAPS.
EXIT.
ENDIF.
ENDDO.
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
AMOUNT = V_INT
IMPORTING
IN_WORDS = WORDS
EXEPTIONS
NOT_FOUND = 1
TOO_LARGE = 2
OTHERS = 3.
Regards,
SaiRam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
add
/: define word1 = ' '
/: PERFORM ZK_WORD IN PROGRAM ZADIN01
/: USING &KOMK-FKWRT&
/: CHANGING &WORD1&
/: ENDPERFORM
AS Total in Words : &WORD1&
FORM ZK_WORD tables input structure ITCSY
output structure ITCSY.
DATA: v_int type p decimals 2.
word1 like spell.
READ table input index 1.
if sy-subrc = 0.
move input-value to v_int.
endif.
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
AMOUNT = V_INT
IMPORTING
IN_WORDS = WORD1
EXEPTIONS
NOT_FOUND = 1
TOO_LARGE = 2
OTHERS = 3.
add this in ur form also.
READ TABLE OUTPUT INDEX 1.
IF SY-SUBRC = 0.
OUT_PAR-VALUE = WORD1.
MODIFY OUTPUT INDEX SY-TABIX.
ENDIF.
Hope this will be useful for you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi
to print amount in words use
FM:SPELL_AMOUNT
regards
vijay
reward points if helpful
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.