2012 Nov 19 7:39 AM
Hi Experts,
I am trying to use GUI_UPLOAD function module in my custom program. My file have
some special characters, which is by default replaced by '#'. But my requirement is to
replace with '?'.
I try to pass '?' instead of '#' in the function module. But still it is returning '#'.
Thanks in Advance.
Srikanth
2012 Nov 20 6:40 AM
Hello Shrikanth,
You can take a look at cl_abap_char_utilities Class , It has most of the formatting characters . And try replacing the Formatting Characters using the same Rest all '#' will remain Intact in such case .
just like REPLACE ALL OCCURANCES OF
CL_ABAP_CHAR_UTILITIES=>CR_LF WITH '?' . and so on...!
Hope this helps .
Anup.
2012 Nov 19 8:15 AM
Hello,
You cannt pass '?' for replacing special characters. Probably you can read file first from GUI_UPLOAD then later replace # with '?'.
Regards,
Deepti
2012 Nov 20 6:16 AM
Hi Deepti,
Thanks for your reply. If i read the internal table which is returned by GUI_UPLOAD by
that time the data is out of my hands. Because in my scenario in material description user
can key in #. (Eg. iphone#5). Where i should not replace with '?'. But there are some
cases where carriage return is treated as special character in excel. I convert my excel
data into a notepad data using macros.Which i use to upload using GUI_UPLOAD.
So, i need to replace that in the function module itself.
Best Regards.
Srikanth
2012 Nov 20 6:49 AM
Hi Srikanth.
The Replacement Character # is for non-convertable characters.. that Means when u have something like this in the Material Description ( Onethird(Symbol) of Carbondioxide) in this symbol place you will get a # symbol.. Example check the below thing
check the symbol by entering the "BC41" in the NLS_TO_SYS Func Mod...
NLS_STRING_CONVERT_TO_SYS
now copy the result symbol (one third A) and enter the same in the NLS_FROM_SYS Func Mod. the result will be BC41.
NLS_STRING_CONVERT_FROM_SYS
These two FMs helps in data conversion..
When you know the fields(Column names in the Excel) are maintained.
Try this... In the File what ever you take use ALSM*EXCEL*ITAB* then the data will come automatically
This will not convert the data..
Hope this helps..
2012 Nov 20 6:40 AM
Hello Shrikanth,
You can take a look at cl_abap_char_utilities Class , It has most of the formatting characters . And try replacing the Formatting Characters using the same Rest all '#' will remain Intact in such case .
just like REPLACE ALL OCCURANCES OF
CL_ABAP_CHAR_UTILITIES=>CR_LF WITH '?' . and so on...!
Hope this helps .
Anup.
2012 Nov 24 4:12 AM
Hi Anup,
Thanks a lot for your reply. Its working. I tried to use
CL_ABAP_CHAR_UTILITIES=>NEWLINE. The attribute newline recognizes the
carriage return.
We can find some sample code in program FDT_XML_2_REPORT.
Best Regards.
Srikanth