Solved

help identifying ascii character in string field seperating data

Posted on 2008-09-29
14
772 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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

830 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