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: 

Find Hidden Characters-in downloaded file

former_member194669
Active Contributor
0 Kudos

All,

I have a file interface that downloading file to SANS server using open dataset. But recently we are getting some hidden characters in the file. These are getting from a long text.

Now my requirement is to find these hidden characters and display in the screen and user can correct then go for download.

Currently i am using Notepad++ or using this link for finding the hidden characters

http://string.online-toolz.com/tools/string-functions.php

Now user wanted to use the same functionality with in SAP using ABAP.

Any input on this appreciated.

9 REPLIES 9

Former Member
0 Kudos

Hi ,

I am not sure this facility in SAP.

Try to use string.online-toolz editor code in abap.(You can see by right click view source code)

0 Kudos

Hi,

> Try to use string.online-toolz editor code in abap.

I am not fully understood your reply.

For info: I am looking for option i can edit the content the file before download, then user can view the content , then if user is okay with content then go for download

0 Kudos

FM EDIT_TEXT and the others?

Rob

naimesh_patel
Active Contributor
0 Kudos

Similar functionality can be achieved by JavaScript. You can pass the entire Text and create your function in JS to find out the Hidden Characters. If you are successful finding the JS which can do this job for you, you can use [JS Engine|http://help.sap.com/saphelp_nw04/helpdata/en/49/a8e3c8d59811d4b2e90050dadfb92b/frameset.htm] available in ABAP.

Refer to [ABAP & JavaScript|http://help-abap.zevolving.com/2011/10/javascript-in-abap/] to see the simple JS usage.

Regards,

Naimesh Patel

0 Kudos

Naimesh,

I checked the solution you suggested. But I am having issue with place where in which after editing the file i need to return the edited file for download.

Still i reseraching on this.

Rob: I checked EDIT_TEXT this is not showing the hidden characters

Thanks

kesavadas_thekkillath
Active Contributor
0 Kudos

Hi,

REGEX has options like

\p- Matches any character in the named character class specified by . Supported names are Unicode groups and block ranges. For example, Ll, Nd, Z, IsGreek, IsBoxDrawing

:graph: - [Visible characters|http://www.regular-expressions.info/posixbrackets.html] (i.e. anything except spaces, control characters, etc.)

may be you can do a work around using it.

Kesav

Former Member
0 Kudos

Hi AS,

Have you tried to use UTF8 or UTF16 in your open data set? I have encountered these problem before having characters on the donwloaded files. Upon investigation, the two system have different UTF format.

0 Kudos

I have done this also previously

like


* Code page UTF-16LE
encoding = '4103'. 
endian = 'L'.
SHIFT str_utf16 LEFT BY 2 PLACES IN BYTE MODE.  " Remove hidden char

"Code page UTF-16BE
encoding = '4102'. 
endian = 'B'.
SHIFT str_utf16 LEFT BY 2 PLACES IN BYTE MODE.  " Remove hidden char

....
...
CALL METHOD cl_abap_conv_in_ce=>create

....
...
CALL METHOD lr_conv->convert

After doing this also it not removing the hidden characters

0 Kudos

Didn't found any nearby solution, closing the thread as "unanswered"