cancel
Showing results for 
Search instead for 
Did you mean: 

Import and Export variables with same name

Former Member
0 Kudos

The nco3 throws and exception when a function has Import and Export variables with the same name.

An example is BAPI_BATCH_CREATE.

At the moment my solution is create a ZBAPI_BATCH_CREATE that wraps the original BAPI but has diferent names for import and export variables (IBATCH and OBATCH for BATCH variable).

Anyone has another more clean solution?

VB.NET CODE:

pFunct = foRFCDest.Repository.CreateFunction(fsFunctionName)

This is the error message:

SAP.Middleware.Connector.RfcInvalidStateException was unhandled

Message=Lookup of function BAPI_BATCH_CREATE metadata failed for destination SAPTST

Source=sapnco

StackTrace:

en SAP.Middleware.Connector.RfcRepository.LookupFunctionMetadataClassic(String name)

en SAP.Middleware.Connector.RfcRepository.LookupFunctionMetadata(String name)

en SAP.Middleware.Connector.RfcRepository.GetFunctionMetadata(String name)

en SAP.Middleware.Connector.RfcRepository.CreateFunction(String name)

en SapNetConnectorWrapper.FunctionBase..ctor(RfcDestination foDest, String fsFunctionName) en C:00_Compac201101_LibreriasSapNetConnectorWrapperFunctionBase.vb:línea 11

en SapNetConnectorWrapper.BAPIS.Bapi_Batch_Create..ctor(RfcDestination foDest) en C:00_Compac201101_LibreriasSapNetConnectorWrapperBAPISBapi_Batch_Create.vb:línea 16

en clsEtiquetadoTNPCommon.BLLEtiquetadoTNP.CrearLote(DynamicSqlEntity& foRegCabecera, DynamicSqlEntity& foRegNotificacion) en C:00_Compac201100_EtiquetadoTNP_PTEtiquetadoTNP_PTclsEtiquetadoTNPCommonBLLEtiquetadoTNP.vb:línea 515

en clsEtiquetadoTNPCommon.BLLEtiquetadoTNP.CrearLotesPendientes() en C:00_Compac201100_EtiquetadoTNP_PTEtiquetadoTNP_PTclsEtiquetadoTNPCommonBLLEtiquetadoTNP.vb:línea 602

en WAEtiquetadoTNP.Form1.Timer1_Tick(Object sender, EventArgs e) en C:00_Compac201100_EtiquetadoTNP_PTEtiquetadoTNP_PTWAEtiquetadoTNPForm1.vb:línea 25

en System.Windows.Forms.Timer.OnTick(EventArgs e)

en System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)

en System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

en System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)

en System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)

en System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)

en System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)

en System.Windows.Forms.Application.Run(ApplicationContext context)

en Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()

en Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()

en Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)

en WAEtiquetadoTNP.My.MyApplication.Main(String[] Args) en 17d14f5c-a337-4978-8281-53493378c1071.vb:línea 81

en System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)

en System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)

en Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()

en System.Threading.ThreadHelper.ThreadStart_Context(Object state)

en System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)

en System.Threading.ThreadHelper.ThreadStart()

InnerException: SAP.Middleware.Connector.RfcInvalidParameterException

Message=Cannot add BATCH to FUNCTION BAPI_BATCH_CREATE: an element with that name already exists

Source=sapnco

StackTrace:

en SAP.Middleware.Connector.RfcContainerMetadata`1.AddElement(T element)

en SAP.Middleware.Connector.RfcFunctionMetadata.AddParameter(RfcParameterMetadata parameterMetadata)

en SAP.Middleware.Connector.RfcRepository.LookupFunctionMetadataClassic(String name)

InnerException:

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Raul

Even I am getting the same error for below BAPI

Lookup of function BAPI_FAMILY_CREATE metadata failed for destination

Inner Exception: Message "Cannot add EMPLOYEENUMBER to FUNCTION BAPI_FAMILY_CREATE: an element with that name already exists" string

I am using the new NCO 3.0.2.0 x64 version.

Is there any other solution other than creation of Z BAPI.