01-17-2013 6:39 AM
Hi,
I'm having a strange problem with symbol #
I am downloading data from BSEG table into excel file (using tab delimiter) using custom report and there is a field SGTXT with value ' Half Advance# '
I am using below statement to remove # from SGTXT, but the symbol is not deleting.
REPLACE ALL OCCURRENCES OF '#' in gs_output-SGTXT with ' '.
Looks like it is not HASH symbol, because when I tried
FIND ALL occurrences OF '#' IN gs_output-SGTXT MATCH COUNT lv_num.
RESULT of lv_num is showing as 0
When I add HASH symbol to that field and tried.
Concatenate '#' gs_output-SGTXT into gs_output-SGTXT.
FIND ALL occurrences OF '#' IN gs_output-SGTXT MATCH COUNT lv_num.
RESULT of lv_num is showing as '1'.
Any idea what might be that symbol?
The problem is when I downloaded the data into excel, it is thinking that the symbol is END OF ROW. Hence it is moving remaining fields after SGTXT into next row.
Somehow I have to remove that symbol from my custom report. Is there any FM or Method which will remove this strange symbol???
Kindly suggest.
Thanks
Seema
01-17-2013 6:45 AM
Hi reddy ,
Yes , you are correct # symbolizes end of row and begin of next line
try this :
REPLACE ALL OCCURRENCES OF `#` in gs_output-SGTXT with ` `.
Regards ,
Yogendra Bhaskar
01-17-2013 6:46 AM
Hi,
Check this thread & look at every reply.
http://scn.sap.com/thread/1594832
actually that is a garbage character.
Thanks
Gourav.
01-17-2013 6:48 AM
(FAQ) The "#" character is displayed for any non displayable character. Here you could try to use the static attributes of classe CL_ABAP_CHAR_UTILITIES like CL_ABAP_CHAR_UTILITIES=>NEWLINE, CR_LF or FORM_FEED instead of "#".
Regards,
Raymond
01-17-2013 6:51 AM
hi try also
translate command.
translate string with '# '.
hope it helps,
Vinoth
01-17-2013 6:49 AM
check out this function module.
SCP_REPLACE_STRANGE_CHARS
hope it helps,
Vinoth