Skip to Content
author's profile photo Former Member
Former Member

.Net 2.0-VB : Proxy complile error on purchaseorder

I drag purchase order from BOR to SAPProxy1.sapwsdl.

After I build project I got error 2 group as follow :-

1.BAPIRETURNTable is not declared in SAPProxy1.vb.

In this error I changed it to BAPIRET2Table.

2.Key word is not valid as an identifier in :-

-BAPIADDRESS

-BAPIESLL

-BAPIESLLC

This is coding in above BAPI.

Public Property Date As String

Get

Return _Date

End Get

Set(ByVal Value As String)

_Date = Value

End Set

End Property

'Date' is reserved word in VS.Net but data field in

SAP TABLE name is 'DATE'.

Thank you in advance for your help.

Teerakorn

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Dec 02, 2004 at 12:54 PM

    Hello Teerakorn,

    thanks for the information.

    About the second issue first: We can not guarantee that generated code never collides with keywords or other names. Work arround the issue is simple: just customize the names in the .sapwsdl desginer (not in code!) to something different than "Date", e.g. "Date0" or "[Date]". As you might have seen there is already a builtin "auto customizing" for some common keywords like "Return". I will anyway put "Date" on my list for future versions...

    About the first issue: I didn't know that threre is BAPIs that have a BAPIRETURNTable paramter ... now I know, thanks 😊

    Your workarround is likely not working. You can workarround by either turning off BAPI Exception Mapping. If you do so, the proxy generator will create all needed BAPIRET* types. Note that in this case you might have to undo some of the automatic mappings of return parameters to SAPClient's BapiReturn or BapiRetTable.

    Or you add the following class definition somewhere to your project.

    Imports System

    Imports System.Text

    Imports System.Collections

    Imports System.Runtime.InteropServices

    Imports System.Xml.Serialization

    Imports System.Web.Services

    Imports System.Web.Services.Description

    Imports System.Web.Services.Protocols

    Namespace SAP.Connector

    '@ <summary>

    '@ A typed collection of BAPIRETURN elements.

    '@ </summary>

    <Serializable> _

    Public Class BAPIRETURNTable

    Inherits SAPTable

    '@ <summary>

    '@ Returns the element type BAPIRETURN.

    '@ </summary>

    '@ <returns>The type BAPIRETURN.</returns>

    Public Overloads Overrides Function GetElementType() As Type

    Return GetType(BAPIRETURN)

    End Function

    '@ <summary>

    '@ Creates an empty new row of type BAPIRETURN.

    '@ </summary>

    '@ <returns>The newBAPIRETURN.</returns>

    Overrides Public Function CreateNewRow() As Object

    Return new BAPIRETURN()

    End Function

    '@ <summary>

    '@ The indexer of the collection.

    '@ </summary>

    Default Public Property Item(ByVal Index As Integer) As BAPIRETURN

    Get

    Return CType(List(Index), BAPIRETURN)

    End Get

    Set(ByVal Value As BAPIRETURN)

    List(Index) = Value

    End Set

    End Property

    '@ <summary>

    '@ Adds a BAPIRETURN to the end of the collection.

    '@ </summary>

    '@ <param name="value">The BAPIRETURN to be added to the end of the collection.</param>

    '@ <returns>The index of the newBAPIRETURN.</returns>

    Public Function Add(ByVal Value As BAPIRETURN) As Integer

    Return List.Add(Value)

    End Function

    '@ <summary>

    '@ Inserts a BAPIRETURN into the collection at the specified index.

    '@ </summary>

    '@ <param name="index">The zero-based index at which value should be inserted.</param>

    '@ <param name="value">The BAPIRETURN to insert.</param>

    Public Sub Insert(ByVal Index As Integer, ByVal Value As BAPIRETURN)

    List.Insert(Index, value)

    End Sub

    '@ <summary>

    '@ Searches for the specified BAPIRETURN and returnes the zero-based index of the first occurrence in the collection.

    '@ </summary>

    '@ <param name="value">The BAPIRETURN to locate in the collection.</param>

    '@ <returns>The index of the object found or -1.</returns>

    Public Function IndexOf(ByVal Value As BAPIRETURN) As Integer

    Return List.IndexOf(value)

    End Function

    '@ <summary>

    '@ Determines wheter an element is in the collection.

    '@ </summary>

    '@ <param name="value">The BAPIRETURN to locate in the collection.</param>

    '@ <returns>True if found; else false.</returns>

    Public Function Contains(ByVal Value As BAPIRETURN) As Boolean

    Return List.Contains(value)

    End Function

    '@ <summary>

    '@ Removes the first occurrence of the specified BAPIRETURN from the collection.

    '@ </summary>

    '@ <param name="value">The BAPIRETURN to remove from the collection.</param>

    Public Sub Remove(ByVal Value As BAPIRETURN)

    List.Remove(value)

    End Sub

    '@ <summary>

    '@ Copies the contents of the BAPIRETURNTable to the specified one-dimensional array starting at the specified index in the target array.

    '@ </summary>

    '@ <param name="array">The one-dimensional destination array.</param>

    '@ <param name="index">The zero-based index in array at which copying begins.</param>

    Public Sub CopyTo(ByVal Array() As BAPIRETURN, ByVal Index As Integer)

    List.CopyTo(array, index)

    End Sub

    End Class

    End Namespace

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.