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: 

Long text Field contains "#####'

former_member195421
Participant
0 Kudos

Hi All,

I have a Z field ( Long text field) in a Standard table and value for this field contains "#####' along with the text ( Example : Hello world                  ####### ) .We are using this field in a webdynpro application and customer is complaining about these ### values . ABAP statements ( Replace , Find etc ) not able to recognize these values , even we tried form field , line feed etc from ABAP character utility class .

Then we tried to analyze how these long text getting populated in the table , Customer have another webdynpro application where they are uploading a text file ( tab delimited ) to get the long text  and calling a BAPI to upload the data in the table . Unfortunately we are not able to get the permission to access this application .

During our internal discussions one point came up as there may be a difference in the code pages and SAP system is not able to recognize some characters and keeping these as ####

Is anybody encountered such problems ? please give your thoughts .

Regards,

Ratheesh BS

13 REPLIES 13

Former Member
0 Kudos

Hi,

It looks like problem in difference in code pages.the problem i faced was with a file interface between ECC and a NOn -unicode application. we were writing the file in the sap application server in NON-UNICOCDE mode as the application which pickes up file from the sap application server was non unicode.While doing so certain characters in mat description  ..like '@' were coming as '#' while we are seeing the file in SAP application server.But when the non unicode application reads this file..they were getting the character as '@'  , So there were no issues from the interface perpective...but what i feel is the character '#' is getting is could be a different character but is been compressed or something to appear as a '#'..due to the code page difference...

as you have a Ztable, if you are seeing the table in SE16, still you see this '#' character?

0 Kudos

Hi Sooraj,

Thanks for the information . Yes we can see the # value in SE16 .

Regards,

Ratheesh BS

0 Kudos

hi, Can you try something like this.

Move this value to a chacter field and try using replace all occurrences ... like declaring a filed temp(200) type c and move the long text to this field and use the replace keyword..not sure whether it will help you but just a thought...

0 Kudos

Hi Sooraj,

We tried this , system is not recognizing the ### values .

Regards,

Ratheesh BS

0 Kudos

Hi,

Please check how value of this Z field is filled in the table. Also try to remove ## in from table in debug and see if it is taking ### automatically or coming from where you have written code to populate this field.

Regards

Sachin

former_member195421
Participant
0 Kudos

Hi All,

Now what we are trying is to give a root cause analysis of the problem to the customer instead of going a fix in our application . Now it almost seems to an issue with the code pages , how to ask the customer to check the front end code page ( they are using a text file ) in their application .

Regards,

Ratheesh BS

0 Kudos

Hi Ratheesh,

please have a look at SAP notes

752835 - Usage of the file interfaces in Unicode systems

765763 - Setting the Upload/Download codepage for a SAPGUI connection

This should help if the data is uploaded via SAPGUI ...

My guess is that the files contain special Non-Unicode characters while the system expects UTF-8.

Hence you can either provide the file with UTF-8 encoding (this would be the best solution) or do the upload with Non-Unicode option (using the correct logon language).

Best regards,

Nils Buerckel

former_member189845
Active Participant
0 Kudos

Hi,

It looks like the data that has been written in to the table is not exactly the '#" value. Because in some cases where the user entered characters like space in the file and when it comes to the SAP system it might convert in to the hexadecimal values

Ex: Hexadecimal value of '00' is the Null character,

23 is the '#' character

Thanks,

Siva

Former Member
0 Kudos

This '#' symbol can be symbol of '  CL_ABAP_CHAR_UTILITIES=>NEWLINE' New line char in ABAP.

try to use following code ..

REPLACE ALL OCCURRENCES OF CL_ABAP_CHAR_UTILITIES=>NEWLINE IN lv_str WITH space.

0 Kudos

Chandra Shekhar Agarwal wrote:

This '#' symbol can be symbol of '  CL_ABAP_CHAR_UTILITIES=>NEWLINE' New line char in ABAP.

try to use following code ..

REPLACE ALL OCCURRENCES OF CL_ABAP_CHAR_UTILITIES=>NEWLINE IN lv_str WITH space.

Did you read the question properly? The OP has clearly mentioned -

even we tried form field , line feed etc from ABAP character utility class .

0 Kudos

Oh, i missed that line feed and ABAP character utility class thing.. you can remove my comment, thanks for pointing it out.

anurag_abbi_tm
Participant
0 Kudos

Hi Ratheesh,

I understand the following from your description:

1) Customer uses another application (webdynpro) to upload text file with the help of BAPI And

   you do not have access to that application.

  This means that rectifying source of the problem is not possible. Please correct me if I am wrong.

2) You would like to modify your code in such a way that when you display the contents of the Z field

    on your Webdynpro application then the customer should not see hash character.

3) You wrote that system is unable to recognize the hash character probably because it is some

     junk character.

Option 1:

In case above are true, then I believe that you must use fetch the text that the system does understand.

This means you will have to read character by character for this field and match it to the values

A to Z , 0 to 9 and special characters.

You will easily find a ready made code for this on the internet.

Option 2:

If the customer is using the same SAP system ( and client ) as you are using then you will have access to the BAPI that the customer is calling to upload their text file.

This is a plus point for you since the BAPI then resides in your system.

You may check whether the BAPI has any exits etc. or enhancements.

You can put your code inside the BAPI itself and make your customized code trigger on the condition that it should only be called when the upload functionality is used.

Inside this code you may write your logic to pass only relevant data to SAP system's Z field.

This way source of the problem is rectified.

Regards

Anurag

Former Member
0 Kudos

hi Ratheesh, were you able to find out the fix for this issue? We are encountering the same and would like to know how you managed to remove the # from your text field. Appreciate your feedback.

Thanks,

Raquel