cancel
Showing results for 
Search instead for 
Did you mean: 

Help with SAPscript for printing checks

Former Member
0 Kudos

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 &REGUD-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,

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

/: DEFINE &TEXT3& = &SPELL-WORD&

/: DEFINE &LV_PAISE& = &SPELL-WORD&

/: PERFORM AMOUNT IN PROGRAM ZAMOUNT

/: USING &REGUD-SWNES&

/: USING &REGUD-WAERS&

/: CHANGING &TEXT3&

/: CHANGING &LV_PAISE&

/: ENDPERFORM

/*

/:

/:

/

/: IF &LV_PAISE& = ' '

/ &'*** 'TEXT3& &REGUD-WAERS&.

/: ELSE

/:

/ &'*** 'TEXT3& PAISE &lv_paise& &REGUD-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

Former Member
0 Kudos

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