Solved

help identifying ascii character in string field seperating data

Posted on 2008-09-29
14
773 Views
Last Modified: 2012-06-27
SAP table ODLN has address field which contains address, city zip, country. There appears to be at leat one ascii character between address and city and one ascii cahracter between zip and country. I  need to determine what characters these are so I can include the appropriate function in Crystal to print the individual components (address1, City Zip) in the address line print. Need help with the function and syntax. Table is odln.address

0
Comment
Question by:johntmcii
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 7
14 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 22598340
Is it always the same character?

Can you show a sample of the data?

mlmcc
0
 

Author Comment

by:johntmcii
ID: 22598640
Please find requested information below
ODLNsample.bmp
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 22599401
As a gues the 2 characters are CR-LF or LF-CR  chr(10) and chr(13)
The single is proably LF - chr(10)

The only way to know for sure would be to search the string in Crystal or a VB app.

mlmcc
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 100

Expert Comment

by:mlmcc
ID: 22599429
Here is a Crystal formula that might do it

Local StrijngVar AsciiRep;
Local StringVar MyString;
Local NumberVar i;

MyString := {YourStringField};
For i := 1 to Length(MyString) do
   AsciiRep := AsciiRep & CStr(ASC(Mid(MyString,i,1),0) & ' ';
AsciiRep

Cut and paste the resukt

mlmccq
0
 

Author Comment

by:johntmcii
ID: 22599969
made changes see attached file; received error when I ran the function (A variable type 'for eaxmple 'number var', is missing)
 
Is the syntax correct on the statement?

mystring1.bmp
0
 

Author Comment

by:johntmcii
ID: 22600388
How would I go about searching the field in Crystal to look for the specific field value as you mentioned earlier which contains some special character or a LF / CR? Please provide example ofthe code.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 22600437
Where did you put the code?

To simply searcxh create a formula like

InStr({SearchString},chr(13))

Put that in the detail sectiion

mlmcc
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 22600446
Bad typingon my part that word cshould be StringVar

No j in it.

mlmcc
0
 

Author Comment

by:johntmcii
ID: 22600530
I put in formula field, named addr1 I found the type, changed it now it says. The ) is missing
0
 

Author Comment

by:johntmcii
ID: 22600572
Mtype on my part too, Should have been typo instead of type
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 22600988
AsciiRep := AsciiRep & CStr(ASC(Mid(MyString,i,1)),0) & ' ';

mlmcc
0
 

Author Comment

by:johntmcii
ID: 22605044
Still getting the same error, I don't see an unpaired )
0
 

Author Comment

by:johntmcii
ID: 22605132
My bad, I fat fingered a change. I found this last night. You were right it is a LF/CR actually two sets between the address line and city state. So how can I fix this?
datafile.bmp
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 22605891
You can use a formula to replace the characters

Replace(Replace({YourField},chr(10),' '),chr(13),' ')

If you only want a single space then replace one with ''

mlmcc
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question