04-15-2015 8:17 AM
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.
04-15-2015 8:27 AM
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
04-15-2015 8:27 AM
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
04-15-2015 9:54 AM
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
04-15-2015 10:35 AM
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 Peng Wen.
Regards,
Raymond