CFL Error
Hai To All,
Iam customizing SAP Screen say for example "Issue for Production" Iam filtering Account Code CFL be executing some query.......While running my code i had some error
XML 'Conditions' parsing failed 66000-116.Invalid alias 'AcctCode' for table 'OITM'
Here is my code
Sub LoadGLCFL(ByVal FormUID As String, ByVal CFL_ID As String)
Dim oCFL1 As SAPbouiCOM.ChooseFromList
Dim oCons As SAPbouiCOM.Conditions
Dim oCon As SAPbouiCOM.Condition
Dim emptyCon As New SAPbouiCOM.Conditions
IOP_Form = app.Forms.Item(FormUID)
oCFL1 = app.Forms.Item(FormUID).ChooseFromLists.Item(CFL_ID)
oCFL1.SetConditions(emptyCon)
oCons = oCFL1.GetConditions()
oCon = oCons.Add()
Dim rec As SAPbobsCOM.Recordset = cmp.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
rec.DoQuery("select AcctCode,AcctName from OACT where AcctCode not in(select U_glacc from [@GLACC_HEAD] where U_hide='y')")
oCFL1.SetConditions(emptyCon)
oCons = oCFL1.GetConditions()
For i As Integer = 1 To rec.RecordCount
If i = (rec.RecordCount) Then
oCon = oCons.Add()
oCon.Alias = "AcctCode"
oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
oCon.CondVal = CStr(rec.Fields.Item(0).Value)
Else
oCon = oCons.Add()
oCon.Alias = "AcctCode"
oCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
oCon.CondVal = CStr(rec.Fields.Item(0).Value)
oCon.Relationship = SAPbouiCOM.BoConditionRelationship.cr_OR
End If
rec.MoveNext()
Next
oCFL1.SetConditions(oCons)
IOP_Form.Update()
IOP_Form.Refresh()
End Sub
Can anyone help me..........Its so urgent....
Regards,
Anitha
Hi ani
I think you are using Items List CFL and applying conditions of AcctCode of OACT on OITM table but the AcctCode column does not exist for OITM thats why it is giving the error
You have to change CFL object to G/L accounts object code
Regards,
Atul.
Similar Messages
-
Hi Expert,
I am working on V.b 6.0 SDK.
Getting Error on CFL Code BAD Value at the time of Assigning value to the text box.
Explain me How to give parameters to the CFL.
Thanx
DhanrajBelow are the cfl code getting error of Bad Value
If FormUID = "IINC" Then
If pVal.EventType = SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST Then
Dim oCFLEvento1 As SAPbouiCOM.ChooseFromListEvent
Dim Ival2, Ival1 As String
Set oCFLEvento1 = pVal
Dim IsCFL_ID As String
IsCFL_ID = oCFLEvento1.ChooseFromListUID
Dim IoForm As SAPbouiCOM.Form
'oForm = New SAPbouiCOM.Form
Set IoForm = Soft_Application.Forms.Item(FormUID)
Dim IoCFL As SAPbouiCOM.Choosefromlist
Set IoCFL = IoForm.ChooseFromLists.Item(IsCFL_ID)
If oCFLEvento1.BeforeAction = False Then
Dim IoDataTable As SAPbouiCOM.DataTable
Set IoDataTable = oCFLEvento1.SelectedObjects
Ival2 = IoDataTable.GetValue(0, 0)
Ival1 = IoDataTable.GetValue(1, 0)
If (pVal.ItemUID = "txtIncod") Or (pVal.ItemUID = "btnCardCd") And pVal.EventType = SAPbouiCOM.BoEventTypes.et_CLICK Then 'Customer Code CFL
Set Soft_Form = Soft_Application.Forms.Item("IINC")
Soft_Form.Items.Item("txtIncod").Specific.Value = Ival2
Soft_Form.Items.Item("txtInName").Specific.Value = Ival1
End If
End If
End If
End If
On text box property given following values.
Alias:-U_IntCd
Table Name:-@INT_INC
Databound=true -
How to set the returned value of CFL in a matrix
dear all,
I got a matrix binded to a DataSource and two CFLs are in this matrix. The codes for handling AfterChooseFromList is as following. It works almost fine. But when a docoment containing more than two
rows in the matrix and I reselect the CFL cell values more than two times, an error occured sometimes, not everytime. The error message is "This entry already exists in the following tables @CYW_PRROW [Message 131-183]"
I have tried to find out what kind of situation to cause this error, but still in the mud.
Can anybody give me some suggestion? Thanks.
Public Sub OnAfterChooseFromList_Matrix(ByVal pVal As SAPbouiCOM.ItemEvent)
Dim ActionSuccess As Boolean = pVal.ActionSuccess
Dim oform As SAPbouiCOM.Form = SBO_Application.Forms.Item(pVal.FormUID)
Dim oitem As SAPbouiCOM.Item = oform.Items.Item("mtx_0")
Dim omatrix As SAPbouiCOM.Matrix = CType(oitem.Specific, SAPbouiCOM.Matrix)
Dim oDataTable As SAPbouiCOM.DataTable
oDataTable = pVal.SelectedObjects
Dim val As String
Try
val = oDataTable.GetValue(0, 0)
Catch ex As Exception
End Try
omatrix.GetLineData(pVal.Row)
oform.DataSources.DBDataSources.Item("@CYW_PRROW").Offset = pVal.Row - 1
If pVal.ColUID = "col_0" Then
Try
oform.DataSources.DBDataSources.Item("@CYW_PRROW").SetValue("U_PRItemCode", pVal.Row - 1, CStr(val))
Catch ex As Exception
SBO_Application.MessageBox(ex.Message)
End Try
Else
Try
oform.DataSources.DBDataSources.Item("@CYW_PRROW").SetValue("U_PRSupp", pVal.Row - 1, CStr(val))
Catch ex As Exception
SBO_Application.MessageBox(ex.Message)
End Try
End If
omatrix.SetLineData(pVal.Row)
If pVal.FormMode = "1" Then
oform.Mode = SAPbouiCOM.BoFormMode.fm_UPDATE_MODE
End If
End Sub
Another quesion, can I assign the returned value of CLF directly to the cell?Hello Chao-Yi Wu,
I don't have a real solution for you - just a few comments:
1. At
Try
val = oDataTable.GetValue(0, 0)
Catch ex As Exception
End Try
I would add
Try
if oDataTable Is Nothing Then Exit Sub ' If the User cancels the CFL
val = oDataTable.GetValue(0, 0)
Catch ex As Exception
End Try
2. At
If pVal.ColUID = "col_0" Then
I would make the branch by the pVal.ChooseFromListUID instead of the ColUID
and the 2nd not with "Else" but with "Else If ....."
3. It may work with EditText.String/Value of a cell but I never do that because of performance-reasons.
I always do it the same way as you in principle - I don't really know what the problem is.
4. Maybe some unique indexes on your table (although this should give an error at the update and not at CFL when "the unique-law is broken"...)?
Sorry - that's all for the moment.
Cheers,
Roland -
Hi
If anyone can let me know why there is a problem with the following code. I get the following errors:
')' or ',' expectedSorry I did add in but it did not post....Anyway code below the erroe line are in bold. Line: 22,23 & 24.
function scaleMovieClip(movieclip, seconds, startAtX, endAtX, startAtY, endAtY, trans)
new mx.transitions.Tween(movieclip, "_yscale", trans, startAtY, endAtY, seconds, true);
var _loc2 = new mx.transitions.Tween(movieclip, "_xscale", trans, startAtX, endAtX, seconds, true);
} // End of the function
function setPage()
btnN = ["b" + prod];
page = btnN;
pageT.text = page;
ptest.text = mypage;
var mcTween = new mx.transitions.Tween(main, "_alpha", mx.transitions.easing.Strong.easeOut, 100, 0, 1.000000E-001, true);
mcTween.onMotionFinished = function (ev)
main.gotoAndStop(page);
var _loc1 = new mx.transitions.Tween(main, "_alpha", mx.transitions.easing.Strong.easeOut, 0, 100, 3, true);
for (i = 0; i < prodArray.length; i++)
bNum = i + 1;
eval("["b" + bNum]")._xscale = 100;
eval("["b" + bNum]")._yscale = 100;
eval("["b" + bNum]").enabled = true;
} // end of for
eval("[page]").swapDepths(_root.getNextHighestDepth());
quote1.removeMovieClip();
eval("[page]").enabled = false;
eval("[page]")._xscale = 120;
eval("[page]")._yscale = 120;
} // End of the function
stop();
prodArray = new Array("CFL Change-Over", "Showerheads", "Insulation", "Solar PV", "Solar Hot Water", "Tank to Toilet", "Heat Pumps", "Misc Hot Water");
b1.onRollOver = b2.onRollOver = b3.onRollOver = b4.onRollOver = b5.onRollOver = b6.onRollOver = b7.onRollOver = b8.onRollOver = function ()
scaleMovieClip(this, 1, 100, 120, 100, 120, mx.transitions.easing.Strong.easeOut);
attachMovie("quote", "quote1", _root.getNextHighestDepth());
quote1._x = -300;
quote1._x = _xmouse + 10;
quote1._y = _ymouse + 35;
trace (_xmouse);
if (_xmouse <= 130)
quote1.gotoAndStop(2);
quote1._x = _xmouse;
quote1._y = _ymouse + 35;
} // end if
if (_xmouse >= 790)
quote1.gotoAndStop(3);
quote1._x = _xmouse + 10;
quote1._y = _ymouse + 35;
} // end if
quote1.startDrag(lockcenter);
btnN = this._name;
item = btnN.substr(btnN.length - 1, btnN.length) - 1;
myMsg = prodArray[item];
quote1.msg = myMsg;
b1.onRollOut = b2.onRollOut = b3.onRollOut = b4.onRollOut = b5.onRollOut = b6.onRollOut = b7.onRollOut = b8.onRollOut = function ()
scaleMovieClip(this, 1, 120, 100, 120, 100, mx.transitions.easing.Strong.easeOut);
quote1.removeMovieClip();
b1.onRelease = b2.onRelease = b3.onRelease = b4.onRelease = b5.onRelease = b6.onRelease = b7.onRelease = b8.onRelease = function ()
btnN = this._name;
item = btnN.substr(btnN.length - 1, btnN.length) - 1;
page = btnN;
var mcTween = new mx.transitions.Tween(main, "_alpha", mx.transitions.easing.Strong.easeOut, 100, 0, 1.000000E-001, true);
mcTween.onMotionFinished = function (ev)
main.gotoAndStop(page);
var _loc1 = new mx.transitions.Tween(main, "_alpha", mx.transitions.easing.Strong.easeOut, 0, 100, 3, true);
for (i = 0; i < prodArray.length; i++)
bNum = i + 1;
eval("["b" + bNum]")._xscale = 100;
eval("["b" + bNum]")._yscale = 100;
eval("["b" + bNum]").enabled = true;
} // end of for
this.swapDepths(_root.getNextHighestDepth());
quote1.removeMovieClip();
this.enabled = false;
this._xscale = 120;
this._yscale = 120;
if (prod != "" || prod != null)
prodTxt.text = prod;
setPage();
} // end if -
How to fetch PO Line Item in CFL
Dear All,
In my screen i have two fields in header of the screen that is PO NO and Po line item
i fetch the PO No using CFL and its object type
But am not getting PO line item using CFL but i need to select one of the line item from listed CFL
How to do that
Regards,
GuruDear Vasu,
you are exactly right When am selecting the filed again it shows an error in the matrix data source(following Bolded Line),
Private Sub AddValuesToMatrixFromCRL(ByRef ProdNo As String)
Try
oForm = SBO_Application.Forms.Item("FormEditor")
oMatrix = oForm.Items.Item("47").Specific
oMatrix.FlushToDataSource()
oMatrix.Clear()
oForm.DataSources.DataTables.Add("DATA")
oForm.DataSources.DataTables.Item("DATA").ExecuteQuery("SELECT T1.[Code], T1.[Quantity], T1.[Price], T1.[Warehouse], T1.[Uom] FROM OITT T0 INNER JOIN ITT1 T1 ON T0.Code = T1.Father WHERE T0.[Code] = '" & ProdNo & "'")
oMatrix.Columns.Item("V_1").DataBind.Bind("DATA", "Code")
oMatrix.Columns.Item("V_3").DataBind.Bind("DATA", "Uom")
oMatrix.Columns.Item("V_4").DataBind.Bind("DATA", "Price")
oMatrix.Columns.Item("V_14").DataBind.Bind("DATA", "Quantity")
oMatrix.Columns.Item("V_9").DataBind.Bind("DATA", "Warehouse")
oMatrix.Clear()
oMatrix.LoadFromDataSource()
oMatrix.AutoResizeColumns()
Regards,
Guru
Edited by: Vijay Guru on Apr 21, 2009 7:59 AM -
CFL for user defined object in matrix
I am creating CFL for city .For this I created a user defined table and later registred it to create the object of City.I created the CFL for City as ,
Private Sub AddCFL()
Dim intI As Integer
Dim objCFLsName As SAPbouiCOM.ChooseFromListCollection
Dim objParaName As SAPbouiCOM.ChooseFromListCreationParams
Dim objCFLName As SAPbouiCOM.ChooseFromList
Dim objCons As SAPbouiCOM.Conditions
Dim objCon As SAPbouiCOM.Condition
Try
objForm = SBO_Application.Forms.ActiveForm
For intI = 0 To objForm.DataSources.UserDataSources.Count - 1
If objForm.DataSources.UserDataSources.Item(intI).UID = "CityName" Then
Exit Sub
End If
Next
objForm.DataSources.UserDataSources.Add("CityName", SAPbouiCOM.BoDataType.dt_SHORT_TEXT)
objCFLsName = objForm.ChooseFromLists
objParaName = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams)
objParaName.MultiSelection = False
objParaName.UniqueID = "CFL"
objParaName.ObjectType = "City"
objCFLName = objCFLsName.Add(objParaName)
objCons = objCFLName.GetConditions
objCon = objCons.Add
objCon.Alias = "U_Active"
objCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
objCon.CondVal = "Y"
objCFLName.SetConditions(objCons)
Catch ex As Exception
SBO_Application.MessageBox("AddCFL()=" & ex.Message)
End Try
End Sub
I want to load city names in matrix using this cfl.For this, I added few blank rows in matrix.Then I binded the matrix as ,
Private Sub BindMatrix()
Dim objColumns As SAPbouiCOM.Columns
Dim objColumn As SAPbouiCOM.Column
Dim matDetails As SAPbouiCOM.Matrix
objColumn = objColumns.Item("CityName")
objColumn.DataBind.SetBound(True, "", "CityName")
objColumn.ChooseFromListUID = "CFL"
objColumn.ChooseFromListAlias = "CityName"
objColumn.Editable = True
matDetails.LoadFromDataSource()
End Sub
Problem is created by ChooseFromListAlias .It gives error as,
Data Source - Alias Not Found
If I remove that statement, the cfl fires when I press tab in the matrix.But I can not set value in the matrix.I created CFL as,
Private Sub AddCFL()
Dim intI As Integer
Dim objCFLsName As SAPbouiCOM.ChooseFromListCollection
Dim objParaName As SAPbouiCOM.ChooseFromListCreationParams
Dim objCFLName As SAPbouiCOM.ChooseFromList
Dim objCons As SAPbouiCOM.Conditions
Dim objCon As SAPbouiCOM.Condition
Try
objForm = SBO_Application.Forms.ActiveForm
For intI = 0 To objForm.DataSources.UserDataSources.Count - 1
If objForm.DataSources.UserDataSources.Item(intI).UID = "CityName" Then
Exit Sub
End If
Next
objForm.DataSources.UserDataSources.Add("CityName", SAPbouiCOM.BoDataType.dt_SHORT_TEXT)
objCFLsName = objForm.ChooseFromLists
objParaName = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams)
objParaName.MultiSelection = False
objParaName.UniqueID = "CFL"
objParaName.ObjectType = "City"
objCFLName = objCFLsName.Add(objParaName)
objCons = objCFLName.GetConditions
objCon = objCons.Add
objCon.Alias = "U_Active"
objCon.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
objCon.CondVal = "Y"
objCFLName.SetConditions(objCons)
Catch ex As Exception
SBO_Application.MessageBox("AddCFL()=" & ex.Message)
End Try
End Sub
Private Sub BindMatrix()
Dim objColumns As SAPbouiCOM.Columns
Dim objColumn As SAPbouiCOM.Column
Dim matDetails As SAPbouiCOM.Matrix
Try
If SBO_Application.Forms.ActiveForm.UniqueID = "TourDetails" Then
matDetails = SBO_Application.Forms.ActiveForm.Items.Item("matDetails").Specific
Else
matDetails = objForm.Items.Item("matDetails").Specific
End If
objColumns = matDetails.Columns
objColumn = objColumns.Item("#")
objColumn.DataBind.Bind("objDT", "#")
objColumn.Editable = False
objColumn = objColumns.Item("CityName")
'If strPara = "Edit" Then
objColumn.DataBind.Bind("objDT", "CityName")
'Else
' objColumn.DataBind.SetBound(True, "", "CityName")
'End If
objColumn.ChooseFromListUID = "CFL"
'objColumn.ChooseFromListAlias = "CityName"
objColumn.Editable = True
objColumn.Width = 290
objColumn = objColumns.Item("NoOfVisits")
objColumn.DataBind.Bind("objDT", "NoOfVisits")
objColumn.Editable = True
objColumn = objColumns.Item("FromDate")
objColumn.DataBind.Bind("objDT", "FromDate")
objColumn.Editable = True
objColumn.Width = 80
objColumn = objColumns.Item("ToDate")
objColumn.DataBind.Bind("objDT", "ToDate")
objColumn.Editable = True
objColumn.Width = 80
matDetails.LoadFromDataSource()
Catch ex As Exception
SBO_Application.MessageBox("BindMatrix()=" & ex.Message)
End Try
End Sub
Edited by: Dilip Kumbhar on Mar 31, 2010 10:02 AM -
Error : Contract does not match customer and item information[OSCI.ManufSN]
I need to add Service Call from Service Contract through DIAPI. "Mfr. Serial no" is set as "Unique serial no by" in system general settings.
Creating two Customer Equipment Card from the cfl provided on Service Contract in Item Tab and Internal serial is blank in created Cutomer Equipment Card.
One is terminated and other is active have the same ItemCode but different customers then while adding Service Contract I am paraller generating service call through DIAPI but the system is throughing error - "Contract does not match customer and item information [OSCL.IntrnalSN]"
Thanks
deepak gaurHI,
Service Contract can be for a specific customer
The contract type cound be (Coverage):
1. including all items (Type Customer) in this case the dates of the coverage is defined in the head!
2. Including specific serial numbers
3. Including item groups
The status every case should have to be Enabled/Approved for valid contract (OCRT.Status = 'A').
In case of Do not forget to set the valid from and valid to dates to define in the system the coverage. (header and items tab from/to dates)
Now, If you create service all, the system will use the first possible Service Contract. IF you have more: you have to select the contract manually.
Ex:
1. One for customer including all items
2. One for a specific serial number
Best Regadrs,
János -
Hi expert , cfl problem in matrix
Hi friend,
i am added two cfl in user form but first cfl working fine but when i using second cfl it bind same value in the seconf row also.
Regards
Rajkumar Guptathanks for reply
ElseIf (pVal.ItemUID = "38") And (pVal.ColUID = "ItemCode") And pVal.EventType = SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST Then
Dim oCFLEvento As SAPbouiCOM.IChooseFromListEvent
oCFLEvento = pVal
Dim sCFL_ID As String
sCFL_ID = oCFLEvento.ChooseFromListUID
Dim oForm As SAPbouiCOM.Form
oForm = SBO_Application.Forms.Item(FormUID)
Dim oCFL As SAPbouiCOM.ChooseFromList
oCFL = oForm.ChooseFromLists.Item(sCFL_ID)
If oCFLEvento.BeforeAction = False Then
Dim oDataTable As SAPbouiCOM.DataTable
oDataTable = oCFLEvento.SelectedObjects
If oDataTable Is Nothing Then
Exit Sub
End If
Dim Code As String = ""
Dim Name As String = ""
Dim cflValBefore As String = ""
Dim i As Integer = 0
Code = oDataTable.GetValue(0, 0)
Name = oDataTable.GetValue(1, 0)
Try
' If (pVal.ItemUID = "38") And (pVal.ColUID = "ItemCode") Then
oMatrix = oForm.Items.Item("38").Specific
For i = 0 To oDataTable.Rows.Count - 1
'cflValBefore = oForm.DataSources.DBDataSources.Item(0).GetValue("U_itemCode", oForm.DataSources.DBDataSources.Item(1).Offset)
oForm.DataSources.DBDataSources.Item(1).SetValue("U_itemCode", oForm.DataSources.DBDataSources.Item(1).Offset, oDataTable.GetValue("ItemCode", 0))
oForm.DataSources.DBDataSources.Item(1).SetValue("U_ItemDec", oForm.DataSources.DBDataSources.Item(1).Offset, oDataTable.GetValue(1, 0))
'oForm.DataSources.DBDataSources.Item(1).SetValue("U_BOM", oForm.DataSources.DBDataSources.Item(1).Offset, oDataTable.GetValue("ItemCode", 0))
'oForm.DataSources.DBDataSources.Item(1).SetValue("U_ProdO", oForm.DataSources.DBDataSources.Item(1).Offset, oDataTable.GetValue("ItemCode", 0))
cflValBefore = oForm.DataSources.DBDataSources.Item(1).GetValue("U_itemCode", oForm.DataSources.DBDataSources.Item(1).Offset)
If oForm.Mode <> SAPbouiCOM.BoFormMode.fm_ADD_MODE Then
If cflValBefore <> oForm.DataSources.DBDataSources.Item(1).GetValue("U_itemCode", oForm.DataSources.DBDataSources.Item(1).Offset) Then oForm.Mode = SAPbouiCOM.BoFormMode.fm_UPDATE_MODE
If cflValBefore <> oForm.DataSources.DBDataSources.Item(1).GetValue("U_ItemDec", oForm.DataSources.DBDataSources.Item(1).Offset) Then oForm.Mode = SAPbouiCOM.BoFormMode.fm_UPDATE_MODE
End If
''For Bom
If Trim(cflValBefore) <> "" Then
If CheckBOM(Trim(cflValBefore)) = True Then
oForm.DataSources.DBDataSources.Item(1).SetValue("U_BOM", oForm.DataSources.DBDataSources.Item(1).Offset, CStr(oDataTable.GetValue("ItemCode", 0)))
Else
oForm.DataSources.DBDataSources.Item(1).SetValue("U_BOM", oForm.DataSources.DBDataSources.Item(1).Offset, "")
ItemcodeProduction = cflValBefore
End If
End If
''For Production Order
If Trim(cflValBefore) <> "" And Docnum <> "" Then
Dim check As String = CheckPO(Trim(cflValBefore), Docnum)
If check <> "" Then
oForm.DataSources.DBDataSources.Item(1).SetValue("U_ProdO", oForm.DataSources.DBDataSources.Item(1).Offset, CStr(check))
Else
oForm.DataSources.DBDataSources.Item(1).SetValue("U_ProdO", oForm.DataSources.DBDataSources.Item(1).Offset, "")
ItemcodeProduction = cflValBefore
End If
End If
oMatrix.SetLineData(pVal.Row)
Next
' End If
' SetInitialDataWorkOrder()
Catch ex As Exception
'MsgBox(ex.Message)
ShowErrMsg(" Event Error et_CHOOSE_FROM_LIST: 38 matrix " & ex.Message)
End Try
End If ' BeforeAction
ElseIf (pVal.ItemUID = "38") And (pVal.ColUID = "LPO") And pVal.EventType = SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST Then
Dim oCFLEvento As SAPbouiCOM.IChooseFromListEvent
oCFLEvento = pVal
Dim sCFL_ID As String
sCFL_ID = oCFLEvento.ChooseFromListUID
Dim oForm As SAPbouiCOM.Form
oForm = SBO_Application.Forms.Item(FormUID)
Dim oCFL As SAPbouiCOM.ChooseFromList
oCFL = oForm.ChooseFromLists.Item(sCFL_ID)
If oCFLEvento.BeforeAction = False Then
Dim oDataTable As SAPbouiCOM.DataTable
oDataTable = oCFLEvento.SelectedObjects
If oDataTable Is Nothing Then
Exit Sub
End If
Dim Code As String = ""
Dim Name As String = ""
Dim cflValBefore As String = ""
Dim i As Integer = 0
Code = oDataTable.GetValue(0, 0)
' Name = oDataTable.GetValue(1, 0)
Try
' If (pVal.ItemUID = "38") And (pVal.ColUID = "ItemCode") Then
oMatrix = oForm.Items.Item("38").Specific
For i = 0 To oDataTable.Rows.Count - 1
cflValBefore = oForm.DataSources.DBDataSources.Item(1).GetValue("U_ProdO", oForm.DataSources.DBDataSources.Item(1).Offset)
oForm.DataSources.DBDataSources.Item(1).SetValue("U_ProdO", oForm.DataSources.DBDataSources.Item(1).Offset, oDataTable.GetValue("DocNum", 0))
oForm.DataSources.DBDataSources.Item(1).SetValue("U_OrderD", oForm.DataSources.DBDataSources.Item(1).Offset, oDataTable.GetValue("PostDate", 0))
'oForm.DataSources.DBDataSources.Item(1).SetValue("U_DueDate", oForm.DataSources.DBDataSources.Item(1).Offset, oDataTable.GetValue("DueDate", 0))
oForm.DataSources.DBDataSources.Item(1).SetValue("U_Status", oForm.DataSources.DBDataSources.Item(1).Offset, oDataTable.GetValue("Status", 0))
If oForm.Mode <> SAPbouiCOM.BoFormMode.fm_ADD_MODE Then
If cflValBefore <> oForm.DataSources.DBDataSources.Item(1).GetValue("U_ProdO", oForm.DataSources.DBDataSources.Item(1).Offset) Then oForm.Mode = SAPbouiCOM.BoFormMode.fm_UPDATE_MODE
If cflValBefore <> oForm.DataSources.DBDataSources.Item(1).GetValue("U_OrderD", oForm.DataSources.DBDataSources.Item(1).Offset) Then oForm.Mode = SAPbouiCOM.BoFormMode.fm_UPDATE_MODE
' If cflValBefore <> oForm.DataSources.DBDataSources.Item(1).GetValue("U_DueDate", oForm.DataSources.DBDataSources.Item(1).Offset) Then oForm.Mode = SAPbouiCOM.BoFormMode.fm_UPDATE_MODE
If cflValBefore <> oForm.DataSources.DBDataSources.Item(1).GetValue("U_Status", oForm.DataSources.DBDataSources.Item(1).Offset) Then oForm.Mode = SAPbouiCOM.BoFormMode.fm_UPDATE_MODE
End If
oMatrix.SetLineData(pVal.Row)
Next
' End If
'SetInitialDataWorkOrder()
Catch ex As Exception
'MsgBox(ex.Message)
ShowErrMsg(" Event Error et_CHOOSE_FROM_LIST: 38 matrix LPO " & ex.Message)
End Try
End If ' BeforeAction
ElseIf pVal.ItemUID = "1" And pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED And pVal.BeforeAction = True Then 'And pVal.BeforeAction = False Then
Dim oQty As SAPbouiCOM.EditText
Dim oBOM As SAPbouiCOM.EditText
Dim oDueDate As SAPbouiCOM.EditText
Dim oLPO As SAPbouiCOM.EditText
Dim oForm As SAPbouiCOM.Form
oForm = SBO_Application.Forms.Item(FormUID)
oMatrix = oForm.Items.Item("38").Specific
If oForm.Mode = SAPbouiCOM.BoFormMode.fm_ADD_MODE Or oForm.Mode = SAPbouiCOM.BoFormMode.fm_UPDATE_MODE Or oForm.Mode = SAPbouiCOM.BoFormMode.fm_OK_MODE Then
' If pVal.ActionSuccess = True Then
Dim ctr As Integer = 1
If oMatrix.VisualRowCount >= 1 Then
For ctr = 1 To oMatrix.VisualRowCount
oQty = colQtyWO.Cells.Item(ctr).Specific
oBOM = colLBOM.Cells.Item(ctr).Specific
oDueDate = colDueDate.Cells.Item(ctr).Specific
'Dim wo As SAPbouiCOM.EditText
'wo = oMatrix.Columns.Item("LPO").Cells.Item(ctr).Specific
'code for update the table uin number
oLPO = oMatrix.Columns.Item("LPO").Cells.Item(ctr).Specific
Dim proorder As String = ProductionOrder(oQty.Value, oBOM.Value, CDate(oDueDate.Value))
'oLPO.Value = ProductionOrder(oQty.Value, oBOM.Value, CDate(oDueDate.Value))
If proorder <> "" Then
'oLPO = oMatrix.Columns.Item("LPO").Cells.Item(pVal.Row).Specific
'oLPO.Value = ProductionOrder(oQty.Value, oBOM.Value, CDate(oDueDate.Value))
UpdateForm(proorder, Docnum)
ItemcodeProduction = ""
QtyProduction = ""
End If
Next
End If
'End If ' action close
End If 'mode close
'ProductionOrder(10, "A00001") -
Get DocNum from CFL (choose from list)
Hi SAP gurus!
Wish all of you a very Happy and Prosperous New Year 2012 !
is it possible to get Document Number from List of Goods Receipt (CFL) ..?
in Landed Cost Screen, when user clicks on 'Copy From' button, i am trying to execute query based on Document Number of List Of Goods Receipt CFL (Screen No. 10019). and then assign value of GrossAmnt to textfield 'ActualCost'
but in Screen 10019, when i press 'Choose' button, value in pval.formtype is 992!
in Case statement of 10019, hence my query is not getting executed..
Does any one have any idea how can i get Document Number from CFL.?
below is my code.
'// add an event type to the container
'// this method returns an EventFilter object
Set oFilter = oFilters.Add(et_ITEM_PRESSED)
'// aggign the form type on which the event would be processed
oFilter.Add 992 'Landed Cost Screen
oFilter.Add 10019 'List of Goods Receipt Screen (CFL)
in Case statement of pval.formtype
If pVal.FormType <> 0 Then
If pVal.Before_Action = False Then
Select Case pVal.FormType
case 992:
case 10019:
select case pval.eventtype
case et_item_pressed
Set o_TmpForm = SBO_Application.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount)
o_matrix = o_TmpForm.items.item("7").specific
set actual_cost = o_matrix.column.item("DocNum").specific.value ' actual_cost.RowCount is 0, hence runtime error.
'now passing query in below sub end sub subroutine(procedure)..
get_actual_cost
end select
end Select
end if
end if
i appreciate your help..
Thanks and Regards,
kaviprashuHello,
When you call ChooseFromList object, and select an item, you can get the datatable which contains the selected rows from the CFL object.
Now it has several columns (basically all columns in the head table), you so it is now easy to select the correct column:
val1 = oDataTable.GetValue("[COLUMN_NAME]", 0)
Sample code:
If oCFLEvento.BeforeAction = False Then
Dim oDataTable As SAPbouiCOM.DataTable
oDataTable = oCFLEvento.SelectedObjects
Dim val1 As String
Dim val2 As String
Try
val1 = oDataTable.GetValue("DocNum", 0)
val2 = oDataTable.GetValue("DocEntry", 0)
Catch ex As Exception
End Try
Now you can only focus on the landed costs screen, (992) and track event et_CHOOSE_FROM_LIST
Now the complete code:
If pVal.EventType = SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST Then
Dim oCFLEvento As SAPbouiCOM.IChooseFromListEvent
oCFLEvento = pVal
Dim sCFL_ID As String
sCFL_ID = oCFLEvento.ChooseFromListUID
Dim oForm As SAPbouiCOM.Form
oForm = SBO_Application.Forms.Item(FormUID)
Dim oCFL As SAPbouiCOM.ChooseFromList
oCFL = oForm.ChooseFromLists.Item(sCFL_ID)
If oCFLEvento.BeforeAction = False Then
Dim oDataTable As SAPbouiCOM.DataTable
oDataTable = oCFLEvento.SelectedObjects
Dim val1 As String
Dim val2 As String
Try
val1 = oDataTable.GetValue("DocNum", 0)
val2 = oDataTable.GetValue("DocEntry", 0)
Catch ex As Exception
End Try
End If
End If
Regards
János -
Error when trying top connect ChooseFromList object to a Button object
Hi all
I have a user form with a button .
upon pressing on the button i want that a ChooseFromList screen will be opened. when i create the ChooseFromList object and bind it to the button object by assigning its UID to the button's ChooseFromListUID property i recieve an error message that says: "Invalid choose from list".
what could be causuing this problem? what is the correct way in code to connect a ChooseFromList object to a Button object?
appreciate the help
YoavHi Yoav,
Before Doing the Bind, you should add your CFL
Dim oCFLs As SAPbouiCOM.ChooseFromListCollection
Dim oCFL As SAPbouiCOM.ChooseFromList
Dim oCFLCreationParams As SAPbouiCOM.ChooseFromListCreationParams
oCFLs = oFrm.ChooseFromLists
oCFLCreationParams = SBO_App.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams)
'1. BP CFL
oCFLCreationParams.MultiSelection = False
oCFLCreationParams.ObjectType = SAPbobsCOM.BoObjectTypes.oBusinessPartners
oCFLCreationParams.UniqueID = cflName
oCFL = oCFLs.Add(oCFLCreationParams)
The correct way to connect a CFL to a button is like this
Dim oBtn As SAPbouiCOM.Button
oBtn = oFrm.Items.Item("btnCFL").Specific
oBtn.ChooseFromListUID = cflName -
Hi,
The disks on one of our oracle machines had crashed and we had to get everything from back up. Now on this machine, when i bring up oracle, it gives me the error: ORA-00214: controlfile '/u10/oradata/bmedia/control01.cfl' version 71287 inconsistent with file '/u30/oradata/bmedia/control03.ctl' version 71219.
oerr for this error tells me to use filed that are for the same db for the same time period. The dates on these two files are the same with a time difference of about 1 hour.
Does anybody know of a way to recover from this problem without losing data in the oracle database? Thanks,
Manju.Whichever controlfile has a timestamp consistant with that of your datafiles should be copied/overwrite the other controlfile which does not have the consistant timestamp. Do the copy (rename the controlfile you are going to replace just in case!) and try to startup the database.
If that doesn't work you will have to recreate the controlfile. Refer to Oracle documentation for the create controlfile statement. -
Chose from list in internal error?
Hi expert
i want to use chose from list from udf object.
Private Sub LoadingCFL(ByVal oForm As SAPbouiCOM.Form)
Try
Dim oCFLs As SAPbouiCOM.ChooseFromListCollection
'Dim oCons As SAPbouiCOM.Conditions
'Dim oCon As SAPbouiCOM.Condition
oCFLs = oForm.ChooseFromLists
Dim oCFL As SAPbouiCOM.ChooseFromList
Dim oCFLCreationParams As SAPbouiCOM.ChooseFromListCreationParams
oCFLCreationParams = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_ChooseFromListCreationParams)
' Adding 2 CFL, one for the button and one for the edit text.
oCFLCreationParams.MultiSelection = False
oCFLCreationParams.ObjectType = "SM_TPR" ''''''17
'oCFLCreationParams.UniqueID = "CFL1"
'oCFL = oCFLs.Add(oCFLCreationParams)
oCFLCreationParams.UniqueID = "CFL2"
oCFL = oCFLs.Add(oCFLCreationParams)
Catch
' MsgBox(Err.Description)
End Try
End Sub
when i use object no 17..... its showing order chosefrom list.,but when i use user define field object" SM_TPR"
then its error message showing '''''''''''''' internal error-1033
please solve this problem......Hi John
U could have given the object type in the screen painter itself.
-Anto -
Form bad value when opening CFL in system forms
Hi,
I have a UDF control on the Stock Transfer Form which opens a CFL. Now at the CFL event, when i try to set the value from the CFL to the Parent Form (Stock Transfer). It opens the CFL again with "Form - Bad Value" error.
This case i had faced but the problem was solved using
dbdatasource.setValue = "string value returnd frm CFL datatable"
but my problem comes with system form where i cannot use Setvalue method of DBDataSource.
Please Help!
Manu.Hi Trinidad,
thanx for replying.
my code is
Select pVal.BeforeAction
Case False
Select Case pVal.EventType
Case SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST:
''' sCFL_Value1 is a string'''
sCFL_Value1 = oCFLEvent.SelectedObjects.GetValue(1, 0).ToString()
If oCFLEvent.ItemUID = "47" Or oCFLEvent.ItemUID = "3" Then
oEditText = oForm.Items.Item("etTest").Specific
<b>oEditText.Value = sCFL_Value1</b>
'''''' ******This is where i get the error i have tried using oEditText.String as well. I faced the same issue on a user form but when i used oDataSrc_Header.SetValue("U_Price", oDataSrc_Header.Offset, sCFL_Value1), my problem was solved.*********''''''''
End If
i tried a workaround by saving the sCFL_Value into some other textbox which is not bound with a CFL control (e.g. the remarks field in stock transfer), there it does not throw any error but still as soon as i copy that value from remarks field to the actual control it throws "bad value error".
Any help would be very grateful.
Manu. -
Error in Choose from list on Matrix
Hi all,
I am using CFL in matrix for my user define form, When i choose a value from CFL , i am getting the following error
<b>" Item -Can't set value on item because the item can't get focus [66000-153]"</b>
<u>the code i used is given below</u>
<u>this is in Item Event</u>
Try
If FormUID = ("FRMIGRP") Then
If pVal.Before_Action = False Then
If (pVal.EventType = SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST) Then
' If pVal.EventType = SAPbouiCOM.BoEventTypes.et_GOT_FOCUS Then
Dim oCFLEvento As SAPbouiCOM.IChooseFromListEvent
oCFLEvento = pVal
Dim sCFL_ID As String
sCFL_ID = oCFLEvento.ChooseFromListUID
Dim oForm As SAPbouiCOM.Form
oForm = SBO_Application.Forms.Item(FormUID)
Dim oCFL As SAPbouiCOM.ChooseFromList
oCFL = oForm.ChooseFromLists.Item(sCFL_ID)
If oCFLEvento.BeforeAction = False Then
Dim oDataTable As SAPbouiCOM.DataTable
oDataTable = oCFLEvento.SelectedObjects
Dim val As String
Dim val1 As String
Dim val2 As String
Dim val3 As String
Try
val = oDataTable.GetValue(0, 0)
val1 = oDataTable.GetValue(1, 0)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
Try
If (pVal.ItemUID = "txtcode") Then
Dim oDS As SAPbouiCOM.DBDataSource
oDS = oForm.DataSources.DBDataSources.Item("@PSSIT_GRPHDR") 'add your dbdatasource here
oDS.SetValue("U_grpcode", oDS.Offset, val) ' val1 is the value you are setting
oDS.SetValue("U_grpname", oDS.Offset, val1)
End If
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
Try
val2 = oDataTable.GetValue(0, 0)
val3 = oDataTable.GetValue(1, 0)
If (pVal.ItemUID = "matr") And (pVal.ColUID = "supp") Then
Dim oEdit As SAPbouiCOM.EditText
oMatrix.FlushToDataSource()
oForm.DataSources.UserDataSources.Item("EditDS2").ValueEx = val2.ToString
oEdit = subcol.Cells.Item(pVal.Row).Specific
oEdit.Value = val2.ToString
oEdit = subname.Cells.Item(pVal.Row).Specific
oEdit.Value = val3.ToString
("EditDS2").ValueEx = Nothing
End If
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End If
And i used data source also to set the value using below code, but for that also value is not set in to the field
Dim oEdit As SAPbouiCOM.EditText
Dim oDS As SAPbouiCOM.DBDataSource
oDS = oForm.DataSources.DBDataSources.Item("@PSSIT_GRPDTL") 'add your dbdatasource here
oDS.SetValue("U_supcode", oDS.Offset, val2) ' val1 is the value you are setting
oDS.SetValue("U_supname", oDS.Offset, val3)
SOmebody can help me to solve this issue
Regards
Suresh RSuresh,
Try this one,
Here i have used for check the dulpicate entry also, that is if we choose one item in the first row in second row or third we cant able to choose the same. If u no need just neglect it.
Case SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST And pVal.BeforeAction = False
Dim oCFLE As SAPbouiCOM.IChooseFromListEvent
oCFLE = pVal
Dim CFLID As String
CFLID = oCFLE.ChooseFromListUID
PI_Frm = app.Forms.Item(FormUID)
Dim oCFL As SAPbouiCOM.ChooseFromList
oCFL = PI_Frm.ChooseFromLists.Item(CFLID)
oCFL.UniqueID = "CFL2" Then
Dim oDT As SAPbouiCOM.DataTable
oDT = oCFLE.SelectedObjects
Try
Dim oMat As SAPbouiCOM.Matrix
Dim t, t1 As String
Dim Rec, Rec1, Rec2 As SAPbobsCOM.Recordset
oMat = PI_Frm.Items.Item("m_det").Specific
t = oDT.GetValue(0, 0)
t1 = oDT.GetValue(1, 0)
If Trim(HEAD_oDBds.GetValue("U_pid", 0)).Equals("") = False Then
oMat.Columns.Item("rate").Editable = False
Else
oMat.Columns.Item("rate").Editable = True
End If
Dim Bool As Boolean = False
For i As Integer = 1 To oMat.VisualRowCount
oMat.GetLineData(i)
If Trim(DETAIL_oDBds.GetValue("U_itno", (i - 1))).Equals(Trim(oDT.GetValue(0, 0))) = True Then
Bool = False
Exit For
Else
Bool = True
End If
Next
If Bool = True Then
If pVal.Row = oMat.VisualRowCount Then
oMat.AddRow()
oMat.FlushToDataSource()
Me.SetEmptyRow(DETAIL_oDBds.Size)
End If
Rec = com.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
Rec1 = com.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
Rec2 = com.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
Rec.DoQuery("select BuyUnitMsr from OITM where ItemCode ='" & Trim(oDT.GetValue(0, 0)) & "'")
DETAIL_oDBds.Offset = (pVal.Row - 1)
DETAIL_oDBds.SetValue("LineId", DETAIL_oDBds.Offset, pVal.Row)
DETAIL_oDBds.SetValue("U_itno", DETAIL_oDBds.Offset, oDT.GetValue(0, 0))
DETAIL_oDBds.SetValue("U_itdesc", DETAIL_oDBds.Offset, oDT.GetValue(1, 0))
DETAIL_oDBds.SetValue("U_unit", DETAIL_oDBds.Offset, Rec.Fields.Item(0).Value)
DETAIL_oDBds.SetValue("U_poqty", DETAIL_oDBds.Offset, "0")
DETAIL_oDBds.SetValue("U_qnos", DETAIL_oDBds.Offset, "0")
DETAIL_oDBds.SetValue("U_pur", DETAIL_oDBds.Offset, "")
Rec1.DoQuery("select U_basicrate from [@RATE_MASTER_DETAIL] where U_itemid='" & oDT.GetValue(0, 0) & "'")
DETAIL_oDBds.SetValue("U_rate", DETAIL_oDBds.Offset, Rec1.Fields.Item(0).Value)
Rec2.DoQuery("select a.OnHand ,b.ItemCode,b.DfltWH,a.WhsCode from OITW a,OITM b where a.ItemCode=b.ItemCode and b.DfltWH=a.WhsCode and b.DfltWH='01' and b.ItemCode='" & oDT.GetValue(0, 0) & "'")
DETAIL_oDBds.SetValue("U_stx", DETAIL_oDBds.Offset, Rec2.Fields.Item(0).Value)
oMat.SetLineData(pVal.Row)
End If
If it helps give me reward points.
Regards,
Anitha -
On a UDF (on a system table) add a CFL (linked to a system table)
Hello,
I added a UDF to OITM, named say "XXX_RootOfPrj". It appears on the standard UDFs panel:
Users should type a project code (OPRJ.PrjCode) here.
For helping them I need to add a ChooseFromList on this UDF, linked to OPRJ.
So I added this line in the UDF definition:
oUserFieldsMD.LinkedTable = "OPRJ";
But when I Add() the UDF I get:
Errore -5002: Il campo 'Tabella collegata' dovrebbe essere formato da 8 car. alfanumerici senza val. standard validi
Which means more or less:
Error -5002: 'Linked table' field should be formed by 8 alphanumeric characters without standard valid values
Maybe is it impossible what I want to do? It's odd that I can link a UDT but not a system table...
Maybe should I use a workaround, like manually attaching a CFL on the form using UI API?Thanks Edy,
now I got it!
Create a query for the formatted search, like this:
select PrjCode, PrjName
from OPRJ
Add this user query to B1 as a saved query
Open Item Master Data, select your UDF, press Alt + Shift + F2
In the dialog select "Search in Existing User-Defined Values according to Saved Query", click on "Open Saved Query", select the saved query above and you are done.
Now the user can pick a valid project code from a CFL.
Kind regards
Maybe you are looking for
-
HELP! Flash header cutting off, but only on some computers
http://www.omsstrategicadvisors.com/ Our site has been up for approx 9 months and there's been no problem. Now all of a sudden, on SOME computers that were perfectly fine, the flash header is getting cut off. Well, I guess magnified is a better des
-
Hi I wanted to know if I registered my iphone to my husbands account how can I change it so I have it under my own account? I have all my contacts in my phone that I don't want to lose. I have not yet registered it completely I selected to register i
-
Ficon port addressing for MDS 9506
Hi, I'm configuring a MDS 9506 as a mirror of a MDS 9513 because my customer is preparing a data center migration. I've found that 9506 has a ficon address limit of 153, but I need to address ports up to address 230. Do you know if there is possible
-
How to transfer Apps from iTouch 4 or Win 7 PC to Mac?
HI All. I have yet to grab Lion & still have all my apps on my Win 7 laptop. Via iCloud I have DL'd all my apps onto my Mac. Via Smb & other transfer methods I have the bulk of my iTunes library (music,e books, Audiobooks,films & tv) on my Mac BUT I
-
Hi, I have a file to load maintenance plan data(IP01).I used the standard program riibip00. But only those maintenance plan categories for which the call object is initial are supported.(Mentioned in documentation of riibip00) I have them not initial