cancel
Showing results for 
Search instead for 
Did you mean: 

NCO 3.0.3.0 :cannot convert String into TIME someone has left this error?

Former Member
0 Kudos

NCO 3.0.3.0 :cannot convert String into TIME

FIELD HOR_REG of STRUCTURE ZST_ESTADO_PE (SETTER): cannot convert String into TIME

My version is 3.0.3.0 and I also get the same message

someone has left this error?

something similar to this post

Edited by: Ademir18 on Nov 17, 2011 9:19 PM

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

What time format is 00 000 5 digit SAP, according to the validation check must be 6

DateTime.ParseExact (value, "hhmmss" DateTimeFormatInfo.CurrentInfo)

How do I change the format that comes in the sap logon?? My Regional Settings on my pc

Here is all the source code for NCO 3.0.3.0 Time

Imports System

Imports System.Globalization

Namespace SAP.Middleware.Connector

Friend Class RfcScalarMetadataTime

Inherits RfcScalarMetadata

Friend Const INITIAL As String = "000000"

Friend Const INITIAL_EXTERNAL As String = "00:00:00"

Public Overrides ReadOnly Property DataType As RfcDataType

Get

Return RfcDataType.TIME

End Get

End Property

Public Overrides ReadOnly Property NucLength As Integer

Get

Return 6

End Get

End Property

Public Overrides ReadOnly Property UcAlignment As Integer

Get

Return 2

End Get

End Property

Public Overrides ReadOnly Property UcLength As Integer

Get

Return 12

End Get

End Property

Friend Sub New()

End Sub

Private Sub CleanUp(ByRef value As String)

' trial

End Sub

Friend Overrides Sub ConvertChar(ByVal value As Char, ByRef currentValue As Object)

' trial

End Sub

Friend Overrides Sub ConvertObject(ByVal value As Object, ByRef currentValue As Object)

' trial

End Sub

Friend Overrides Sub ConvertString(ByVal value As String, ByRef currentValue As Object)

value = value.Trim()

CleanUp(ByRef value)

If (value.Length = 0) OrElse "000000".Equals(value) Then

currentValue = Nothing

Return

End If

If Not value.Equals("240000") Then

Try

DateTime.ParseExact(value, "HHmmss", DateTimeFormatInfo.CurrentInfo)

Catch e As Exception

Throw New RfcTypeConversionException("Cannot convert " + value + " into TIME (HHmmss)", e)

End Try

End If

currentValue = value

End Sub

Friend Overrides Function GetCharArray(ByRef value As Object) As Char()

If Not (value) Is Nothing Then

Return CType(value, string).ToCharArray()

End If

Return "000000".ToCharArray()

End Function

Friend Overrides Function GetString(ByRef value As Object) As String

' trial

Return Nothing

End Function

Friend Overrides Function GetValue(ByRef value As Object) As Object

Return GetString(ByRef value)

End Function

End Class ' class RfcScalarMetadataTime

End Namespace