2008 Aug 01 11:30 AM
HI ALL
I HAVE WRITTEN FOLLOWING CODE IN SCRIPT SE71 FORM
PERFORM SPEL_AMT IN PROGRAM ZABC USING &AMOUNT& CHANGING &AMTWD&
AND THE FOLLOWING CODE IN FORM (IN SE38 PROGRAM)
data: var1 like bseg-dmbtr,
w_word(50) TYPE c.
form spel_amt tables intab structure itcsy
outtab structure itcsy.
LOOP AT OUTTAB.
read table intab index 1.
move intab-value to var1.
CALL FUNCTION 'HR_IN_CHG_INR_WRDS'
EXPORTING
amt_in_num = VAR1 " '1005.70'
IMPORTING
amt_in_words = w_word
EXCEPTIONS
data_type_mismatch = 1.
*WRITE: w_word.
READ TABLE OUTTAB INDEX 1.
IF OUTTAB-NAME = 'AMTWD'.
MOVE W_WORD TO OUTTAB-VALUE.
MODIFY OUTTAB.
ENDIF.
ENDLOOP.
endform.
BUT I AM NOT GETTING OUTPUT IN VARIABLE AMTWD.
WHAT IS WRONG IN THE ABOVE CODING.
I AMTRYING TO GET AMOUNT IN WORD IN AMTWD.
THANX IN ADV.
ROCKY
2008 Aug 01 11:38 AM
Hi!
Try to write it into your SAPScript like this:
/: PERFORM SPEL_AMT IN PROGRAM ZABC
/: USING &AMOUNT&
/: CHANGING &AMTWD&
/: ENDPERFORM.
Put a break-point into the ABAP code to see, how it is working.
Regards
Tamá
Hi Rocky,
First you need to pass the AMOUNT to the INTAB-value and now the Amount will be available in the ITCSY structure then
you can use in the FM. And again pass it to the outtab value.
Regards,
Sharath
2008 Aug 01 11:34 AM
Hi,
please use ENDPEFORM statement after perform statement...
it will solve your problem.
Regards,
venkat
2008 Aug 01 11:38 AM
Hi!
Try to write it into your SAPScript like this:
/: PERFORM SPEL_AMT IN PROGRAM ZABC
/: USING &AMOUNT&
/: CHANGING &AMTWD&
/: ENDPERFORM.
Put a break-point into the ABAP code to see, how it is working.
Regards
Tamá
2008 Aug 01 11:39 AM
Hi Rocky,
First you need to pass the AMOUNT to the INTAB-value and now the Amount will be available in the ITCSY structure then
you can use in the FM. And again pass it to the outtab value.
Regards,
Sharath
2008 Aug 01 11:42 AM
Why dont u debug this subroutine. You would get to know what the problem is...
Nayan
2008 Aug 01 7:24 PM
What's the point of the LOOP AT OUTTAB? I don't see any use for it. Is this form called by other sapscripts with different values?
Try
FORM spel_amt tables intab structure itcsy
outtab structure itcsy.
DATA: w_num LIKE pc207-betrg,
w_wrd(130) TYPE c.
READ TABLE intab INDEX 1.
MOVE intab-value TO w_num.
CALL FUNCTION 'HR_IN_CHG_INR_WRDS'
EXPORTING
amt_in_num = w_num
IMPORTING
amt_in_words = w_wrd
EXCEPTIONS
data_type_mismatch = 1.
outtab-value = w_wrd(50).
MODIFY outtab INDEX 1.
ENDFORM.
amt_in_num is 15 characters, 2 decimal places
var1 is only 13 characters, 2 decimal places
amt_in_words can be upto 130 characters, I'm assuming there's a reason you're limiting yourself to 50.
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |