Application Development and Automation 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: 
Read only

How to replace '#' with '?' for Replacement Field in GUI_UPLOAD Function module

Former Member
0 Likes
1,158

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

1 ACCEPTED SOLUTION
Read only

anup_deshmukh4
Active Contributor
0 Likes
853

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.

5 REPLIES 5
Read only

Former Member
0 Likes
853

Hello,

You cannt pass '?' for replacing special characters. Probably you can read file first from GUI_UPLOAD then later replace # with '?'.

Regards,

Deepti

Read only

0 Likes
853

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

Read only

Venkat_Sesha
Product and Topic Expert
Product and Topic Expert
0 Likes
853

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..

Read only

anup_deshmukh4
Active Contributor
0 Likes
854

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.

Read only

Former Member
0 Likes
853

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