Hi All,
I am trying to close a particular row on a Purchase order. For that I am using the code given below. Instead of closing that particular line , whole document is getting closed. Will anyone suggest me a solution for closing only that particular line.
SAPbobsCOM.Documents oPO = (SAPbobsCOM.Documents)Program.Arc_Com_AddOn.Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseOrders);
bool str = oPO.GetByKey(139));
if (str == true)
{
int inttst;
string strerrMsg;
int intnErr;
oPO.Lines.LineStatus = SAPbobsCOM.BoStatus.bost_Close;
inttst = oPO.Update();
if (inttst != 0)
{
Program.Arc_Com_AddOn.Company.GetLastError(out intnErr, out strerrMsg);
}
}
Hi u have to work with the SetCurrentLine to get the exactly row you want to close, remember the SetCurrentLine starts from zero, if you have 4 lines and want to close line 2:
.SetCurrentLine(Line-1) = 2-1=1
.CloseTheLine
.Update The Object
Try this and answer how this goes for you
Gabriel Mendes
Hello, i''ve the same problem
Script is correct
oPO.Lines.SetCurrentLine(linenum); oPO.Lines.LineStatus = SAPbobsCOM.BoStatus.bost_Close;
and i've allways the message
Update Entry (-2039) Another user-modified table (ODBC -2039)
(PL 45)
Add a comment