Application Development and Automation 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: 
Read only

Smartforms - Ampersand display issue

Former Member
0 Likes
2,195

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
Read only

former_member196157
Active Participant
0 Likes
1,596

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

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.

3 REPLIES 3
Read only

former_member196157
Active Participant
0 Likes
1,597

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

Read only

peng_wen
Product and Topic Expert
Product and Topic Expert
0 Likes
1,596

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

Read only

0 Likes
1,596

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