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: 

Custom report: How to remove this Strange Symbol # from BSEG-SGTXT.

Former Member
0 Kudos

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

5 REPLIES 5

yogendra_bhaskar
Contributor
0 Kudos

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

gouravkumar64
Active Contributor
0 Kudos

Hi,

Check this thread & look at every reply.

http://scn.sap.com/thread/1594832

actually that is a garbage character.

Thanks

Gourav.

raymond_giuseppi
Active Contributor
0 Kudos

(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

0 Kudos

hi try also

translate command.

translate string with '# '.

hope it helps,

Vinoth

vinoth_aruldass
Contributor
0 Kudos

check out this function module.

SCP_REPLACE_STRANGE_CHARS

hope it helps,

Vinoth