Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Amt in words in sap script

Hi Experts,

I created sap script, in sap script i want amt to words function, i already use "spell_amount" function like

DATA v_int TYPE i VALUE '1000'.

DATA var LIKE SPELL.

CALL FUNCTION 'SPELL_AMOUNT'

EXPORTING

AMOUNT = v_int

LANGUAGE = SY-LANGU

IMPORTING

IN_WORDS = var.

call function 'WRITE_FORM'

exporting

element = 'TEXT'

type = 'MAIN'

window = 'MAIN'.

now what i want my table is REGUP and curency field is DMBTR

so now i change the code........ like this

DATA v_int LIKE REGUP-DMBTR.

*DATA v_int TYPE I.

*DATA var LIKE SPELL.

  • CALL FUNCTION 'SPELL_AMOUNT'

  • EXPORTING

  • AMOUNT = v_int

  • LANGUAGE = SY-LANGU

  • IMPORTING

  • IN_WORDS = var.

CALL FUNCTION 'SPELL_AMOUNT'

EXPORTING

AMOUNT = v_int

  • CURRENCY = 'SY-LANGU'

FILLER = 'SPACE '

LANGUAGE = SY-LANGU

IMPORTING

IN_WORDS = SPELL

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.

but it display is zero

how can i get the value in variable "v_int" through" REGUP-DMBTR."

give me suggetion

Jigar

Former Member
replied

Does your check are voided checks ??

If not than, search for this piece of code in the RFFORI01,

        IF reguh-rwbtr NE 0.           "zero net check has to be voided
          CALL FUNCTION 'WRITE_FORM'
               EXPORTING
                    window   = 'CHECK'
                    element  = '540'
                    function = 'DELETE'
               EXCEPTIONS
                    window   = 1       "Fehler bereits oben gemerkt
                    element  = 2.      "error already noted

Add your code after words for getting the SPELL_AMOUNT

V_AMT = REGUH-RWBTR.

then call FM SPELL_AMOUNT.

Regards,

Naimesh Patel

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question