Unable to run user defined table in Query Generator...

hi experts,
                     iam unable to run the user defined table in query generator..this is the query iam using...
Select T0.U_Date from dbo.@ENQHEAD T0 where T0.U_EnqNo='[%0]'
When i run this query it popups a window & asking EnqNo,when i select any enquiry no it's saying an error like----- Incorrect syntax near '@ENQHEAD'. iam unable to solve the above problem can anybody suggest me sme ideas....
thanking you,
shangai.

Hi Shangai,
I've just tried to reproduce the issue and found the following query worked correctly for me:
SELECT T0.[Name] FROM [dbo].[@D01]  T0 WHERE T0.[U_SO]  = '[%0]''
The only difference I can see is the square brackets [] in my query?
Regards,
Niall

Similar Messages

  • 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

  • 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

  • User Defined Table Setting

    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
    Amol

    Hi 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

  • 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

  • Print Layout to User Defined Table

    Hello guyz..
    I want a make preprinted for my user query from user defined table where the header information is from another query.
    I guess, the base template User Report (system) can only show the repetitve data from one query but the header area is not,
    could you help, showing the header information from another query ??
    Thanks Regards

    Ria
    The word is that you cannot use the PLD with user defined tables (i wish it was possible).  So in any case to do that you have to use third party tools such as Crystal Reports and Reporting Services

  • 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
    SAGAR

    The 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

  • Creating user defined table in SBO-COMMON

    Hello experts,
    I'd like to create a user defined table in SBO-COMMON. I'll tell you why:
    I have successfully created a SAP B1 addon which adds freight costs to an order if the total amount is under a certain threshold. We have 2 administrations running, a live one and a test administration. We have put the connectionstring to determine the expense code of the freight costs in the exe.config-file of the addon.
    We want to be able to point the addon from one administration to the other by modifying only one value, a centralized value, independent of SAP administration. The most proper way to do that in my opinion is to put it in SBO-COMMON and the only logical way to do that is a user defined table in SBO-COMMON.
    Is there such a way?
    My alternative is to abuse another database on the server and just add the info there, but I'd prefer to store it in SBO-COMMON.
    Thanks for your time!
    Vincent

    UDT cannot be created in sbo-common. You may create new db and work with table in this db (but it will be not UDT, but standard sql table), or create new company db only for this purposes and create UDT there.

  • 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

  • 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

  • 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

  • Update the data in user-defined table

    Dear All,
    Is there anyway we can insert / update the data in user-defined table in a batch instead of update it from the interface one by one? Our customer has 1,000+ data need to be imported.
    They are on SAP2007A SP00 PL45, SQL 2005, CA localization. Thanks a lot.
    Regards,
    yuka

    Dear Yuka,
    If it is UDT, you may use any SQL query to insert, update it. It is not under SAP support anyway.
    Thanks,
    Gordon

  • 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

  • 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
    Kaja

    Generally 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/

Maybe you are looking for

  • I'm unable to copy text out of an ADE book.

    Recently bought a new Windows PC and transferred all files to it from my old one.  Installed ADE successfully, gave it my authorization ID and all is well.  I'm able to open the book I'm interested in and browse all through it.  But I'm unable to cop

  • Easiest to migrate MS Acess application to Oracle forms/reports

    Hi, I have one application in MS Acess I want to migrate it to Oracle forms 10g, is there any easy way to do this job starting from schema creation upto front end. Thanks and Regards, Khawar.

  • How to unlock a disabled ipod

    my son forgot his pass work for his ipod, not it is disabled and we cant get it going. how can i do it

  • Encoding problem in xls

    Hi All, I have to read information from a txt file, which contains Greek language/characters. Using gui_upload it is uploading and displaying some other character. How to read from the txt file which should return the Greek character. Advance thanks,

  • I cannot download Flash Player.

    On the Flash Player auto-download page, when I click on "Download," the download bar appears at the bottom of my window for a very brief moment and disappears.  Immediately after, I see this: After several seconds, this screen appears: Of course, I "