cancel
Showing results for 
Search instead for 
Did you mean: 

SPELL amount not printing in SAP Script

Former Member
0 Kudos

Hi,

WE have one sap script and print program in print program for some amount I have use function module amount spell the detail code as given below, in my print program I am getting proper spell in field ZAMOUNT but in SAP script that spell amount is not getting printed

find below the coe

                                                        • PRINT PROGRAM ************************

DATA: zamount_SPELL like spell-word,
            zamount TYPE IN_WORDS.
data : v_amt(20).
data : v_cur type SY-WAERS.
data : spell type SPELL.
*TABLES: RF02D.

 v_amt = KOMVD-KWERT.

  v_cur = KOMVD-AWEIN.

shift v_amt left deleting leading space.
shift v_cur left deleting leading space.

CALL FUNCTION 'Z_BM_SPELL_AMOUNT'
     EXPORTING
          CURRENCY = v_cur
          AMOUNT   = v_amt
    IMPORTING
         IN_WORDS = ZAMOUNT_SPELL
     EXCEPTIONS
          ERROR    = 1
          OTHERS   = 2.

           ZAMOUNT = ZAMOUNT_SPELL.

        CALL FUNCTION 'WRITE_FORM'
             EXPORTING
                  ELEMENT = 'SUM_LINE'.

as per above code i am getting proper spell amount in ZAMOUNT , ZAMOUNT_SPELL

*********SAP SCRIPT CODE ******************** .

SU Final amount in words : &ZAMOUNT&

*as per above in print I am only getting

Final amount in words :

ZAMOUNT Value is not getting printed

regards,

zafar

Moderator Message: Please post the questions in the right forum and enclose your code in Your Code tags.

Edited by: kishan P on Aug 31, 2010 10:49 AM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Try this -->



SPLIT <zamount> AT '.' INTO: rs_amt paise_amt.
SPLIT rs_amt AT ',' INTO: amount1 amount2 amount3.
CONCATENATE amount1 amount2 amount3 INTO amount1.
 <amount> = amount1.
 

Former Member
0 Kudos

Dear freind,

In zamount I am already getting Spell amount like 'Three hundred Fifty thousand' but this value of amount is not coming in print out with code

SU Final Amount in words : &ZAMOUNT&

regards,

zafar

Former Member
0 Kudos

well you have give not too much info so we can just guess.

My guess is that ZAMOUNT is not declared globally in your driver program.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Try to use Condense ZAMOUNT in print program.

Regards,

Srini.