Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Overloaded method with SAPbouiCOM-Object parameters

Hi!

I've written an overloaded method with the following signatures:

1.

        Public Shared Sub AddCfl( _
            ByRef FormCfls As SAPbouiCOM.ChooseFromListCollection, _
            ByVal LinkedObj As SAPbouiCOM.BoLinkedObject, _
            ByRef CflEtx As SAPbouiCOM.EditText, _
            ByVal CflUidEtx As String, _
            ByVal CflAliasEtx As String, _
            Optional ByRef CflBtn As SAPbouiCOM.Button = Nothing, _
            Optional ByVal CflUidBtn As String = "", _
            Optional ByRef oCons As SAPbouiCOM.Conditions = Nothing _
        )

2.

        Public Shared Sub AddCfl( _
            ByRef FormCfls As SAPbouiCOM.ChooseFromListCollection, _
            ByVal LinkedObj As SAPbouiCOM.BoLinkedObject, _
            ByRef CflBtn As SAPbouiCOM.Button, _
            ByVal CflUidBtn As String, _
            Optional ByRef oCons As SAPbouiCOM.Conditions = Nothing _
        )

3.

        Public Shared Sub AddCfl( _
            ByRef FormCfls As SAPbouiCOM.ChooseFromListCollection, _
            ByVal LinkedObj As SAPbouiCOM.BoLinkedObject, _
            ByRef CflCol As SAPbouiCOM.Column, _
            ByVal CflUidCol As String, _
            ByVal CflAliasCol As String, _
            Optional ByRef oCons As SAPbouiCOM.Conditions = Nothing _
        )

When I try to use the method with first (1.) signature and WITHOUT the optional parameters then I get a very long exception-message: Sth. about "cannot convert into column type".

I guess that .NET is not able to distinguish between signature No 1. and No 3.: Both have the same count of parameters when using No. 1. without the optional param.

But as I understand overloading should also work with the same param.-count as long as the params are of different types, isn't it?

So am I right when saying, that the problem is the COM-Objekt and .NET simply can't distinguish between the types SAPbouiCOM.EditText and SAPbouiCOM.Column?

Thanks for comments!

Roland

Not what you were looking for? View more on this topic or Ask a question