on 10-24-2013 1:19 PM
Hi Experts,
How to Auto select Batch Through SDK Code ? my stock is managed by batch i need to set autoselect batch while Issue from production.
SAPbobsCOM.Documents oIssue;
oIssue = clsAddOn.LDNA_Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInventoryGenExit);
oIssue.Lines.SetCurrentLine(0);
oIssue.DocType = SAPbobsCOM.BoDocumentTypes.dDocument_Items;
while (!ldna_Rec.EoF)
{
if (ldna_Rec.Fields.Item("ItemCode").Value == oMat3.Columns.Item("V1").Cells.Item(i).Specific.value)
{
BubbleEvent = false;
VaccQnty = Convert.ToDouble(oMat3.Columns.Item("V5").Cells.Item(i).Specific.value);
oIssue.Lines.BaseEntry = ldna_Rec.Fields.Item("DocEntry").Value;
oIssue.Lines.BaseType = 202;
oIssue.Lines.BaseLine = ldna_Rec.Fields.Item("LineNum").Value;
oIssue.Lines.Quantity = VaccQnty;
oIssue.Lines.Add();
break;
}
ldna_Rec.MoveNext();
}
oIssue.Add()
- Thanks and regards
Vikas
Hi,
My Items is manual Not BackFlush. so i need to set batch via code. please tell me how to do through SDK code.
- Thanks
Vikas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hai,
Herewith with I have mentioned the Sample Code for this, Please Check it.
Dim ManBtchNum = getSingleValue("Select ManBtchNum from OITM Where ItemCode='" & oMatrix4.GetCellSpecific("ItemCode", i).Value & "'") |
LogInfo("RM " & i & " Batch No Declaration Start : " & Date.Now, "E") |
If ManBtchNum.Trim <> "N" Then |
Dim strSql = "select isnull(SUM(isnull(U_Qty,0)),0) Qty from [@SHJ_MR_OPT2] OPT2, " & _ | |
" [@SHJ_MR_OOPT] OOPT where OOPT.DocEntry = OPT2.DocEntry " & _ | |
" and OOPT.U_IndNo ='" & IndentNo & "' and OPT2.U_ItemCode ='" & oMatrix4.GetCellSpecific("ItemCode", i).Value & "' " |
Dim UsedQty = getSingleValue(strSql) | ||
Dim CrrQty = oMatrix4.GetCellSpecific("Qty", i).Value | ||
'If (IssueNo = "") Then | ||
' | IssueNo = "''" |
'End If | |
Dim rs As SAPbobsCOM.Recordset = DoQuery("Select BatchNum , Quantity from IBT1 where BaseType = 67 and Direction = 0 and BaseNum in (" & _ | |
IssueNo & ") and ItemCode= '" & oMatrix4.GetCellSpecific("ItemCode", i).Value & "' ") |
For k As Integer = 0 To rs.RecordCount - 1 |
Dim n As Double = CDbl(rs.Fields.Item("Quantity").Value) | |
If n >= UsedQty Then | |
n = n - UsedQty | |
UsedQty = 0 | |
Else | |
UsedQty = UsedQty - n | |
rs.MoveNext() | |
Continue For | |
End If |
If n >= CrrQty Then | |
v_StockExit.Lines.BatchNumbers.BatchNumber = rs.Fields.Item("BatchNum").Value | |
v_StockExit.Lines.BatchNumbers.Quantity = CrrQty | |
v_StockExit.Lines.BatchNumbers.Add() | |
Exit For | |
ElseIf n > 0 Then | |
v_StockExit.Lines.BatchNumbers.BatchNumber = rs.Fields.Item("BatchNum").Value | |
v_StockExit.Lines.BatchNumbers.Quantity = n | |
v_StockExit.Lines.BatchNumbers.Add() | |
CrrQty = CrrQty - n | |
End If |
''Keep the connection alive by clicking label - By Parthiban | |
'frmOperationTransfer.Items.Item("t_hid").Specific.value = k.ToString.Trim |
rs.MoveNext() | |
LogInfo("Detail Item End : " & intStockRowCount, "E") | |
Next |
rs = Nothing |
Regards,
K Sakthivel
Hi,
On Item master data, there is a setting Issue method, select Backflush.
Then you wont need to provide Batch Number through SDK.
Regards,
Amrut Sabnis
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.