Item Code Auto Generation Based on User defined Tables
I need the Item code like
PRODUCT TYPE-ITEMGROUP-ITEMCODE-SUBITEM-BRAND-COLOR e.g .FG-01-01-00-001-00.
I created the following User define Tables and link to Item Master data
U_PRO - FOR PRODUCT TYPE
U_GROUP - FOR ITEM GROUP
U_ITEMCODE - FOR ITEMCODE
U_SUBITEM - FOR SUB ITEM
U_BRD - FOR BRAND NAME
U_COLOR - FOR COLOR
i need a formatted search in Item code to fetch the codes from the user defined table
i tried with the following
SELECT T5.[Code]'-'T2.[Code]'-'T3.[Code]'-'T4.[Code]'-'T0.[Code]'-'T1.[Code] FROM [dbo].[@BRD] T0 , [dbo].[@COLOR] T1, [dbo].[@GROUP] T2, [dbo].[@ITEMCODE] T3, [dbo].[@SUBITEM] T4, [dbo].[@PRO] T5 INNER JOIN OITM T6 ON T5.Code = T6.U_PRO WHERE
T5.[Code] = T6.[$U_PRO] AND
T2.[Code] = T6.[$ U_GROUP] AND
T3.[Code] = T6.[$U_ITEMCODE] AND
T4.[Code] = T6.[$U_SUBITEM] AND
T0.[Code] = T6.[$U_BRD] AND
T1.[Code] = T6.[$U_COLOR]
showing errors. Can any one help me regarding this. I badly need the query for Auto generation of Itemcode
Hi,
How can you assign those UDF value without ItemCode in the first place?
Thanks,
Gordon
Similar Messages
-
Item Code Auto generation in item master UDF field
Dear Expert,
I want to Generate automatic item code in the item master U_STY UDF field . the number start with 'SL' prefix
like this 'SL000001' and continue when i generate next item master.
for example 'SL000001' for X item . when add next item Y then item nuber will be 'SL000002'. kindly help me.
thanks.
sridharan
Edited by: Sridharan.R on Oct 28, 2011 10:02 AMHi!
Try this
declare @temp as char(15)
IF (Select max(Itemcode) from OITM ) IS Null
BEGIN
set @temp = 'SL000001'
select cast(@temp as char(15))
END
set @temp=(select max(right(ItemCode,6)) + 1 from OITM )
set @temp='SL'+isnull(replicate(0,6-len(@temp)),'')+@temp
select cast(@temp as char(15))
END
Regards,
[Thanga Raj K|Q3 Wrap-Up: What happened in the third quarter of 2009 in the SAP Business One Community] -
Can't bind status field in user defined table
Hi!,
I want to display the status of my document type user table, I added an EditText (unique id = txtStatus) control in ScreenPainter and Iam getting a Can't Bind error in this line of code. @Meta is my user defined table of type document
((SAPbouiCOM.EditText)oForm.Items.Item("txtStatus").Specific).DataBind.SetBound(true, "@META", "Status");
Thank you!2 alternatives:
1.Bind the Status field to "textStatus" EditText field in ScreenPainter
2.Either in your code, bind the Status field to a ComoBox field since it has valid values.
Both works fine in my test.
By the way, I get the same error Status field to "textStatus" EditText field.
Kind Regards
-Yatsea -
How to pop-up a text box for a grid item on a user defined table?
Hello,
I have a user defined table with a grid & one of the columns is for comments. What I'm trying to do is to pop up a text box when double clicking in the column field. This would be the same as the Item Details column in the Sales Order ittems grid.
Thanks,
RonPlease post your question on SDK forum. Only SDK could meet your need.
Thanks,
Gordon -
How to fill the records from a User Define Table to PO item Grid
Hi To all,
I need to fill data from User Define table records into Purchase Order Item Grid.
I created an UDF Filed in PO - Header Part - "PRS"(Filed Name)
By using Formatted Search in itemcode column, i called a query,
"Select itemcode, qty from (@user define tablename) where PRS = $http://OPOR.U_PRS"
For eg:
Output from querry
ItemCode Qty
ABC 1
DEF 2
DFG 7
SDGD 9
By using formatted search it is filling only first data in to itemcode column in PO Grid.
Please help, how can i fill ALL the data in to my PO Grid?
Thanks in Advance
SAGARThe easisest way is to create datasource and the result bind to grid.
Datasource:
oDBDataSource = oForm.DataSources.DBDataSources.Add("@usertablename")
Dim xoConditions As SAPbouiCOM.Conditions
Dim xoCondition As SAPbouiCOM.Condition
xoConditions = New SAPbouiCOM.Conditions
xoCondition = xoConditions.Add
xoCondition.BracketOpenNum = 1
xoCondition.Alias = "u_zn"
xoCondition.Operation = SAPbouiCOM.BoConditionOperation.co_EQUAL
xoCondition.CondVal = "cond"
xoCondition.BracketCloseNum = 1
oDBDataSource.Query(xoConditions)
binding (example for matrix, in grid is simillar)
oMatrix.Clear()
Dim cols As SAPbouiCOM.Columns
Dim column As SAPbouiCOM.Column
cols = oMatrix.Columns
column = cols.Item("colX")
column.DataBind.SetBound(True, "@usertable", "u_x")
oMatrix.LoadFromDataSource()
hoep it helps
Petr -
Can we Customize Edit User-Defined Table Screen in Fusion Application
Hi All,
We have a requirement to add a ADFDI functionality to the 'Edit USer-Defined Table' screen by adding a 'Mass Upload' Button.
Normally for Some of the screens (Fusion Compensation) i am seeing 'Personalize -> Edit Current Page' Option on Menu items on top. But on 'Edit User-Defined Table' i am not seeing this option in 'Personalize' Menu.
So the questions is is this screen Customizable in Fusion Application? If So What will be EAR file which we need to use for Customization.
The screen where we need to add ADFDI Functionality is under 'oracle/apps/setup' path.
Can anyone point me to the Exact EAR on this and also let me know if we can customize it or not
Thanks
KajaGenerally the code structure can be observed run-time [url https://blogs.oracle.com/fadevrel/entry/finding_code_artifacts_for_customization]using the composer, however in your case the content comes through a portlet in which case the method does not work as you cannot drill down to the specific region details in the composer. Based on a search through the code I think the regions you are interested are:
<li>hcmPayroll/userTables/ui/public_html/oracle/apps/hcm/userTables/ui/page/UserTableSearch.jsff --> This is the details page with header "Manage User-Defined Tables"
<li>hcmPayroll/userTables/ui/public_html/oracle/apps/hcm/userTables/ui/page/ManageUserStructure.jsff --> This is the details page with header "User-Defined Table: <TABLE_NAME>"
These would presumably be in EarHcmPayroll. I'll see if I can find out how the portlet content can be observed from the RT application..
Jani Rautiainen
Fusion Applications Developer Relations
https://blogs.oracle.com/fadevrel/ -
Error while adding records in user defined table
Dear all,
I am adding a record in user defined table using .add() method. the code is given below. while adding it raises the following error
"-1[Microsoft] [SQL Native Client] [SQL Server] Conversion failed when converting the nvarchar value '-3 @BG_MAILSETTINGS' to data type int. (CINF). "
All the fields are varchar date type.
Dim oUDT As SAPbobsCOM.UserTable
oUDT = oCompany.UserTables.Item("BG_MAILSETTINGS")
With oForm.DataSources.UserDataSources
oUDT.Code = "1"
oUDT.Name = "SMTPSERVER"
oUDT.UserFields.Fields.Item("U_SERVER").Value = .Item("EDTSMTPSVR").ValueEx
oUDT.UserFields.Fields.Item("U_EMAIL").Value = .Item("EDTFEMAIL").ValueEx
oUDT.UserFields.Fields.Item("U_PORT").Value = .Item("EDTSMTPPRT").ValueEx
oUDT.UserFields.Fields.Item("U_USERNAME").Value = .Item("EDTSMTPUSR").ValueEx
oUDT.UserFields.Fields.Item("U_PASSWORD").Value = .Item("EDTSMTPPWD").ValueEx
oUDT.UserFields.Fields.Item("U_AUTHENT").Value = .Item("CMBSMTPAUT").ValueEx
K = oUDT.Add
If K <> 0 Then
oCompany.GetLastError(iErrCode, sErrMsg)
MsgBox(CStr(iErrCode) & "-" & sErrMsg, vbCritical, "Error")
Exit Sub
End If
End with
Could any one please say the solution for this.
Many thanks,
Manikandan.
Edited by: Rui Pereira on Dec 23, 2008 3:49 PMDear Manikandan P,
Is there any change and check in stored procedure SBO_SP_TransactionNotification?
Best Regards
Jane Jing
SAP Business One Forums team
Edited by: Rui Pereira on Dec 23, 2008 3:56 PM -
Help needed for data updation in User Defined Tables
Hello Experts,
I am developing one add-on in SAP B1 8.8 to input data in a User Defined Table described as under
Table Name
DriverMst UDT Type is No Object
Description
Stores the Driver master data which are used to get reference in Sale Delivery Form and Driver data management activity
User defined fields
Data Name
Data source
Size
Pane Level
Description
Driver Code
Code
Alphanumeric
0
No object table fixed field
System Name
Name
Alphanumeric
30
0
No object table fixed field
Full Name
FullName
Text
50
0
Father Name
FatherName
Text
50
0
Birth Date
BirthDate
Date
0
Phone Number
PhoneNo
Alphanumeric
50
0
Mobile No
MobileNo
Alphanumeric
13
0
I have created one form using screen painter displaying text boxes and bind them to the table.
This form is working absolutely fine when there are some data in table (i.e. Browse using navigation)
My problem is, when I click add button from tool bar the "OK" button turn to "Add" that means the form is set to Add mode, but when I click "Add" button after entering some data nothing happens and input data is not stored in Table. The same "OK" Button turned to "Update" when I do changes in loaded data, but my changes are not reflected to table after I click "Update".Thanks Nagarajan,
None.
There is no such query. The table fields is directly linked to Edit Box or Combo Box in form.
From the examples I learned that I have to do something like this to get my table updated
Dim oUsrTbl As SAPbobsCOM.UserTable
Dim Res As Integer
oUsrTbl = oCompany.UserTables.Item("DRIVERMST")
oUsrTbl.Code = oBPC.Value 'Item Specific of Driver Code Edit Box
oUsrTbl.Name = Left(oBPN.Value, 30) 'Item Specific of Name Edit Box
oUsrTbl.UserFields.Fields.Item("U_FullName").Value = oMFN.Value
oUsrTbl.UserFields.Fields.Item("U_FatherName").Value = oFTHN.Value
oUsrTbl.UserFields.Fields.Item("U_BirthDate").Value = oDOB.Value
oUsrTbl.UserFields.Fields.Item("U_PhoneNo").Value = oPHN.Value
(Similar For rest ofthe fields)
Res = oUsrTbl.Add()
Just let me know that is this necessary to do like above.. To be frank there are few more fields and matrices on the form which I didn't mentioned. I am just trying to get recovered from first step to proceed further.
Regards -
Hello Experts,
I created the User Defined Table in the name of SR NO where i entered the Docment No in Code Field (System generated default field).When i add the Document Number serially when i saved the UDT table then my serial sequence has changed.Could anyone help me out from these problem.
Regards
AmolHi Suraj,
These is my Query when i tried to run @PPC Table then it will not sort the Code & Name the details contain all the information.
If u have any query please ask.
SELECT T0.[Code], T0.[Name], T0.[U_0001] as 'Purchase Order No',T0.[U_0002] as 'Sr No', T0.[U_0003] as 'Item Code', T0.[U_0004] as 'Item Description' , T0.[U_9999] as 'Plan Qty', T0.[U_0005] as 'P O Qty', T0.[U_0006] as 'GRN No', T0.[U_0007] as 'GRN Date' , convert(varchar,T0.[U_0008]) as 'Batch Num',convert(varchar,T0.[U_0009]) as ' Heat Num', T0.[U_0010] as 'GRN Qty', convert(varchar,T0.[U_0011]) as 'RM Size',convert(varchar,T0.[U_0012]) as 'Length' , convert(varchar,T0.[U_0013]) as 'Pieces' , convert(varchar,T0.[U_0014]) as 'SO Num' , T0.[U_0015] as 'SO ROWNUM' , T0.[U_0016] as 'SO ItemCode' , T0.[U_0017] as 'SO Item Description' , T0.[U_0018] as 'SO Qty' , T0.[U_0019] as 'SUPP Name' , T0.[U_0020] as 'Cust Name', T0.[U_0021] as 'Open PO Qty' ,convert(varchar,T0.[U_0022]) as 'SO Tol Size' , T0.[U_0023] as 'SO Condition' , T0.[U_0024] as 'SO Size' , T0.[U_0025] as 'SO Length' , T0.[U_0026] as 'Remarks' , T0.[U_0027] as 'Planning Date' , convert(varchar,T0.[U_0028]) as 'SO Dia MM' , T0.[U_0029] as 'Plan Pieces' , T0.[U_0030] as 'Stock Condition' FROM [dbo].[@PPC] T0 ORDER BY T0.[U_0008]
Regards
Amol -
USER DEFINED TABLES IN XL REPORTER
Hello,
I have a user defined field based on a user defined table with code and name. I call my user defined field in XL reporter. This field varied with the data that I report. I would like to know how I can add the name of the table in my XL report. We can call additionnal tables, but I don't know how I can write the instruction to do it with a variable field.
Thanks
Isabelle LAGUERRE
Serena
FranceIsabelle,
Usere Defined Tables are not supported by the XL Report Writer. There is not a method to import UTD's at this time. User Defined Fields (UDF's) are supported.
Eddy -
Hi everybody who has some spare time to read my stuff
I had a problem that some of you might have had. I have a user defined table, lets call it ProductTypes. Now system by default creates two columns in this table, one is Code (primary key) and another is Name (Index). I have added third column called Department. Now, if I wanted to add the following data (see bellow) to the table I would have had a constraint violation message pointing me out that I have problems with indexing.
Code, Name, Department
1, Cream, Fragrances
2, Cream, Beauty Products
^^
I could thing of couple workarounds of this problem
1. Is to duplicate Code into Name and storing rest of the data using user columns
Code, Name, Product Name, Department
1, 1,Cream, Fragrances
2, 2, Cream, Beauty Products
This approach isnt very convenient as it requires UI development should we decide to attach this table to the Item master data form in a form of combo box.
2. Is to amend Index on the database level. Initially, the index KProductTypes_Name consisted of only one column Name, what I have done is added another column which is Code to indexing. I dont see how this can harm database consistency or damage the core system. Please correct me if I am wrong.
Another way of amending index in order to solve my problem could be choosing ignoring duplicate values option for column Name.
Please let me know what are your thoughts.
Best wishes> Why don't you try adding a trigger 'instead of
> insert' where code = max(code)1 and name=max(name)1
> and use only user columns for your data. This
> provided you know SQL basics.
in this scenario we would have to do UI SDK development for the output and going to have an extra column with meaningless data in it. -
Practical limitations to user defined table
Hi all,
I am thinking of setting up a user defined table which will have 5 columns and around 45,000 rows. It will be used in a simple formatted search to retrieve the value in column 5 when the values in columns 3 and 4 match an item code and an invoice header code on an invoice.
Will a table of this size slow things down significantly?
Regards, David.Hi David,
It shouldn't be that slow, but if you're worried about performance, you can also add indexes (keys in SBO) to the UDT.
For that go to User-Defined Field - Managment (I'm using SBO 2007), select the table and press the button Keys. Make sure no one else is connected for you to add the index (not even an add-on), otherwise you'll get an error.
Hope this helps,
Ian -
Guys.. How can i insert my data to my user defined table (Master Document), i have write code:
Set oUserTable = oCompany.UserTables.Item("TR_MD_FAKPAJAK")
oUserTable.Code = "1"
oUserTable.Name = "TORO"
oUserTable.UserFields("U_field1").Value = "toro"
oUserTable.UserFields("U_field2").Value = "toro"
oUserTable.UserFields("U_field3").Value = "toro"
oUserTable.UserFields("U_field4").Value = "toro"
oUserTable.UserFields("U_field5").Value = "toro"
Dim retval As Long
retval = oUserTable.Add
If retval <> 0 Then
oCompany.GetLastError lErrCode, sErrMsg
MsgBox lErrCode & " " & sErrMsg
Else
MsgBox "Masuk"
End If
my question is, when i run always display error "-4002 To Generate This Document, first defined the numbering series in Administration Module",
any idea guys ??
ThxHi Ria,
Unfortunately you cannot insert data in to a UDO table using the DI API (by marking your table as a 'Master Document' table you have made your UDT part of a UDO). It is one of the current limitations with working with UDOs. All data must be entered through the UI (ie manually).
If you just want to store data in a UDT then it is best to create the table as 'No object'. You can then use the DI API to read and write data to your table. However, you do lose the UDO functionality (eg no automatic saving or searching etc).
Kind Regards,
Owen -
Attach User define tables and view table need add to database into my add-o
Hi there,
I want to deploy an addon, there are User define tables and view table need add to database.
I need some advice on some issues..
1. Can I attach User define tables and view table need add to database into my addon.
2. I wonder which chance is properly to add them, if add these user define objects in time of install and I can't get the enough information that connect to SQL server
Thanks for any help.Hi Weerachai,
Here's an example of how to create a user-defined table in code. My suggestion would be to check if it exists when your add-on starts up and then if not, create the tables, fields and objects.
'User Table
Private Sub CreateTable(ByVal sTable As String, ByVal sDescription As String, ByVal oObjectType As SAPbobsCOM.BoUTBTableType)
Dim oUserTablesMD As SAPbobsCOM.UserTablesMD
Dim iResult As Long
Dim sMsg As String
oUserTablesMD = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserTables)
If Not oUserTablesMD.GetByKey(sTable) Then
oUserTablesMD.TableName = sTable
oUserTablesMD.TableDescription = sDescription
oUserTablesMD.TableType = oObjectType
iResult = oUserTablesMD.Add()
If iResult <> 0 Then
oCompany.GetLastError(iResult, sMsg)
MessageBox.Show("Error Creating Table: " & sTable & " Error: " & sMsg)
End If
End If
System.Runtime.InteropServices.Marshal.ReleaseComObject(oUserTablesMD)
End Sub
'User Field
Private Sub CreateField(ByVal sTable As String, ByVal sName As String, ByVal sDescription As String, _
ByVal iSize As Integer, ByVal aFieldType As SAPbobsCOM.BoFieldTypes, _
ByVal aSubType As SAPbobsCOM.BoFldSubTypes, ByVal sLink As String, _
ByVal bMandatory As SAPbobsCOM.BoYesNoEnum)
Dim oUserFieldsMD As SAPbobsCOM.UserFieldsMD
Dim oTable As SAPbobsCOM.UserTable
Dim iResult As Long
Dim sMsg As String
Dim i As Integer
Dim x As Integer
Dim bFound As Boolean = False
Dim oField As SAPbobsCOM.Field
oTable = oCompany.UserTables.Item(sTable)
For i = 0 To oTable.UserFields.Fields.Count - 1
oField = oTable.UserFields.Fields.Item(i)
'MessageBox.Show(oField.Name)
If oField.Name = "U_" & sName Then
bFound = True
End If
Next
System.Runtime.InteropServices.Marshal.ReleaseComObject(oTable)
If Not bFound Then
oUserFieldsMD = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserFields)
oUserFieldsMD.TableName = "@" & sTable
oUserFieldsMD.Name = sName
oUserFieldsMD.Description = sDescription
oUserFieldsMD.Type = aFieldType
If aFieldType = SAPbobsCOM.BoFieldTypes.db_Alpha Or aFieldType = SAPbobsCOM.BoFieldTypes.db_Numeric Then
oUserFieldsMD.EditSize = iSize
Else
oUserFieldsMD.SubType = aSubType
oUserFieldsMD.Mandatory = bMandatory
End If
oUserFieldsMD.LinkedTable = sLink
iResult = oUserFieldsMD.Add()
If iResult <> 0 Then
oCompany.GetLastError(iResult, sMsg)
MessageBox.Show("Error Creating Field: " & sTable & "." & sName & " Error: " & sMsg)
End If
System.Runtime.InteropServices.Marshal.ReleaseComObject(oUserFieldsMD)
End If
End Sub
If you want to create a View I think you would have to use the RecordSet object. This will ensure that you don't have to log in to the database again
Hope it helps,
Adele -
Formatted search in the User defined table
Hi All..
I created two user defined table one is for document row and other is for document master.So in the master table created one column named as Sales order no and through formatted search call the sales order no in that column.Now i want that in my child table i want to show the those items which belongs to the selected sales order no in the master table.So how can i do that through Formatted search.Is there any query of it then please forward it..
ThanksYa Sure..
I need some quality check on the items after delivery so i am trying to manage it through the user defined tables.I created two tables first is document type ,Second is Document type rows.Now i created 5 user defined field in both the table.Now i want to call my sales order and its items in the UDT.so i created one fms and call the sales order in the Document table now when i double click on the first row after that i am able to see the new table which is the document row table .Now i need the item code and description of the selected sales order in the document rows table.So how the items and description can come in the row type table through FMS..
I hope now u r able to get my scenario..
Maybe you are looking for
-
Memory card contents and accessibility
hello, i have a 32 mb mem card on my 6230. 14 mb is free on the card. there was no password on the card. recently a video clip failed to save on the mem card. a photo also failed. after a re-boot the same situ prevailed. surprisingly the data on the
-
Checkout file failed in JDI (server response: Internal Server Error)
Hi All, I am getting a strange error when I am trying to check out any file. It is not allowing me to checking out any views or controllers. I am not sure what went wrong. It is giving the error as: Checkout failed: Checkout file failed (server respo
-
Sales Order booked Email to party
Hi, We need to send a mail to the customer when their sales order is booked.Is this possible??If, possible then how can this be done? Regards, AA.-
-
Af:commandLink : hover & active CSS not working
Hi , I am using JDeveloper 11.1.1.6 My scenario is need to change the color in <af:commandLink> at that time of active.I tried the below CSS styles , +af|commandLink :active{+ background-color: #7FFFD4; +}+ +af|commandLink :hover{+ background-color:
-
Hi I want to start putting together a system to edit HD. Have been reading the forum for about an hour. A system like jdmack01 put togther seems pretty straight forward. Vista Home 64 bit -> Windows 7 Intel Q8200 Core 2 Quad CPU 2.33 Ghz Asus P5QC mo