on 09-07-2007 9:08 PM
I'm developing a SAPscript to print checks. I've run into two problems which I've listed below:
1.) I'm print the check amount in words which is left justified and would like to fill the remaining spaces in the window with "*". Below is the comands I'm using:
/E 545
/ &SPELL-WORD&&' and 'SPELL-DECIMAL(2)'/100'&
2.) When I use ®UD-SNETT& the window must be 17 character to show the amount. Is there a way the shorten the window to 15 characters and still have the amount show?
Thanks,
/: DEFINE &TEXT3& = &SPELL-WORD&
/: DEFINE &LV_PAISE& = &SPELL-WORD&
/: PERFORM AMOUNT IN PROGRAM ZAMOUNT
/: USING ®UD-SWNES&
/: USING ®UD-WAERS&
/: CHANGING &TEXT3&
/: CHANGING &LV_PAISE&
/: ENDPERFORM
/*
/:
/:
/
/: IF &LV_PAISE& = ' '
/ &'*** 'TEXT3& ®UD-WAERS&.
/: ELSE
/:
/ &'*** 'TEXT3& PAISE &lv_paise& ®UD-WAERS&.
/: ENDIF
REPORT zamount.
TABLES : spell,
regud.
----
INTERNAL TABLE DECLARATIONS *
----
DATA: text3 LIKE spell-word,
lv_paise type char255,
amount1 like KONV-KAWRT,
currency1(5) type c,
words like spell-word.
FORM amount TABLES inttab STRUCTURE itcsy outtab STRUCTURE itcsy.
clear text3.
BREAK S_ABAP_SK.
CHECK sy-subrc = 0.
READ TABLE inttab INDEX 1.
**REPLACE ALL OCCURRENCES OF ',' IN INTTAB-VALUE WITH ' '.
REPLACE ALL OCCURRENCES OF ',' IN INTTAB-VALUE WITH ' '.
*
**replace '.' with ' ' into inttab-value.
*replace ',' with '.' into inttab-value.
replace '' with ' ' into inttab-value.
*condense inttab-value.
shift inttab-value left deleting leading '*'.
replace '*' with ' ' into inttab-value.
shift inttab-value right deleting trailing '*'.
condense inttab-value NO-GAPS.
amount1 = inttab-value.
READ TABLE inttab INDEX 2.
currency1 = inttab-value.
CALL FUNCTION '/OBIZ/ZCONVERT_AMNT_TO_WORDS'
EXPORTING
amount = amount1
currency = currency1
IMPORTING
words = words.
EXCEPTIONS
ZERO_VALUE = 1
INCORRECT_AMOUNT = 2
AMOUNT_HIGH = 3
INVALID_CURRENCY = 4
OTHERS = 5
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
select single * from mcha where matnr = inttab-value.
IF sy-subrc = 0.
split words at 'PAISE' into words lv_paise.
replace 'ONLY' with ' ' into lv_paise.
READ TABLE outtab INDEX 1.
*
CHECK sy-subrc = 0.
MOVE BSIK-QBSHB TO OUTTAB-VALUE.
replace 'Rupee' with ' ' into words.
replace 'RUP' with ' ' into words.
replace 'ONLY' with ' ' into words.
outtab-value = words.
replace 'Rupee' with ' ' into OUTTAB-VALUE.
replace 'ONLY' with ' ' into outtab-value.
CONDENSE OUTTAB-VALUE.
break daburdev1.
text3 = outtab-value.
replace 'Rupee' with ' ' into text3.
CONDENSE text3.
MODIFY outtab INDEX sy-tabix.
read table outtab index 2 .
CHECK sy-subrc = 0.
outtab-value = lv_paise.
condense outtab-value.
lv_paise = outtab-value.
MODIFY outtab INDEX 2.
ENDIF.
ENDFORM. "CALCULATION
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can print the '*' in the spell amt as follows:
/E 545
&'*** 'SPELL-WORD& and 'SPELL-DECIMAL(2)/100' '&***
We can reduce the size of the amount text which you want to
print in the Window.
Reward if it is useful.
Thanks,
Geeta
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
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.