How to Create CFL to user defined table
Hi all,
I have a user table with four fields. How to create a CFL for these fields?
Regards,
Fabio Ferreira.
this is sub fn required for registration
Here i mentioned heder level table and child table
Fields are mentioned will be displayed on CFL
If u want assign this CFL to any text field assign normal way but object id is:VEDA_PRN_WR_DOC
Public Function UDOExists(ByVal code As String) As Boolean
GC.Collect()
Dim v_UDOMD As SAPbobsCOM.UserObjectsMD
Dim v_ReturnCode As Boolean
v_UDOMD = objMain.objUtilities.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserObjectsMD)
v_ReturnCode = v_UDOMD.GetByKey(code)
System.Runtime.InteropServices.Marshal.ReleaseComObject(v_UDOMD)
v_UDOMD = Nothing
Return v_ReturnCode
End Function
'Second fn
Function registerUDO(ByVal UDOCode As String, ByVal UDOName As String, ByVal UDOType As SAPbobsCOM.BoUDOObjType, ByVal findAliasNDescription As String(,), ByVal parentTableName As String, Optional ByVal childTable1 As String = "", Optional ByVal childTable2 As String = "", Optional ByVal childTable3 As String = "", Optional ByVal LogOption As SAPbobsCOM.BoYesNoEnum = SAPbobsCOM.BoYesNoEnum.tNO) As Boolean
Dim actionSuccess As Boolean = False
Try
registerUDO = False
Dim v_udoMD As SAPbobsCOM.UserObjectsMD
v_udoMD = objMain.objUtilities.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserObjectsMD)
v_udoMD.CanCancel = SAPbobsCOM.BoYesNoEnum.tNO
v_udoMD.CanClose = SAPbobsCOM.BoYesNoEnum.tNO
v_udoMD.CanCreateDefaultForm = SAPbobsCOM.BoYesNoEnum.tNO
v_udoMD.CanDelete = SAPbobsCOM.BoYesNoEnum.tYES
v_udoMD.CanFind = SAPbobsCOM.BoYesNoEnum.tYES
v_udoMD.CanLog = LogOption
v_udoMD.CanYearTransfer = SAPbobsCOM.BoYesNoEnum.tYES
v_udoMD.ManageSeries = SAPbobsCOM.BoYesNoEnum.tYES
v_udoMD.Code = UDOCode
v_udoMD.Name = UDOName
v_udoMD.TableName = parentTableName
If LogOption = SAPbobsCOM.BoYesNoEnum.tYES Then
v_udoMD.LogTableName = "A" & parentTableName
End If
v_udoMD.ObjectType = UDOType
For i As Int16 = 0 To findAliasNDescription.GetLength(0) - 1
If i > 0 Then v_udoMD.FindColumns.Add()
v_udoMD.FindColumns.ColumnAlias = findAliasNDescription(i, 0)
v_udoMD.FindColumns.ColumnDescription = findAliasNDescription(i, 1)
Next
If childTable1 <> "" Then
v_udoMD.ChildTables.TableName = childTable1
v_udoMD.ChildTables.Add()
End If
If childTable2 <> "" Then
v_udoMD.ChildTables.TableName = childTable2
v_udoMD.ChildTables.Add()
End If
If childTable3 <> "" Then
v_udoMD.ChildTables.TableName = childTable3
v_udoMD.ChildTables.Add()
End If
If v_udoMD.Add() = 0 Then
registerUDO = True
objMain.objApplication.StatusBar.SetText("Successfully Registered UDO >" & UDOCode & ">" & UDOName & " >" & objMain.objCompany.GetLastErrorDescription, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Success)
Else
objMain.objApplication.StatusBar.SetText("Failed to Register UDO >" & UDOCode & ">" & UDOName & " >" & objMain.objCompany.GetLastErrorDescription, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Error)
registerUDO = False
End If
System.Runtime.InteropServices.Marshal.ReleaseComObject(v_udoMD)
v_udoMD = Nothing
GC.Collect()
Catch ex As Exception
End Try
End Function
This is a code for registration of table that will create CFL with mentioned fields.
Hope help this
By
firos.C
Edited by: firoz101 on Aug 18, 2009 6:07 AM
Edited by: firoz101 on Aug 18, 2009 6:08 AM
Edited by: firoz101 on Aug 18, 2009 6:08 AM
Similar Messages
-
How to create IDOC for customer defined table
hi,
How to create IDOC for customer defined table Records and how to send this IDOC to target system.
what message type will be used and on receiving system how to post these records.
thankx.
pillac.Hi,
You need to create a custom message type and custom IDOC type for this with whatever fields you want send. You need to create segments (WE30), IDOC type (WE30), Message types (WE81) and assign the message type to the IDOC type (WE82).
You will have trigger the IDOC using a Report or something after doing the partner profile settings.
Similary in the target system also, you will have do all the settings.
Take a look the links to find out what settings needs to be done.
http://help.sap.com//saphelp_470/helpdata/EN/0b/2a611c507d11d18ee90000e8366fc2/frameset.htm
http://www.sappro.com/downloads/OneClientDistribution.pdf
Regards,
Ravi
Note : Please mark the helpful answers and close the thread if the issue is resolved. -
How to insert records in user defined tables through DI Server API
Hi All,
I have created a UDO using some userdefined tables .I am able to insert records in the user defined tables using DI API but problem is that now I want to insert records in those tables using DI Server API but I dont know how to do that please give me some way to do that
Thanks and Regards
UtpalThe AddObject message is :
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
<env:Header>
<SessionID>...</SessionID>
</env:Header>
<env:Body>
<dis:AddObject xmlns:dis="http://www.sap.com/SBO/DIS">
<BOM>
<BO>
<AdmInfo>
<Object>...</Object>
</AdmInfo>
</BO>
</BOM>
</dis:AddObject>
</env:Body>
</env:Envelope>
How to use it with a user defined table ? -
How do i declare a user defined table type sproc parameter as a local variable?
I have a procedure that uses a user defined table type.
I am trying to redeclare the @accountList parameter into a local variable but it's not working and says that i must declare the scalar variable @accountList.this is the line that is having the issue: must declare the scalar variable @accountListSET @local_accountList = @accountListALTER PROCEDURE [dbo].[sp_DynamicNumberVisits] @accountList AS integer_list_tbltype READONLY
,@startDate NVARCHAR(50)
,@endDate NVARCHAR(50)
AS
BEGIN
DECLARE @local_accountList AS integer_list_tbltype
DECLARE @local_startDate AS NVARCHAR(50)
DECLARE @local_endDate AS NVARCHAR(50)
SET @local_accountList = @accountList
SET @local_startDate = @startDate
SET @local_endDate = @endDate
CREATE TYPE [dbo].[integer_list_tbltype] AS TABLE(
[n] [int] NOT NULL,
PRIMARY KEY CLUSTERED
[n] ASC
)WITH (IGNORE_DUP_KEY = OFF)
GOWhy are you asking how to be an awful SQL programmer?? Your whole approach to SQL is wrong.
We have a DATE data type so your insanely long NVARCHAR(50) of Chinese Unicode strings is absurd. Perhaps you can post your careful research on this? Can you post one example of a fifty character date in any language?
The use of the "sp_" prefix has special meaning in T-SQL dialect. Good SQL programmers do not use CREATE TYPE for anything. It is dialect and useless. It is how OO programmers fake it in SQL.
The design flaw of using a "tbl-" prefix on town names is called "tibbling" and we laugh at it.
There are no lists in RDBMS; all values are shown as scalar values. First Normal Form (1NF)? This looks like a set, which would have a name.
In any -- repeat any -- declarative programming language, we do not use local variables. You have done nothing right at any level. You need more help than forum kludges.
--CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
in Sets / Trees and Hierarchies in SQL -
Make CFL for user defined tables in Crystal Report 8.8 ?
Hi Experts
Use Follwing qry for CFL ( user defined tables) in Crystal Report But its not Show CFL after run the Report in SAP B1 8.8
Period@Select T0.* from @OICC T0
Thanks & Regards
Dinesh LadeHi,
As far as i know, SBO can't figure out in such instance what are you doing, try linking it to an original table.
I usually use OADM for this purpose.
Hope this helps.
Regards,
Daniel -
HOW TO CREATE A GLOBAL USER DEFINED FUNCTION
Hi Expert,
I'd like to know if there is a way to globalize a user defined function?
I'd like to reuse a user defined function (e. g. DeleteLeadingCharacter) in several scenario/SWC instead of recreated it from scratch everytime - Is it possible?
ThanksNO you cannot not reuse one UDF not even in other namespace even in the same namespace in diff Mapping programme.
UDF is liminted to GraphicalMappingProgramme that you created you cannot reuse it in other MappingProgrammes.
Like your MM =A has function <b>getMyName</b>
you can use it in MM=A but if you want to use it in MM=B then u cannot.
So its not possible in XI or PI.
But it is possible in new release PI 7.1. That says you can write UDF and can reuse in any MM programme.
Thanks
Farooq.
*Rewards Points if you find it useful* -
How to create instance of user defined suite
I have create one user defined suite interface (ISuite) and inherite it to IsuiteASB and IsuiteCSB . The purpose of creating user defined suite is to provide hyphenation for selected text. I want to add a method which will detect whether a text has been selected by user or not , if selected then I am calling one hyphator function. I am not able to create an instance of user defined suite . I am using following syntax: <br />in UpdateActionState I am using <br /> InterfacePtr<ISuite>suite(ac->GetContextSelection(),UseDefaultIID()); <br /><br />in one user defined method I am using <br /> InterfacePtr<ISuite>suite(Utils<ISelectionUtils>()->GetActiveSelection() , UseDefaultIID()); <br /><br />Both calls unsuccessfull. <br /><br />Which Interface I should use to detect whether Text has been selected by user or ITextUtils or any other. <br />Please tell me the preoper way to create interface suite and create instance of it. <br />Thank you.
I've seen this wording before ... Wait -- you must be referring to the SDK. Better post your question in the SDK forum, we're just helpless end-users, and in this case, clueless as well.
-
How to create custom(or) user defined component in SAPTAO
Hi,
Please provide me some document or steps on how to create custom component in sap tao.
Thanks a lot in advance.
Regards,
SudhaHi,
If you want create any custom components, you should use SAP QTP to create it.
Here are the simple steps:
i) Go to QTP -> Click on New - > Select Scripted Component - > ((Select SAP_Doc) area (i.e. whatever application area you have created for SAP TAO installation)) -> Record or Write a script based on your requirement & save
ii) Go to QC -> BPT -> open above component and insert the parameters and call these values in QTP script level (either way you can do)
iii) Create a datasheet and declare the parameters in datasheet and call this sheet whenever you have required.
Good luck.
Ram -
How to popup form according to query by CFL for user defined tables?
Hi Experts!
Please write a simple code for adding CFL in UDO and popup the window according to query. suppose i want to execute query
"select code,name from [@WITM]". I want to add CFL in edittext which is on UDO. how can we add CFL in that Edittext by code.
Thanking You
vishwajit kumarHi Vishwajit,
Please response to your previous posting or close it first. Whatever the answer working or not, you need reply.
Thanks,
Gordon -
How to add data in User Defined table
Hello Experts,
I have design form in screen painter , 3 text boxes and labels, 2 add buttons with uid 1 and 2 , and
i have created tables and fields maually and registered new object i have also mentioned table name and alias in property box with fields i have created with userdefined fields as ex: U_age etc and table @EMP in property box
I am loading this form as xml file to SAP B1 every thing works fine but when i click add button no data is added to table what is the problem
Please suggestHi,
Are you using UDO or not?
If not you have to write code by hand for manage data insert, update, search, and so on...
Regards.
Diego -
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 ItemcodeHi,
How can you assign those UDF value without ItemCode in the first place?
Thanks,
Gordon -
How to create a Foreign key relationship between 2 user defined tables...
Hi Folks,
I have created two user defined tables... Where in i want to create foriegn key relationship between the 2 tables.... Can anyone guide the step by step procedure to do this scenario...
Any help would be highly appreciated...
ThanksHi
1. In the 2nd table call the field of the 1st table which is a primary key.
2. Give the same field and dataelement name.
3. Select that field and then click on the foreign key field icon which is beside Search Help button.
4. Then give short text, and the 1st table name.
5. Then in the below box give the 2nd table name and 2nd table field name which you have called from 1st table.
6. Then click on copy, then u will be able to see Check table name and check table field name beside foreign key table name.
7. Then again click on copy.
Regards
Haritha. -
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 -
What the best way to create User defined table with ADDON purpose
Hi folks, how are you ?
I´m beginner in development to business one, and I m studying to develop ISV addons.
But, during my exercises and analisys, I learned that have two ways to create tables and fields in business one. One way is throght by wizard in business one using Tools Menu > Configuration Tools > User Defined Tables >
Obs: I ´m using Business One Patch Level 9.
Other way, is create the tables and fields using DI API
But, my question is. When I develop one addon, or one UDO form that uses one set of user defined tables or used defined fields that where created by the first way (by wizard in B1), how I deploy this in other business one installation ? The package process will ensure the creation of this tables in another enviroment or I must implement the creation of user defined tables using DI API so that this code is called during the installation?
If in cases of addon develop I must use DI API to create user defined tables, How can I use my classes with this responsibility in package process ?
Thanks my friends.Hi Renan,
You just need to put your logic in to the startup of your application, after you've established your connection to the UI API and DI API. All this will be triggered in the constructor of your main class.
namespace MyNamespace
public class MyAddon
bool runAddon = true;
bool initialised = false;
const string ADDON_NAME = "My Addon";
public static void Main()
MyAddon addOn = new MyAddon();
if(runAddon)
System.Windows.Forms.Application.Run();
else
Application.Exit();
public MyAddon()
// Connect to SBO session for UI
if(!SetApplication()) runAddon = false;
private bool SetApplication()
// Code goes in here to establish UI API and DI API connections
// See SDK samples for examples
// You should also define and filter the UI API events your addon will trap at this stage and create any menus
// Call your routine to check if the required UDFs/UDTs exist on this company
initialised = CheckInitialisation();
if (!initialised)
// AddOn not yet intialised on this company so prompt the user to run the intialisation process
int iResponse = app.MessageBox("The " + ADDON_NAME + " addon will now create all required fields and tables."
+ System.Environment.NewLine + System.Environment.NewLine
+ "WARNING: It is strongly recommended that all other users are logged out of this company "
+ "before running this process. Are you sure you wish to continue?", 2, "Yes", "No", "");
if (iResponse == 1) initialised = InitialiseAddOn(); // Call your routine to create the objects
return true;
Kind Regards,
Owen -
how make new table as i need in sap b1 and also tell me how to insert update data in that table
thanks and regards
ParagIf you need to add table using a program, you have to use the UserTableMD object. Once table is created you can add fields using UserFieldsMD object.
Help is available with SDK help center.
Once table is created, you can add data using RecordSet objects, UserTables Objects etc.
You can also create table and fields using SBO (Tools->Customization Tools->User-Defined Tables - Setup...) and
(Tools->Customization Tools->User-Defined Fields - Management...) etc.
Anoop
Maybe you are looking for
-
Lightroom 5.5 is not cataloging all images in some folders
Version: Lightroom 5.5 CC 2014 System: Windows Pro 8.1 R2 64 bit When I last updated my catalog in Lightroom, I discovered that in at least two folders, Lightroom did not catalog all of the images in the actual folder on my computer. Because of the n
-
Family hates 1.9 - how can we get old version back?
We live in Mass and got IMG 1.9 two days ago. We can't stand it. We find the guide and DVR menu is much harder to read; the changed colors and format make it difficult to see at a distance. And its much slower. We can't click through the guide cha
-
Trouble Printing PDF's scanned with Image Capture
OK this is a strange problem. I have Macbook Pro and a Lexmark E230 laser printer which prints everything out just fine in safari, word, pages, numbers - anything except PDF's that are specifially scanned with the Image Capture application. I printe
-
Hi All, We are running a Job through Process chain. But due to some bug it is taking 4 Hrs to complete. We tried executing the Info-Packages manually. It completed with in 30 Mins. So we are planning to create IP group to trigger that Job instead of
-
Deleting Duplicates - Apple dropping the ball for almost 11 years now.
I have searched extensively on this "knowledge" base, but the "genius"es here have had no meaningful input. Just the hollow suggestions that: 1: I sort the files by date added and simply delete the later files, silly. Answer: No. 2. I go