Query SQL with variables Parameters and user defined tables

Hi  everyone
I got a problem about Query SQL
[dbo].[@CSOURCE]  is a user defined table
select * from [dbo].[@CSOURCE]
you can get the result in following
code    name
T01      newspaper
T02      TV
T03      radio
T04      friends
when I execute the following SQL   Statements ,I get an error
SELECT T0.CardCode , 0.CardName ,T1.Name ,T2.SONumber
FROM OCRD T0    LEFT JOIN [dbo].[@CSOURCE]  T1 ON T0.U_CSOURCE = T1.Code
                             LEFT JOIN (SELECT  T0.CardCode ,COUNT(T0.DocNum)SONumber
                             FROM ODLN T0  INNER JOIN OCRD T1 ON T0.CardCode = T1.CardCode
                            WHERE T1.GroupCode =111
                            AND   (T0.DocDate >=[%0] or [%0]='')
                            AND   (T0.DocDate <=[%1] or [%1]='')   
                            GROUP BY T0.CardCode) T2 ON T0.CardCode=T2.CardCode
WHERE T0.GroupCode =111
and  T0.CardType ='C
Is there anyone can correct it for me
thank you very much
Edited by: Li Mishan on Jul 17, 2008 9:36 AM
Edited by: Li Mishan on Jul 17, 2008 9:40 AM

I am sorry .It is just a mistake of my typewriting.
The following is the whole SQL
dbo.@CSOURCE is a user table.It's content is
code  name
T01    newspaper
T02    TV
T03    radio
T04    friends
declare @m int
declare @FromDate DateTime
declare @ToDate DateTime
set @m=(SELECT count(*)  FROM ORDR T0 WHERE T0.DocDate >=[%0] and  T0.DocDate <=[%1])
set  @FromDate=[%0]
set  @ToDate=[%1]
/*****************If I do not connect user tavble dbo.@CSOURCE ,I will succed *****************************************************/
SELECT T0.CardCode ,T0.CardName ,T2.SONumber,T1.Name
FROM OCRD T0  LEFT JOIN [dbo].[@CSOURCE] T1 ON T0.U_CSOURCE = T1.Code
                           LEFT JOIN (
                                            SELECT T0.CardCode ,COUNT(T0.DocNum)SONumber                                            FROM ODLN T0 INNER JOIN OCRD T1 ON T0.CardCode = T1.CardCode
                                            WHERE T1.GroupCode =111
                                            AND (T0.DocDate >=@FromDate or @FromDate='')
                                            AND (T0.DocDate <=@ToDate  or  @ToDate ='')                                                                               
GROUP BY T0.CardCode
                                        ) T2 ON T0.CardCode=T2.CardCode
WHERE T0.GroupCode =111
and T0.CardType ='C'
when I excute the SQL, It return a error , whith says the column name '%0'  is invalid.
If I delete "set @m=(SELECT count(*)  FROM ORDR T0 WHERE T0.DocDate >=[%0] and  T0.DocDate <=[%1])"
and rewrite "set  @FromDate='2008.05.01' set  @ToDate='2008.07.01' "
It Shows the following results
   CardCode     CardName     SONumber     name
1      000070        Deng. Jiahua   1                newspaper
2      000293        LU .Weijuan    1                radio
3      000313         Xie .Jifang       3               TV
Edited by: Li Mishan on Jul 18, 2008 4:42 AM
Edited by: Li Mishan on Jul 18, 2008 4:43 AM
Edited by: Li Mishan on Jul 18, 2008 5:43 AM

Similar Messages

  • Dealing with User Defined Tables with the DI Server

    I have a general question about the best way of working with the data in user defined tables using the DI Server. It appears from previous posts that it is not possible to use the standard methods such as UpdateObject. Also since update/insert and delete statements or explicitly forbidden using the ExecuteSQL method then how do we interact with the data in the tables?
    Do we need to code our own data access layer for this type of access and is this a good practice?
    Is this type of functionality going to be available in a future release of the DI Server?
    Thanks

    Using SQL for Update/Insert/Delete is not forbidden on UDTs (at least non-UDO UDTs; UDO UDTs are somehow in a gray area since they carry internal fields + e.g. inserts require further manipulation in B1 tables...)...
    I.e. using ExecuteSQL to add data into UDTs is OK for DI Server...
    HTH,
    Frank

  • Calling ORACLE Store Procedure with parameters in user define function

    Hi everybody,
    We have a scenario connecting Oracle DB thru JDBC adapter.
    We have to call store procedure with input parameter and output parameter to retrieve data from DB. The implementation was made using JDBC adapter by building the correct XML message with EXECUTE action, and it works fine.
    Now we need to use DB lookup within mapping. I wrote users define function with SELECT statement (using the JDBC adapter) and it works fine but I need to call store procedure in ORACLE instead of SELECT statement.
    I found lot of examples concerning DB lookup but none of them explained how to write UDF calling store procedure in ORACLE with input and output parameters.
    I am looking for an example.
    Thanks in advance,
    Gigi

    I agree with you, but issue is we have lots of existing store procedure, which we need to call where damn required. I am sure those will be few but still i need to find out.
    If you think you are going to get existing MS Stored Procedures  or Oracle Packages that had nothing to do with the ORM previously to work that are not geared to do simple CRUD operations with the ORM and the database tables, you have a rude awakening
    coming that's for sure. You had better look into using ADO.NET and Oracle Command objects and call those Oracle Packages by those means and use a datareader.
    You could use the EF backdoor, call Oracle Command object and use the Packages,  if that's even possible, just like you can use MS SQL Server Stored Procedures or in-line T-SQL via the EF backdoor.
    That's about your best shot.
    http://blogs.msdn.com/b/alexj/archive/2009/11/07/tip-41-how-to-execute-t-sql-directly-against-the-database.aspx

  • CANT execute query with parameter on user defined tables using query genera

    Dear All,
    I have problem when executing query with parameter on user defined tables using query generator.
    It seems SBO cannot accept parameter to query user defined tables.
    I've tried these:
    SELECT T0.U_Status FROM [@ST_PR_H] T0 WHERE T0.U_Status = [%0] --- this FAIL
    I try to pass the value directly without using parameter and It works
    SELECT T0.U_Status FROM [@ST_PR_H] T0 WHERE T0.U_Status = 2 --- this SUCCESS
    This one works
    SELECT * FROM RDOC T0 WHERE T0.width =[%0]  --- this SUCCESS
    and this one works too
    SELECT * FROM RDOC T0 WHERE T0.width = 595  --- this SUCCESS
    Is there anyone can help me ....???
    Thanks,
    Alfa

    I  generated this code using query wizard ....
    SELECT T0.[U_Status] AS 'Document Status' FROM  [dbo].[@ST_PR_H] T0  WHERE T0.[U_Status] = (N'2' )
    and replaced the (N'2' ) with [%0]
    SELECT T0.[U_Status] AS 'Document Status' FROM  [dbo].[@ST_PR_H] T0  WHERE T0.[U_Status] = [%0]
    and It worked ......
    Thanks 4 all .....

  • Using SQL query on user defined table

    Hi all,
    i'am currently working on a project which use user defined table and i would like to know if sap allow us to do insertion/deletion/update on those table using sql query or if we have to use the DI only?
    thanks
    Best regards,

    Hi,
    Definitely you can insert in UDT. You can update but you cant change the Code field after added the rest of the field
    can be updated. You cant delete in UDT but you cant delete anytime in SQL Management Studio.
    THanks.
    CLint

  • 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)
    GO

    Why 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

  • How to Execute User Defined Table in SQL?

    Hi Experts
    I have User Defined Table @SIN_MPLN in SAP B1 , i stored value in that User Defined Table and  if i execute that Table Through Query Generator it shows me value. it works fine.
    But when i go to SQL Server 2008 R2 and trying to execute this as..
    select * from @SIN_MPLN
    then it gives me Error --> Must declare the table variable "@SIN_MPLN"
    so please give me the answer
    Thanks

    Hello Navanath,
    Nagarajan's answer is correct.
    select * from [@SIN_MPLN] wil also work. the prefix "dbo" is not mandatory.
    Best Regards Teun

  • UDT and UDF - User-defined Tables and Fields

    Dear All,
    I am writing a Query to permit the Cashier to check her Cash entries and balances on a Daily basis.
    Basically, it's a General Ledger, but I want the Query - Selection Criteria window to display only a few GL codes namely GL codes 1240601, 1240602, 1240603 etc.
    I don't know if I am doing it right. This is what I did (SAP B1 8.8):
    UDT
    I created a UDT called TEST2 using:
    Tools -> Customization Tools -> User-defined Tables - Setup
    UDF
    Then I created a field in the UDT called GlCod using User-Defined Fields - Management
    Title : GlCod
    Description : GL Code
    Type : Alphanumeric 30
    Field Data
    In the Field Data window, I ticked the Set Valid Values for Fields checkbox and filled in the blanks as follows:
    #                  Value                Description
    1                 1240601             Cash in Hand (Rs)
    2                 1240602             Cash in Hand (USD Notes)
    3                 1240603             Cash in Hand (Euro Notes)
    etc...
    Query
    Then I wrote my Query (see below).
    When I run it, I get the Selection Criteria screen as I wanted:
    Query - Selection Criteria
    GL Code                                   ...............   (arrow here)
    Posting Date                              ...............
    [OK]                [Cancel]
    When I click on the GL Code arrow, I get a window with the exact choices I need. It looks like this:
    1240601 -  Cash in Hand (Rs)
    1240602 -  Cash in Hand (USD Notes)
    1240603 -  Cash in Hand (Euro Notes)
    Executing the Query
    The Query seems to run normally, but nothing is generated on the screen, and there's no Error Message.
    What can be wrong about this query?
    I suspect that the GL codes in JDT1 and TEST2 are not of the same data type, so that INNER JOIN returns nothing.
    Thanks,
    Leon Lai
    Here's my SQL
    declare @TEST2 TABLE
    (GlCod varchar(30))
    declare @GlCod nvarchar (30)
    set @GlCod =/*SELECT T0.U_GlCod from [dbo].[@TEST2] T0 where T0.U_GlCod=*/  '[%0]'
    declare @refdt datetime
    set @ref=/*SELECT T1.RefDate from [dbo].[JDT1] T1 where T1.RefDate=*/ '[%1]'
    select
    t1.Account as 'GL Code',
    t1.RefDate as 'Posting Date',
    t0.U_GlCod as 'Restricted GL Codes'
    from JDT1 T1
    INNER JOIN @TEST2 T0 ON T0.[U_GlCod] = T1.[Account]
    WHERE
    t1.RefDate <= @refdt
    and
    t0.U_GLCod = @GlCod

    Try this:
    declare @GlCod nvarchar (30)
    set @GlCod =/*SELECT T0.U_GlCod from [dbo].[@TEST2] T0 where T0.U_GlCod=*/  '[%0]'
    declare @refdt datetime
    set @refdt=/*SELECT T1.RefDate from [dbo].[JDT1] T1 where T1.RefDate=*/ '[%1]'
    select
    t1.Account as 'GL Code',
    t1.RefDate as 'Posting Date'
    from JDT1 T1
    WHERE
    t1.RefDate <= @refdt
      and
    T1.[Account] = @GlCod
    (There is no need to declare the memoria table @test2 if you already created one table with this name.
    And there is no need to a join.)
    Edited by: István Korös on Aug 15, 2011 1:27 PM

  • How to read and write data to a user defined table?

    I have created a srf with 2 edit box and a ok buttin, I want to insert data to the user defined table i created using sql query while i press OK button..
    Please provide the complete code to insert and select da from the user defined table.

    Hi,
    You can use the code below.
    Dim ret As Long
    d
    Private Sub Add_Table_Click()
        Dim oUserTablesMD As SAPbobsCOM.UserTablesMD
        Set oUserTablesMD = oCompany.GetBusinessObject(oUserTables)
        ' When adding user tables or fields, use a prefix
        ' identifying your partner name space. This will
        ' prevent collisions from different partner add-ons
        ' SAP's name space prefix is "BE_"
        'Set the two mandatory fields
        oUserTablesMD.TableName = "T1"
        oUserTablesMD.TableDescription = "Table1"
        'Add the table (which contains 2 default, mandatory fields, 'Code' and 'Name')
        ret = oUserTablesMD.Add
        If ret <> 0 Then
            oCompany.GetLastError ret, Str
            MsgBox Str
        Else
            MsgBox "Table: " & oUserTablesMD.TableName & " was added successfully"
        End If
    End Sub
    Private Sub Add_UDF_Click()
        Dim oUserFieldsMD As SAPbobsCOM.UserFieldsMD
        Set oUserFieldsMD = oCompany.GetBusinessObject(oUserFields)
        oUserFieldsMD.TableName = "T1"
        oUserFieldsMD.Name = "AlbUDF"
        oUserFieldsMD.Description = "Albert UDF"
        'Add the field to the table
        lRetCode = oUserFieldsMD.Add
        If lRetCode <> 0 Then
            oCompany.GetLastError ret, Str
            MsgBox Str
        Else
            MsgBox "Field: '" & oUserFieldsMD.Name & "' was added successfuly to " & oUserFieldsMD.TableName & " Table"
        End If
    End Sub
    Private Sub Add_Data_Click()
        Dim oUserTable As SAPbobsCOM.UserTable
        Set oUserTable = oCompany.UserTables.Item(1)
        oUserTable.GetByKey ("T1")
        'Set default, mandatory fields
        oUserTable.Code = "A"
        oUserTable.Name = "Albert"
        'Set user field
        oUserTable.UserFields.Fields.Item("U_AlbUDF").Value = "1"
        oUserTable.Add
        If ret <> 0 Then
            oCompany.GetLastError ret, Str
            MsgBox Str
        Else
            MsgBox "Value to field: '" & oUserTable.UserFields.Fields.Item("U_AlbUDF").Name & "' was updated successfuly to " & oUserTable.TableName & " Table"
        End If
    End Sub
    Regards,
    Noor

  • Calling Oracle stored procedure with out param of user define type from Entity Framework 5 with code first

    Guys i am using Entity Framework 5 code first (I am not using edmx) with Oracle and all works good, Now i am trying to get data from stored procedure which is under package but stored procedure have out param which is user define type, Now my question is
    how i will call stored procedure from entity framework
    Thanks in advance.

    I agree with you, but issue is we have lots of existing store procedure, which we need to call where damn required. I am sure those will be few but still i need to find out.
    If you think you are going to get existing MS Stored Procedures  or Oracle Packages that had nothing to do with the ORM previously to work that are not geared to do simple CRUD operations with the ORM and the database tables, you have a rude awakening
    coming that's for sure. You had better look into using ADO.NET and Oracle Command objects and call those Oracle Packages by those means and use a datareader.
    You could use the EF backdoor, call Oracle Command object and use the Packages,  if that's even possible, just like you can use MS SQL Server Stored Procedures or in-line T-SQL via the EF backdoor.
    That's about your best shot.
    http://blogs.msdn.com/b/alexj/archive/2009/11/07/tip-41-how-to-execute-t-sql-directly-against-the-database.aspx

  • Problem in EIS with "user-defined table"

    Platform : z/osrdbms : db2 v7Olap : Db2OlapMy problem :I try to make a "User-Defined table" in a meta-model whith this SQL definitionselect a.idele, a.idele0, b.lbele from u1g.fordv0 a, u1g.eledv0 b where a.iddim = 4 and a.idarb = 10 and a.idele = b.idele and a.iddim = b.iddim(description of the two simple table :CREATE TABLE U1G.ARBD ( IDDIM INTEGER NOT NULL, IDARB INTEGER NOT NULL, LBARB VARCHAR(255) NOT NULL, DTCRE TIMESTAMP NOT NULL WITH DEFAULT, DTMAJ TIMESTAMP ) CREATE TABLE U1G.ELED ( IDDIM INTEGER NOT NULL, IDELE INTEGER NOT NULL, LBELE VARCHAR(255) NOT NULL, DDVAL DATE NOT NULL, DFVAL DATE, DTCRE TIMESTAMP NOT NULL WITH DEFAULT, DTMAJ TIMESTAMP, MDCEL CHAR(1) NOT NULL, TYPE CHAR(1) NOT NULL ) )When i look at this "user-defined table" data in the meta model, it's okWhen i try to use this table as a dimension in a meta-outiline, it's okexcept when i try to load members in a cube.The load result say "the load terminated with errors"I look in the IS log :?Tue Jul 27 10:56:40 2004~ /IS/Worker/0x0/1090922163/Error/-104/Build-PQ72292 {DB2 for OS/390}{ODBC Driver}{DSN07011} DSNT408I SQLCODE = -104, ERROR: ILLEGAL SYMBOL ".". SOME SYMBOLS THAT MIGHT BE LEGAL ARE: + - AS <IDENTIFIER> DSNT418I SQLSTATE = 42601 SQLSTATE RETURN CODE DSNT415I SQLERRP = DSNHPARS SQL PROCEDURE DETECTING ERROR DSNT416I SQLERRD = 0 0 0 -1 69 0 SQL DIAGNOSTIC INFORMATION DSNT416I SQLERRD = X'00000000' X'00000000' X'00000000' X'FFFFFFFF' X'00000045' X'00000000' SQL DIAGNOSTIC INFORMATION ERRLOC=1:13:1 ?Tue Jul 27 10:56:40 2004~ /IS/Worker/0x0/1090922163/Informational/-104/Build-PQ72292 SELECT. aa."IDELE0", aa."IDELE", aa."LBELE" FROM.(select a."idele" .., a."idele0" .., b."lbele" from u1g.fordv0 a, u1g."eledv0" b where a.iddim = 4 and a.idarb = 10 and a.idele = b.idele and a.iddim = b.iddim) aaI don't understand why it's working in the meta model (the sql is good, i got the data)and why it's not working in the meta outline ?

    Platform : z/osrdbms : db2 v7Olap : Db2OlapMy problem :I try to make a "User-Defined table" in a meta-model whith this SQL definitionselect a.idele, a.idele0, b.lbele from u1g.fordv0 a, u1g.eledv0 b where a.iddim = 4 and a.idarb = 10 and a.idele = b.idele and a.iddim = b.iddim(description of the two simple table :CREATE TABLE U1G.ARBD ( IDDIM INTEGER NOT NULL, IDARB INTEGER NOT NULL, LBARB VARCHAR(255) NOT NULL, DTCRE TIMESTAMP NOT NULL WITH DEFAULT, DTMAJ TIMESTAMP ) CREATE TABLE U1G.ELED ( IDDIM INTEGER NOT NULL, IDELE INTEGER NOT NULL, LBELE VARCHAR(255) NOT NULL, DDVAL DATE NOT NULL, DFVAL DATE, DTCRE TIMESTAMP NOT NULL WITH DEFAULT, DTMAJ TIMESTAMP, MDCEL CHAR(1) NOT NULL, TYPE CHAR(1) NOT NULL ) )When i look at this "user-defined table" data in the meta model, it's okWhen i try to use this table as a dimension in a meta-outiline, it's okexcept when i try to load members in a cube.The load result say "the load terminated with errors"I look in the IS log :?Tue Jul 27 10:56:40 2004~ /IS/Worker/0x0/1090922163/Error/-104/Build-PQ72292 {DB2 for OS/390}{ODBC Driver}{DSN07011} DSNT408I SQLCODE = -104, ERROR: ILLEGAL SYMBOL ".". SOME SYMBOLS THAT MIGHT BE LEGAL ARE: + - AS <IDENTIFIER> DSNT418I SQLSTATE = 42601 SQLSTATE RETURN CODE DSNT415I SQLERRP = DSNHPARS SQL PROCEDURE DETECTING ERROR DSNT416I SQLERRD = 0 0 0 -1 69 0 SQL DIAGNOSTIC INFORMATION DSNT416I SQLERRD = X'00000000' X'00000000' X'00000000' X'FFFFFFFF' X'00000045' X'00000000' SQL DIAGNOSTIC INFORMATION ERRLOC=1:13:1 ?Tue Jul 27 10:56:40 2004~ /IS/Worker/0x0/1090922163/Informational/-104/Build-PQ72292 SELECT. aa."IDELE0", aa."IDELE", aa."LBELE" FROM.(select a."idele" .., a."idele0" .., b."lbele" from u1g.fordv0 a, u1g."eledv0" b where a.iddim = 4 and a.idarb = 10 and a.idele = b.idele and a.iddim = b.iddim) aaI don't understand why it's working in the meta model (the sql is good, i got the data)and why it's not working in the meta outline ?

  • User define table and store procedure install

    Hi there,
    I like to deploy an addon, there are User define tables and store procedure need add to database, I wonder which chance is properly to add them, if add these user define objects in time of install, we can not get the enough information that connect to SQL server, and also create UDT need DIAPI. if put create UDT and UDsp in addon program, the problem is which DIAPI funciton or object can execute create store procedure SQL string.
    Thanks for any help.
    Lanjun

    R. Schwachofer,
    Thank you very much,
    the way call isqlw.exe to run SQL script is a good way when install, but I confuse with two questions about this way. first, run isqlw.exe should provid loginid and password of SQL server, these two information need additional install dialog to get; second if use isqlw.exe the store procedure only create to the current company database, when create new compay DB the store procedure does not exist in new DB.
    so I still do not know which way is the proper way to create SP for addon.
    Thanks in advance.
    Lanjun

  • Syntax error when creating a user-defined table type in SQL Server 2012

    Why am I getting a syntax error when creating a user-defined table type in SQL Server 2014?
    CREATE TYPE ReportsTableType AS TABLE 
    ( reportId INT
    , questionId INT
    , questionOrder INT );
    Results:
    Msg 156, Level 15, State 1, Line 1
    Incorrect syntax near the keyword 'AS'.

    Hope these posts could help, 
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/37a45a9a-ed8c-4655-be93-f6e6d5ef44be/getting-incorrect-syntax-while-creating-a-table-type-in-sql-server-2008-r2?forum=transactsql
    Regards, Dineshkumar,
    Please Mark as Answer if my post answers your question and
    Vote as Helpful if it helps you

  • 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

  • User defined Table and matrix problem

    Hi,
    I have a user defined table. I am displaying data from this table using DBdataSource on a matrix in my form. After making changes to a cell on the matrix when i try to save the data back to the data source, the changes are not updated. I am using SBO2004 and using FlushToDataSource method to save the changes.
    Please help.
    Thanks.

    Fabio,
    I disagree with you, FlushtoDataSource does work on user form too.
    Once you use this function, you'll have to open a the userTable object, and save the records from the DBDataSource object to the table using this object.
    Sébastien

Maybe you are looking for

  • HP Officejet Pro 8000 A809

    after installing Snow Leopard I have been getting error messages saying the software for the printer was installed wrongly. I am then invited to authenticate, and it runs off and 'repairs permissions' then prints.. Doesn't say what permissions and th

  • Application exe file cannot get FieldPoint data

    I built an application exe file from my development notebook computer (Win XP) that have LV7.1 and Max 3.1. The stand alone exe file runs well in the same notebook. But it could not get any FP data when it is running from a target computer (Win 2000)

  • App Catalogue does not open

    I am a Volunteer here, not employed by HP. You too can become an HP Expert! Details HERE! If my post has helped you, click the Kudos Thumbs up! If it solved your issue, Click the "Accept as Solution" button so others can benefit from the question you

  • PO_CREATE  error Buffer table not up to date

    Hi experts , I am create PO using a BAPI, BAPI_POEC_CREATE.And I can see the return messages from this FM its saying that u201C PO has been creating with some numberu201D But I am not able to find the PO in my system  . And I tried to save and commit

  • How I can create dynamically-formed requests or use native SQL in EJB?

    Hi all. I'm working around modify an example from NetWeaver Developer Studio (CarRental). I want to get ordered data from table and allow users to specify the ordering field, not in the code. EJB QL doesn't support dynamically-formed queries like "se