11-08-2011 12:13 PM
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.
a®
11-08-2011 12:20 PM
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)
11-08-2011 1:19 PM
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
a®
11-08-2011 2:17 PM
11-08-2011 2:22 PM
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
11-10-2011 5:00 AM
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
a®
11-10-2011 5:45 AM
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
11-10-2011 5:53 AM
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.
11-10-2011 6:13 AM
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
11-14-2011 7:29 AM
Didn't found any nearby solution, closing the thread as "unanswered"
a®