Solved

help identifying ascii character in string field seperating data

Posted on 2008-09-29
14
770 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
  • 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
Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 
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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

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…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

803 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