cancel
Showing results for 
Search instead for 
Did you mean: 

Special Character '&' in Smartform

Former Member
0 Kudos

My Smartform is showing the data which contains '&' as <(> & <)>, as shown the pic below:

http://img291.imageshack.us/img291/8667/questionl.jpg

how do i handle the special character used by smartforms as variable?

the actual data is SALES & MARKETING, but smartforms showing it as SALES <(> & <)> MARKETING, the variable name used to display is &WA_LINE&.

Please help. TQVM...

Regards,

MJ

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

If the string which you want to print is in &WA_LINE&, then even if it has '&', it will displayed correctly.

So, Please check the contents of the &WA_LINE& by keepinh break-point.

Thanks & Regards,

Vamsi.

Answers (3)

Answers (3)

Former Member
0 Kudos

You can call FM 'CONVERT_ITF_TO_ASCII' just after READ_TEXT to handle this.

CALL FUNCTION 'READ_TEXT'

EXPORTING

id = im_text_id

language = gt_spras

name = im_tdname

object = im_tdobject

TABLES

lines = lt_tline

EXCEPTIONS

id = 1

language = 2

name = 3

not_found = 4

object = 5.

IF sy-subrc = 0.

CALL FUNCTION 'CONVERT_ITF_TO_ASCII'

EXPORTING

codepage = '0000'

formatwidth = 128

language = sy-langu

tabletype = 'ASC'

IMPORTING

c_datatab = ex_text_tbl

TABLES

itf_lines = lt_tline

EXCEPTIONS

invalid_tabletype = 1

OTHERS = 2.

ENDIF.

Former Member
0 Kudos

Hi,

We need to check it.

Also, Check if that is the standard text, check in SO10 whether the text is correct or not If it is correct there then we need to check the processing of READ_TEXT.

But i think, there will be no problem with READ_TEXT.

Thanks & Regards,

Vamsi.

Former Member
0 Kudos

Hi Vamsi Krishna,

Thanks for your help, I found that &WA_LINE& contains 'SALES <(>&<)> MARKETING' which is different from actual data 'SALES & MARKETING'.

so i use

replace all OCCURRENCES OF '<(>&<)>' in wA_line-tdline with '&'.

statement to solve my problem.

But may i know why it is happen?I using READ_TEXT to read the long text and put into the smartforms.

this is the only solution?.

Thank.