Spell amount in SAP ABAP

Use of  FM  'SPELL_AMOUNT'

 DATA :
 WS_SPELL TYPE SPELL,

 pLANGU LIKE T002-SPRAS DEFAULT SY-LANGU,
 pCURR LIKE TCURC-WAERS DEFAULT 'USD',
 pAMOUNT LIKE VBAP-MWSBP ,
 pFILLER(1) TYPE C DEFAULT ' '.

 

CALL FUNCTION 'SPELL_AMOUNT'
 EXPORTING
  AMOUNT = pAMOUNT
  CURRENCY = pCURR
  FILLER = pFILLER
  LANGUAGE = pLANGU "SY-LANGU
 IMPORTING
  IN_WORDS = WS_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.
ELSE.
 WRITE :/ WS_SPELL-word , WS_SPELL-decword.
ENDIF.

Comments

Popular posts from this blog

New commodity code create in SAP S/4 Hana

BAPI to Change STO PO/ PO Delivery date in SAP

Decimal remove in a smartforms report