Link to home
Start Free TrialLog in
Avatar of johntmcii
johntmcii

asked on

help identifying ascii character in string field seperating data

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

Avatar of Mike McCracken
Mike McCracken

Is it always the same character?

Can you show a sample of the data?

mlmcc
Avatar of johntmcii

ASKER

Please find requested information below
ODLNsample.bmp
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
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
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
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.
Where did you put the code?

To simply searcxh create a formula like

InStr({SearchString},chr(13))

Put that in the detail sectiion

mlmcc
Bad typingon my part that word cshould be StringVar

No j in it.

mlmcc
I put in formula field, named addr1 I found the type, changed it now it says. The ) is missing
Mtype on my part too, Should have been typo instead of type
AsciiRep := AsciiRep & CStr(ASC(Mid(MyString,i,1)),0) & ' ';

mlmcc
Still getting the same error, I don't see an unpaired )
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
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial