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 ?
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?
ThanksUsing 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 -
User Defined Table locked when multi users try to save data?
Hi All,
I am having a problem with User Define Table (UDT). I am just checking if somebody having the same problem as mine (any patch level).
I've developed an add-on to save additional data to some UDTs upon saving a Production Order. I added my code in FormDataEvent (After Action = True and ActionSuccess = True).
Here are my sequences to save the data:
1. Start Transaction
2. Remove Existing Data from 3 UDTs linked to the production order number.
3. Save to table 1, using UserTable object
4. Call function A to save to table2 , using UserTable object
5. Call function B to save to table 3, using UserTable object
6. Commit Transaction.
Note: I have a try catch and rollback the transaction if any exception thrown by .NET and SAP. Below are parts of my coding to handle exception from SAP
If oUserTable.Add() <> 0 Then
oCompany.GetLastError(ErrCode, ErrMsg)
Throw New ApplicationException(ErrCode & "-" & ErrMsg)
End If
in the try catch block, i add the following code
If oCompany.InTransaction Then
oCompany.EndTransaction(SAPbobsCOM.BoWfTransOpt.wf_RollBack)
SBO_Application.MessageBox("[SaveRoute]:" & ex.Message)
Return False
End If
Now, the issue is in some occasions, when multi users try to save the Production Order, the data get deleted from the UDTs, but some of the data did not get saved yet it did not throw an exception. From our observation, it only happens when multi users are trying to save to the same table.
Does anybody having the same or similar issue? Really appreciate if you can share on this.
Many Thanks,
Harianto NgI Believe you should look carefully where in your code writting, you should start transaction and be sure of using end.transaction commit if the insert sends a succesfull message, and rollback it for negative message.
I used to start transacción right before .add method
Wha DBMS are u using?
Hope it helps. -
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 RegardsRia
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 -
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,
AlfaI 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 ..... -
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 -
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 AMI 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 -
Problem with user-defined functions in XQuery String
hello
i've a problem with user-defined functions in XQuery String
details are here (the code is not Human-readable via forum's embedded editor ?? strange)
http://docs.google.com/Doc?id=ddqwddsr_21c96d9x
thanks !!See
michaels> select xmlquery('declare function local:test_function($namecmp as xs:string?, $inputtype as xs:string?) as xs:string?
return {$inputtype}
local:test_function("1","2")' returning content) o from dual
Error at line 5
ORA-19114: error during parsing the XQuery expression:
LPX-00801: XQuery syntax error at '{'
3 return {$inputtype}
- ^
michaels> select xmlquery('declare function local:test_function($namecmp as xs:string?, $inputtype as xs:string?) as xs:string?
$inputtype
local:test_function("1","2")' returning content) o from dual
O
2
1 row selected. -
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 -
Problems adding new rows to a simple user defined table manually
Hi
I have just created a user defined table ( SAP 2007 SP01 PL9 ) but when I try to add a line using tools ->userdefined tables I get the following error -
conversion failed when converting the nvarchar value '-3 @GLMAP to data type int ( CINF )
The table is called GLMAP and I simply added 3 alpha fields
I put 1 into all the fields on screen
Can anyone suggest anything please as ideally I would like the end user to be able to update this simple table
Many thanks
Regards AndyAndy
I think in your case you have used DBDataSource to display data from UDT on your form.
Easyier to use UDO than User Defined Table, because you do not have to programming at UDO based forms.
What István tried to say:
Check your sp_transactionnotification procedure, maybe you have used @object_type variable as integer instead of nvarchar
Regards
J -
Error while linking user defined table to user defined field using vb6.0
Hi,
I am creating a userdefined field on a SAPB1 table(PDN1) using vb 6.0
I am trying to link this field to a user defined table.
When i do that i get the following error:
"The field 'Related table' should consist of 8 alphanumeric chracters with no valid or default values"
When i try to do the same thing from SAPB1(not using code) there is no such problem.
My vb code is as follows:
Set oUserFieldsMD = oCmp.GetBusinessObject(oUserFields)
oUserFieldsMD.TableName = "PDN1"
oUserFieldsMD.Name = "OB_Locn"
oUserFieldsMD.Description = "WH Location"
oUserFieldsMD.Type = db_Alpha
oUserFieldsMD.EditSize = 30
lRetCode = oUserFieldsMD.Add
If lRetCode <> 0 Then
oCmp.GetLastError lErrCode, sErrMsg
MsgBox sErrMsg
GoTo Err_
End If
If Not oUserFieldsMD.GetByKey("PDN1", 0) Then
MsgBox "Error"
GoTo Err_
End If
oUserFieldsMD.LinkedTable = "OB_TEST"
lRetCode = oUserFieldsMD.Update
Your help will be much appreciated.
Thanks.Great Sébastien!
Looks like we could not survive here one day without your contribution
Best regards,
Frank
PS: For readers of this thread who don't understand why
EditSize
must be "8":
This is the size of the
Code
field in the user-defined table to which the new field OB_Locn (in the DB it will be U_OB_Locn) is linked to...
So, it should be preferrably of the same size. -
User defined table types sometimes show up a unknown data type in Profiler
A couple of our users have a problem when using user defined table types. Calls are made using UDTT as variables and these are then passed to a stored procedure as parameters. Sometimes the application returns a timeout. In such situations a Profiler-Trace
shows the following:
declare @p4 unknown
whereas the correct trace (that is sometimes displayed) should be:
declare @p4 dbo.ReportFilterTableType
ReportFilterTableType is a UDTT. The users do have correct permissions for the UDTT (otherwise they would never be usable for the user). What could be the reason that the data types for the variable
@p4 in the example are sometimes returned as unknown and at other times are returned correctly as
ReportFilterTableType? Could this possibly be a network related issue?
Thank you.
Graham Goodwin Email: [email protected]I know this is a old post, but i am also facing the same issue that too in my production server. Did you find any workarround for this issue. Please do reply. Critical problem we are facing.
Alka, Is your problem timeouts when passing TVP parameters, or is it that a Profiler Trace shows type "unknown" for the TVP data type name?
If your problem is timeouts, be aware that TVPs do not have statistics so the optimizer might not be able to generate an optimal plan for non-trivial queries. Declaring a primary key or unique constraint on the table type may help since that will provide
useful cardinality information. You may need to resort to hints in some cases.
I suggest you start a new thread with details of your specific situation if the information in this thread doesn't help.
Dan Guzman, SQL Server MVP, http://www.dbdelta.com -
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 ? -
Display of document line items with user defined fields
Hi all,
I have created two user defined fields in CI_COBL structure and they are available on OBC4 screen. I maintained optinal for entry in the screen layout. I posted one document with user defined fields and saved.
Now the document is updated in BSEG table. I then display the document, and it display the doucment
But when i double click on the one of the line items system gives an error that there is some problem in customising and entries missing in Table COBM.
I checked OXK3 and see that in field information for user fields, it says entries maintained in table COBM.
But still i couldnt display my line items in detail.
Any solutions
Thanks in advance
RamYes your are looking at the correct sap note.
Things look pretty straight forward in the notes documentation.
1)Extend the VBKRED structure with the fields you want.
2)Populate thse values in the user exit in program DBKMVF02 in FORM routine USER_EXIT_FUELLEN_XVBKRED.
For extending a standard structure you need to create a zstructuree in se11 first and then append it to the standard structure.
In your case you need to extend VBKRED_EX1 structure rather than VBKRED.
Regards,
ravi -
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.
Maybe you are looking for
-
Error:Cannot add row without complete selection of batch/serial numbers Dim oPDN As SAPbobsCOM.Documents oPDN = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseDeliveryNotes) Dim serno As String = "SH-A
-
Keyboard & Mouse hp kg-0851 keyboard
The mouse is defective on this combo. Will the keyboard work independently if I purchase another mouse? This question was solved. View Solution.
-
Are there any tutorials on the basics of using iBook Author?
I am an established author and want to use iBook Author to make some of my op material (where I have secured all rights)to be made available again. I have to adapt the iBook Author templates to accomodate the pages. I need help learning how to do t
-
Modifying Existing Time Dimension
Hi All, Presently I have a Time Dimension and a Fact table which has a FK to this Dimension. The Time Dim has a level upto hourly values. Now it's in production and I need to change the Time Dim to take on minutes 'cause some reports need minutes. 1.
-
Hi, I'm using RequestDispatcher include method to include HTML files in my servlet. What I want to do however is include HTML files situated on a separate server in a separate domain. However even though I preface the address with http://xxxx/myfile.