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

Hash tag in string

Former Member
0 Likes
5,998

Hi,

I'm having trouble with a material description. In transaction MM03 the description is: "SSM 12 x 30 Brake Assm#Wabco 385M Rebui

I create a txt file using OPEN DATASET listing the material descriptions, but when I use TRANSFER "SSM 12 x 30 Brake Assm#Wabco 385M Rebui

it gets split in two lines:

line 1: "SSM 12 x 30 Brake Assm

line 2: Wabco 385M Rebui


How can I prevent splitting and respect hashtag in the string?



Thanks in advanced,

Jonathan

Message was edited by: Matthew Billingham - don't have subject in ALL CAPITALS please.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,287

I'd bet my last dollar that the hex code of that hash tag is either 0A or 0D.  The reason being is that SAP displays non-printable characters as '#' and if that field was populated by a program of some sort there is a good possibility that two lines were merged together.

Look at the string value in hex,  (if it's a unicode system allow 4 diigts per character) and look for 000D or 000A  making sure that you count on character boundaries.

If it is CR or LF then you have corrupt master data.

Regards

Rich

Hi,

I'm having trouble with a material description. In transaction MM03 the description is: "SSM 12 x 30 Brake Assm#Wabco 385M Rebui

I create a txt file using OPEN DATASET listing the material descriptions, but when I use TRANSFER "SSM 12 x 30 Brake Assm#Wabco 385M Rebui

it gets split in two lines:

line 1: "SSM 12 x 30 Brake Assm

line 2: Wabco 385M Rebui


How can I prevent splitting and respect hashtag in the string?



Thanks in advanced,

Jonathan

Message was edited by: Matthew Billingham - don't have subject in ALL CAPITALS please.

3 REPLIES 3
Read only

Former Member
0 Likes
3,287

There is no hashtag in your string, there is a newline character in it. Since this is a special character SAP displays it as a hashtag as it does with all characters it cannot display. Look at the hex representation of the value and you'll find 0x0A or 0x0D for the '#' instead of 0x23.

Best solution would be to clean up the data, i.e. remove all special characters from the material descriptions. Other solution for you right now would be to remove special characters before you do the transfer.

Read only

Former Member
0 Likes
3,288

I'd bet my last dollar that the hex code of that hash tag is either 0A or 0D.  The reason being is that SAP displays non-printable characters as '#' and if that field was populated by a program of some sort there is a good possibility that two lines were merged together.

Look at the string value in hex,  (if it's a unicode system allow 4 diigts per character) and look for 000D or 000A  making sure that you count on character boundaries.

If it is CR or LF then you have corrupt master data.

Regards

Rich

Read only

Former Member
3,287

Thank you guys, You were right the master data was corrupted. I solved it this way:

REPLACE ALL OCCURRENCES OF cl_abap_char_utilities=>newline IN <fs_vbak>-maktx WITH space.

REPLACE ALL OCCURRENCES OF cl_abap_char_utilities=>cr_lf      IN <fs_vbak>-maktx WITH space.

Regards,

Jonathan