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
ASKER
Please find requested information below
ODLNsample.bmp
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
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
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)
AsciiRep
Cut and paste the resukt
mlmccq
ASKER
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
Is the syntax correct on the statement?
mystring1.bmp
ASKER
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(1 3))
Put that in the detail sectiion
mlmcc
To simply searcxh create a formula like
InStr({SearchString},chr(1
Put that in the detail sectiion
mlmcc
Bad typingon my part that word cshould be StringVar
No j in it.
mlmcc
No j in it.
mlmcc
ASKER
I put in formula field, named addr1 I found the type, changed it now it says. The ) is missing
ASKER
Mtype on my part too, Should have been typo instead of type
AsciiRep := AsciiRep & CStr(ASC(Mid(MyString,i,1) ),0) & ' ';
mlmcc
mlmcc
ASKER
Still getting the same error, I don't see an unpaired )
ASKER
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
datafile.bmp
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Can you show a sample of the data?
mlmcc