Solved

help identifying ascii character in string field seperating data

Posted on 2008-09-29
14
768 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
Comment Utility
Is it always the same character?

Can you show a sample of the data?

mlmcc
0
 

Author Comment

by:johntmcii
Comment Utility
Please find requested information below
ODLNsample.bmp
0
 
LVL 100

Expert Comment

by:mlmcc
Comment Utility
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
 
LVL 100

Expert Comment

by:mlmcc
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 100

Expert Comment

by:mlmcc
Comment Utility
Bad typingon my part that word cshould be StringVar

No j in it.

mlmcc
0
 

Author Comment

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

Author Comment

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

Expert Comment

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

mlmcc
0
 

Author Comment

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

Author Comment

by:johntmcii
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

762 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now