Updating User Tables
Hi,
I need some clarification on the following. If i were to call an update in the in the DoQuery(RS.DoQuery("<update statement>")) method am i violating SAP rules? I am basically updating my own user table. I know for sure i cant do that with system tables as business objects are provided for that but can i do it for user defined tables?
Please reply at the earliest.
Regards
Aris.
Actually it is because this is for a master data row table.. If you check the thread on Updating master tables that i posted u'l understand what im looking to do.. Thanks for the reply..
Regards
Aris
Similar Messages
-
Hi I've created a matrix in a new tab on the Item Master data form. It loads data from a user table called @Test. This table has 2 udf U_Model and U_Engine. The matrix uses a datatable to query the table. Is there a way to update the table? this is my code:
// Adding a Matrix item
oNewItem = oForm.Items.Add( "Matrix1", SAPbouiCOM.BoFormItemTypes.it_MATRIX );
oNewItem.Left = 5;
oNewItem.Width = 400;
oNewItem.Top = 200;
oNewItem.Height = 150;
oNewItem.FromPane = 8;
oNewItem.ToPane = 8;
oMatrix = ( ( SAPbouiCOM.Matrix )( oNewItem.Specific ) );
oColumns = oMatrix.Columns;
// Adding Culomn items to the matrix
oColumn = oColumns.Add( "#", SAPbouiCOM.BoFormItemTypes.it_EDIT );
oColumn.TitleObject.Caption = "#";
oColumn.Width = 30;
oColumn.Editable = false;
oColumn = oColumns.Add("Code", SAPbouiCOM.BoFormItemTypes.it_EDIT);
oColumn.TitleObject.Caption = "Code";
oColumn.Width = 20;
oColumn.Editable = true;
oColumn = oColumns.Add("Name", SAPbouiCOM.BoFormItemTypes.it_EDIT);
oColumn.TitleObject.Caption = "Name";
oColumn.Width = 20;
oColumn.Editable = true;
oColumn = oColumns.Add("Model", SAPbouiCOM.BoFormItemTypes.it_EDIT);
oColumn.TitleObject.Caption = "Model";
oColumn.Width = 20;
oColumn.Editable = true;
// Add a column for Name
oColumn = oColumns.Add( "Engine", SAPbouiCOM.BoFormItemTypes.it_COMBO_BOX );
oColumn.TitleObject.Caption = "Engine";
oColumn.Width = 20;
//Add Valid Values
oColumn.ValidValues.Add("10", "");
oColumn.ValidValues.Add("12", "");
oColumn.ValidValues.Add("32", "");
oColumn.ValidValues.Add("42", "");
oColumn.ValidValues.Add("52", "");
oColumn.ValidValues.Add("62", "");
dbDatasource = (oForm.DataSources.DBDataSources.Add("@Test"));
DBTable = (oForm.DataSources.DataTables.Add("MyDataTable"));
oMatrix.SelectionMode = SAPbouiCOM.BoMatrixSelect.ms_Single;
oItem = oForm.Items.Item("5");
oEdit = ((SAPbouiCOM.EditText)(oItem.Specific));
string item = oEdit.Value.ToString();
oForm.DataSources.DataTables.Item( 0 ).ExecuteQuery( "SELECT Code, Name, U_Model, U_Engine from [@Test] where U_ItemCd = '" + item +"' ");
oColumn = oColumns.Item("Code");
oColumn.DataBind.Bind("MyDataTable", "Code");
oColumn = oColumns.Item("Name");
oColumn.DataBind.Bind("MyDataTable", "Name");
oColumn = oColumns.Item( "Model" );
oColumn.DataBind.Bind("MyDataTable", "U_Model");
oColumn = oColumns.Item("Engine");
oColumn.DataBind.Bind("MyDataTable", "U_Engine");
oMatrix.Clear();
oMatrix.AutoResizeColumns();
oMatrix.LoadFromDataSource();Hi Costas,
You can use Matrix.FlushToDataSource() to save the data in the Matrix into the datasource.
But if you want to update the data in the DB, you have to use DI API.
Regards,
Jay. -
Updating user table (type document) via api
hi!
i need to update an user table that is of type document.
that table is also used as the client table in an udo.
i have tried the following code, but that of course doesn't work as the table is not a plain table but is of document type:
Dim objUserTable As SAPbobsCOM.UserTable
Set objUserTable = objCom.UserTables.Item("MP_TABLE_LINE")
If objUserTable.GetByKey(objMatrix.Columns.Item("U_MP_BEnt").Cells.Item(lngRow).Specific.Value) Then
objUserTable.UserFields.Fields.Item("U_Qty").Value = _
objUserTable.UserFields.Fields.Item("U_Qty").Value - dblDiff
If Not objUserTable.Update() <> 0 Then
Call objApp.SetStatusBarMessage(objCom.GetLastErrorDescription())
Call objApp.MessageBox(objCom.GetLastErrorDescription())
Else
objMatrix.Columns.Item("U_MP_BQty").Cells.Item(lngRow).Specific.String = _
objMatrix.Columns.Item("11").Cells.Item(lngRow).Specific.String
End If
End If
Set objUserTable = Nothing
then i tried to use a dbdatasource which i would expect to work:
Dim objDataSource As DBDataSource
Set objDataSource = objForm.DataSources.DBDataSources.Item("@MP_TABLE_LINE")
Dim objConditions As New SAPbouiCOM.Conditions
Dim objCond As SAPbouiCOM.Condition
<just setting up conditions here>
Call objDataSource.Query(objConditions)
Call objDataSource.SetValue("U_Qty", 0, objDataSource.GetValue("U_Qty", 0) - dblDiff)
but this only results in an error code "-7006", message:
"Item - The item is not a user defined item"
how can the update be done?
regards,
thomasHi Thomas,
U are using UserTabel Obejct , just try to Use UserTabelMD object
i am sending to how to create the User Table,
Hope it will help to
oUTb = mobjCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserTables)
If Not oUTb.GetByKey("SPH_FORMS") Then
oUTb.TableName = "SPH_FORMS"
oUTb.TableDescription = "Activity Forms"
oUTb.TableType = SAPbobsCOM.BoUTBTableType.bott_MasterData
If oUTb.Add <> 0 Then
mobjCompany.GetLastError(lRet, sErrMsg)
Else
oUTb = Nothing
end if
be carefull before using MD object , bcoz at a time only one MD object should be in memory else it will give to Error
Thanks
Ankush Vachher -
Adding & updating user tables with DI
Hi, how to I add & update records of a user defined table with DI? Is there an object for this, or do I just do a DoQuery(insert etc) ?
Thank you.
Jose.Hi José,
In the DI API you can use the UserTable object to add, update or delete records as long as the user table is not part of a UDO.
Example:
// Link to the UDT - Note: table name does not include @ prefix
SAPbobsCOM.UserTable sboTable = (SAPbobsCOM.UserTable)_sboCompany.UserTables.Item("Test2");
// To add a record
sboTable.Code = "12345678"; // must be unique
sboTable.Name = "My New Record";
sboTable.UserFields.Fields.Item("U_MyUDF").Value = "TEST";
if (sboTable.Add() != 0)
_sboApp.SetStatusBarMessage("Record add failed: " + _sboCompany.GetLastErrorDescription(), SAPbouiCOM.BoMessageTime.bmt_Medium, true);
else
_sboApp.SetStatusBarMessage("Record added successfully.", SAPbouiCOM.BoMessageTime.bmt_Medium, false);
// To update a record
if(sboTable.GetByKey("12345678"))
sboTable.UserFields.Fields.Item("U_MyUDF").Value = "UPDATED";
if (sboTable.Update() != 0)
_sboApp.SetStatusBarMessage("Record update failed: " + _sboCompany.GetLastErrorDescription(), SAPbouiCOM.BoMessageTime.bmt_Medium, true);
else
_sboApp.SetStatusBarMessage("Record update successfully.", SAPbouiCOM.BoMessageTime.bmt_Medium, false);
else
_sboApp.SetStatusBarMessage("Record 12345678 not found.", SAPbouiCOM.BoMessageTime.bmt_Medium, true);
Kind Regards,
Owen -
Error updating User Table (ODBC - 2035)
Hello all.
Im having a problem when I try to update an user table @tbldoc and @tbldetail.
"This entry already exist in the following tables 'table' (@tbldoc)"
First time I have this issue was using my UI addon, my form is auto managed... then I try to use the default user object created by SBO, but same error appears when updating.
This issue never show up before, my addon work fine months ago. Now I have this error.
I read that for the documents numbering, SBO 2005 have an option to restore numbering, but in 2007 is missing or doesn't exist.
Can any one tell me how to fix this issue.
Thanks for the help.
Best regards.
GABHello,
I am also facing the similar error message.
I have created an Auto managed form and also within my add-on have provided an option to user to create record in that table(INSERT).
BR
Samir Gandhi
Edited by: Rui Pereira on Dec 23, 2008 4:20 PM -
HOW CAN I ADD/UPDATE/INSERT IN A USER TABLE WITH MATRIX
Hi All,
I have one User table (Defined as No Object) and what i need to do is a form with a matrix to Add/Update/Delete data in my user table.
I already create the form and the matrix that already give me the user table data. But now i have several problems to solve.
First I try to add a new row but this new row get the data of the last row in the matrix. What i needed is a blank row to add new data in the user table.
Second, when i change data in matrix and do update in the form, sap show me the message that the operation is successfully done but the data in the user table in not updated.
I am trying to do one forma like whe can find in Setup-> General -> Freight.
Can anyone help me?
Best Regards,
Luis DuarteHi,
If ur dealing with a simple form like that U can as well use the direct table form, and just provide a FMS to auto matically fill the code and name. U can directly use the form by.. Tools-->UserDefined Windows
Or
Comming to ur problem.... when ur adding a new row clear the data sources so that u'll get a blank row.
And for update the best thing to do is delete all the records in the table and again insert all the records directly from the matrix.
Hope it helps,
Vasu Natari. -
Im trying to update db table in user exit, with the internal table
Im trying to update db table in user exit, with the internal table
my scenario:
loop at itekpo.
updating itekpo -
> at the end of user exit the db table ekpo have to be updated
endloop.
Im updating internal table, using
MODIFY itekpo TRANSPORTING INCO1 INCO2 WHERE ebeln = itekpo-ebeln
where itekpo is internal table, but it is not updating the db table 'ekpo'.
i also tried updating ekpo directly !
Thanks in advanceHi,
you can search in the forum itself,
Try this link for instance
https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=tocreateaBADI&adv=false&sortby=cm_rnd_rankvalue
You can find a code for finding BADI as a report with the following Transaction
finding badis
How to find BADIs
Reward if helpful
Regards
Byju -
Problem in updating LIPS table in outbound delivery user exit
Hi,
I wrote a code in outbound delivery user exit (save document userexit) to update LIPS table.
for example
XLIPS-LGORT = '0657'.
XLIPS-PIMNG = I_LIPS-LFMING
(PICKing QUANTITY = DELIVERY QUANTITY)
MODIFY XLIPS TRANSPORTING LGORT PIMNG.
After outbound delivery created i couldn't found my entries in lips table. it shows me as blank.
Can anybody tell me what went wrong?
Thanks and Regards,
Suresh.Hi Suresh,
If you want to change any delivery data, like LIKP or LIPS you should use the USEREXIT_SAVE_DOCUMENT_PREPARE exit. The exit you are using is called after all delivery data is passed to the update task.
Regards,
John. -
SAP SSM Administrator Interface - Synchronize User Tables - Update Failed
Hello,
I have this error when i try synchronize user tables:
[img]http://img156.imageshack.us/img156/5777/updatefailed.jpg[/img]
Apparently all is ok. Because even showing the error, users are updated.
Best RegardsNosscire,
I'm sorry, I should have been more specific. The most confusing area with SSM is the web services user/password. If you have installed on a Windows server. The web services connection will be with the created Windows user and the password for that user. This Windows user is not a user of the system, it is your connection user.
The recommendation is to create a Windows user that can be recognized like pasuser or passervice - some other name than pipadmin or SSM user, since it is too common for each to have a different password.
That is the first thing to check.
Regards,
Bob -
External table authentication not updating user group changes
Hello
I have a question..
In OBIEE, i am using external table authentication. I have user and user group tables where users and groups are stores.. Every Time I create a new user and assign them to a group, these records get inserted immediately to these tables with the correct user and group ID that matches with each other.. Then in my initialization block I have the query that fetches the user name and psswd as well as groups names..
All these are working at the initial user creation. For example, when I create user A and assign it to group A, the DB table has all of the records inserted correctly. When I log in to OBIEE using User A login, I see it is assigned to Group B.
The problem comes when I change the user A from Group B to Group C. When I did that, although the DB table gets updated correctly, OBIEE session seems to still be the previous one. As a result, when I log in the second time, I see the user A is still assigned to Group B instead of Group C.. This seems to be cached..
I double check these user tables in OBIEE, none of them are cache enabled.. The connection pool setting of the isolation level is set as default..
When I reinstall OBIEE all over again and re-log in the first time, this User is now assigned to Group C..
So seems to be that it is caching issue.
How should I go about solving this issue
Appreciate in advanceMake sure you check the box for 'Required for authentication' and also 'Use caching' should not check.
Edited by: Srini VEERAVALLI on May 15, 2013 9:05 PM -
Hello,
I have one question. when i have in table for example 2000 records. I viewthis data in matrix on my form. Now i change the record 1000. Now when i want save data to the table? Is necessary find the old record in the table and pass through all records or can i save data only for this record without pass through?Hello,
SetValue will update the DBDataSource but as it's a UI object, it doesn't save it to the table. Note that since SBO 2004, if you work with Matrix, you can use FlushToDataSource instead of going thru each row of the matrix.
If you want to save only the record 1000, I think you'll have to use a trick, save in memory which record you modified to then update the table.
Or update the data when the value is validated in the matrix.
Sébastien -
How to update the table when change list item in classic report
hi ,
i worked with apex 4.2 and i create normal classic report with one select list(named loved)Column ,now i want to update table when user change the list with new value ,i can't create dynamic action to do this,i create check box with primary key and loop for check item to update the table but i can't get the value of list item. and for more speed the user want to do this when change the list value.
my question
1- how to do this by javascript and get the value from list item and update the table with new value
2- is i must use API to create list item so i can get the value of item in report or what.
Thanks
AhmedI coded the following to give you direction:
1. In the "Element Attributes" section of the DEPTNO column, I call a javascript function as:
onchange = "javascript:updateTable(this);"2. I wrote a simple javascript function that shows an alert when the user changes the select list as:
<script language="JavaScript" type="text/javascript">
function updateTable(pThis)
var vRow = pThis.id.substr(pThis.id.indexOf('_')+1);
alert('Row# - '+ vRow + ' has the value - ' + pThis.value);
</script>Now, you can call a AJAX on-demand process inside the javascript function to update the database value. -
How to use one form to update two tables
How can I do that? HTMLDB wizard or form on table doesn't give me an option to use more than one table in a form or I don't know about it. I created new process which redirects the form to another page after submitting the form. On the second page I created new process which uses the same variables from the previous form page. This process runs on page load before header but it is just not working right.
So, what is the proper way to update two tables with the same form fields?Hello Vikas,
"The Automatic Row Fetch and Automatic DML processes are a pair, you can't have one without the other."
Are you sure about that? I have a page, which populate some of the items from TableA, using manual select statement, and after the user input, save some of it in TableB, using Automatic DML. No ARF in this process and it seems to work just fine. Come to think of it, what about a simple form, populated entirely by the user input, and then being saved to the db, using Automatic DML? No ARF here also.
For the problem in hand, if you can't have more then one Automatic DML per page, I think that the simplest solution will be to define a pl/sql process, with two INSERT statement to the two different tables.
Regards,
Arie. -
Query and update a table/view
What is the best & fastest way to do this?
1) Put up a query input region for users to enter parameters.
2) Run a query on a table/view using those parameters.
3) Allow the output in (2) to be modified by user (multiple rows at a time) and then Submit the updates back to update th table/view
I can do (1) and (2) easily. How can I do (3)?
ThanksMake a report on the table. Go to the definition of
the report column and change the "Display As" type to
text field or select list or whcih ever is
applicable. Write a process on submit to insert these
values back to the table. You will have control over
which columns the user can modify.Thats a good idea and I was able to start on it. But how can my after submit process tell which rows to modify? i.e. what will my after submit process look like?
for rec in (....)
loop
update my_table set
end loop;
Help? Thanks -
How To Update A Table View From Client Side !!!!
Hi I would like to update a table view from the Client Side. So that the user can keep updating the relevent data on the client and when they have finally finished they can press Save so the entire page is then sent to the Server.
Does anyone know how to do this, I guess u have to use the EPCM, I have just started on it and would really appreciate some Help.
Thanks,
Emmanuel.This is what I found :-
There are a couple of ways to approach this.
1) load the excel spreadsheet into the database "as is". You can use interMedia
text to convert the .xls file into a .htm file (HTML) or use iFS (see
http://technet.oracle.com/
for
more info on that) to parse it as well. InterMedia text will convert your XLS
spreadsheet into a big HTML table (easy to parse out what you need at that
point)
2) Using OLE automation, a program you write can interact with Excel, request
data from a spreadsheet, and insert it. Oracle Forms is capable of doing this
for example as is other languages environments. In this fashion, you can remove
the "manual" and "sqlldr" parts -- your program can automatically insert the
data.
3) You can write a VB script that uses ODBC or Oracle Objects for OLE (OO4O) in
Excel. This VB script would be able to put selected data from the spreadsheet
into the database. We would recommend OO4O. It provides an In-Process COM
Automation Server that provides a set of COM Automation interfaces/objects for
connecting to Oracle database servers, executing queries and managing the
results. OO4O is available from
http://technet.oracle.com
Maybe you are looking for
-
We are using Hyperion Planning 11.1.1. I am creating a new user using sharred services console and assigning a group to it which is already provisioned. Now i am able log in using this new user to the workspace but when i open the application, it giv
-
I killed my computer: HELP!
I have a dual 1ghtz powermac G4 with a 160GigaByte Array (two 80 Gigs), the 80 gig boot drive and another 120 Gig drive next to the boot drive. I removed the 120 to see if I could put it into my new G5 (which I could not). I did everything by the boo
-
Is ibooks available for mac air
is ibooks available for mac air
-
Getting no results when connecting to Oracle DB.
Hello , I'm tryin to connect to an Oracle DB and I get no result excpet that the console prints the following : oracle.jdbc.driver.OracleDriver BUILD SUCCESSFUL (total time: 0 seconds) why so? here is my code : import java.sql.*; public class ListMov
-
HP 8500 "do not align" still keeps aligning..... unsuccessfully
I jammed a sheet of labels in my HP 8500A printer. The sheet came out without missing any sections and printer said it needed to align. Alignment failed. Everything however continued to print fine, I just had to click "do not align" before each pag