Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Smartforms - Ampersand display issue

former_member585227
Participant
0 Kudos

Hi all,

Im working on smartforms and im facing a problem while reading header text of order.

User enters a text, for example ''Containers & Pallets'', this text displays in my output like ''Containers <(>&<)> Pallets''.

The issue probably based on the ampersand variable. Im using READ_TEXT function btw.

Is there a way to fix it or i'll delete it at program ?

Thanks.

1 ACCEPTED SOLUTION

former_member196157
Active Participant
0 Kudos

Hiiii,

Use ABAP Statement ,

DATA: lv_name type String.

lv_name = 'Containers <(>&<)> Pallets'.

REPLACE ALL OCCURRENCES OF '<' IN lv_name WITH space.

REPLACE ALL OCCURRENCES OF '>' IN lv_name WITH space.

REPLACE ALL OCCURRENCES OF '(' IN lv_name WITH space.

REPLACE ALL OCCURRENCES OF ')' IN lv_name WITH space.

Thanks,

Mahadeo

3 REPLIES 3

former_member196157
Active Participant
0 Kudos

Hiiii,

Use ABAP Statement ,

DATA: lv_name type String.

lv_name = 'Containers <(>&<)> Pallets'.

REPLACE ALL OCCURRENCES OF '<' IN lv_name WITH space.

REPLACE ALL OCCURRENCES OF '>' IN lv_name WITH space.

REPLACE ALL OCCURRENCES OF '(' IN lv_name WITH space.

REPLACE ALL OCCURRENCES OF ')' IN lv_name WITH space.

Thanks,

Mahadeo

peng_wen
Active Participant
0 Kudos

Hello,

During the transformation from MsWord to internal ITF(read_text),
as some signs (like ',' in some situations) have a special meaning,
so internally the real comma is "masked", but not how you
originally wrote <(>,<(> , it is <(>,<)>. ',' and '&' have a special
meaning. This is a known issue at SAP

Please also have a look at the attached note:
391261 SAPscript: Special character "&" and "<" in the PC

You may use a function module like CONVERT_ITF_TO_STREAM_TEXT /

CONVERT_ITF_TO_ASCII to convert the ITF format to pure text,

Regards,

Wen Peng

0 Kudos

You could (should) also read the SAP provided KBA :  2014034 - Character '&' in a long text shows as '<(>&<)>' which also suggests CONVERT_ITF_TO_ASCII as already written by

Regards,

Raymond