cancel
Showing results for 
Search instead for 
Did you mean: 

ERROR with BAPI_MATERIAL_SAVEDATA

Former Member
0 Kudos

Dear all,

I have a program in VBA to create new Material thru an Excel file.

When i launch it i have the following error:

"*Key fields for use data STORAGELOCATIONDATA and checkbox structure STORAGELOCATIONDATAX are different"

Here is my code sample :

'-- Declare variable

Dim boArticle As Object

Dim oStorLoc As Object

Dim oStorLocX As Object

'-- Set variable

Set sapConn = CreateObject("SAP.BAPI.1")

...

Set boArticle = sapConn.getSapobject("StandardMaterial")

...

Set oStorLoc = sapConn.DimAs(boArticle, "SaveData", "storagelocationdata")

Set oStorLocX = sapConn.DimAs(boArticle, "SaveData", "storagelocationdatax")

...

'-- Define StorLoc

oStorLoc.Value("PLANT") = "GPF3"

oStorLocX.Value("PLANT") = "GPF3"

...

'-- Create article

boArticle.SaveData Headdata:=oHeader, Storagelocationdata:=oStorLoc, .......

Could you help me ?? I don't know what the error message means ...

Thks

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

edit I was confusing this with SALESDATA

Edited by: Zeblion on Jun 8, 2011 2:19 PM