cancel
Showing results for 
Search instead for 
Did you mean: 

smart form printing twise

Former Member
0 Kudos

hi

am working on smart forms first getting the total from regup dmbtr and passing it to spell amount the output am taking it into a string after adding CENTS ONLY and all as i had to print a cheque ... i had to put it into two line so am using a function module IQAPI_WORD_WRAP

its giving in itab i had to print in TWO lines So i looped it

and passing it into a string and i created a text to display it

everything is fine exept tht its displaying twice

say one hundred only

one hundred only

actually i had two strings one is if only RS one hundred only

if there is paise to second string like

one hundred and paise fifty only

both are printing twice

please advise in detail

cheers

uday

ALL FUNCTION 'IQAPI_WORD_WRAP'

EXPORTING

textline = i_char

DELIMITER = ' '

OUTPUTLEN = 50

TABLES

OUT_LINES = itab

loop at itab.

if sy-tabix = 1.

l_var1 = itab-fr_line1.

else.

concatenate l_var2 itab-fr_line1 into l_var2.

endif.

ENDLOOP.

move l_var1 to G_AMT_IN_TXT2.

move l_var2 to G_AMT_IN_TXT3.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

hi

thaks a lot

cheers

uday

former_member188005
Contributor
0 Kudos

Prakash,

Everything ur doing right ...till passing the dmbtr to spell amount FM.

This FM returns WORD and DECWORD values...

Pass this two values to the smartform text element and display the values using conditions...

U should have to 2 text elements ...

i.e in Condition tab of the text u can specify for hundred only as" DECOWRD = 'ZERO' as when there is no decimal notation the decwaord value is ZERO.

And for other text condition " DECWORD <> 'ZERO'.

THis will print the amont in words only once if u use condition for text element.

Regards....

Former Member
0 Kudos

hi there

tkanks for the advise but one thing i gave tht condition if zero

if l_spell-DECWORD = 'ZERO'.

CONCATENATE

l_spell-word var3 into g_amt_in_txt1

separated by space.

move g_amt_in_txt1 to i_char.

else.

move l_spell-word to g_amt_in_txt2.

CONCATENATE var2 l_spell-DECWORD var3 INTO G_AMT_IN_TXT3

SEPARATED BY space.

CONCATENATE g_amt_in_txt2 G_AMT_IN_TXT3 into G_AMT_IN_TXT

SEPARATED BY ' AND '.

move G_AMT_IN_TXT to i_char.

ENDIF.

as i had to print in a cheque in two line i had to split it

so am using the FM

CALL FUNCTION 'IQAPI_WORD_WRAP'

EXPORTING

textline = i_char

DELIMITER = ' '

OUTPUTLEN = 50

IMPORTING

OUT_LINE1 = fr_line

OUT_LINE2 = sr_line

am getting the total as i want like

if 100

one hundred only

if 100.50

one hundred and cents fifty only

but the thing is its printing twise some small mistake am doing some where

cheers

uday

can i send the downloaded form to u