on 08-04-2006 3:53 AM
Hello All:
Doing a material revaluation pcs which use itemcode, warehouse and new price to update item prices in the warehouse level and couldn't find any sample code. Can anyone help? Thank You! Any direction or documentation will be appreciated.
the _line object doesn't seem to be accessible via DI-API..
Message was edited by: Bo Peng
Hi Bo,
Herewith a sample:
Dim oVal As SAPbobsCOM.MaterialRevaluation
oVal = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oMaterialRevaluation)
oVal.Reference2 = "Test"
oVal.Lines.ItemCode = "XXXXX"
oVal.Lines.WarehouseCode = "02"
oVal.Lines.Price = "1000"
oVal.Lines.RevaluationDecrementAccount = "100000"
oVal.Lines.RevaluationIncrementAccount = "100000"
If oVal.Add <> 0 Then
MessageBox.Show(oCompany.GetLastErrorDescription)
Else
MessageBox.Show("Success")
End If
Hope it helps,
Adele
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank You Adele as always:
However I encountered following error message.
" - The data area passed to a system call is too small.\r\n"
My code is below:
oMR = (SAPbobsCOM.MaterialRevaluation)(global.ocompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oMaterialRevaluation));
oMR.Lines.ItemCode = itemcode;
oMR.Lines.WarehouseCode = whs;
oMR.Lines.Price = price;
try
{
if (oMR.Add() != 0)
{
global.ocompany.GetLastError(out global.interr, out errcode);
if (errcode != "")
<u>global.oapplicaiton.MessageBox(errcode, 1, "OK", "", "");</u> else
global.oapplicaiton.MessageBox("No output error", 1, "OK","","");
}
else
{
global.oapplicaiton.SetStatusBarMessage("Successful", SAPbouiCOM.BoMessageTime.bmt_Short, false);
}
}
catch (Exception ex)
{
global.oapplicaiton.MessageBox(ex.Message, 1, "OK", "", "");
}
Actually in above line with underline lines. I have server thrown an exception! It something like
{"The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))"}
This is very weired. Am I missing something in the parameter? Also, I would like to add new lines under the same oMR before add. Is there a way to do it? Thank You!
Sincerely Yours
Bo Peng
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
99 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.