Saving Multiple Rows in a Table simultaneously
Hi All,
I have a requirement in which I have to validate and save multiple entries from table through BAPI. The validations are checked on Button click (save). If a row entry is correct , it is saved in the backend and for the rows which are not correct, an error message is displayed.
My requirement is to clear the rows which are correct or saved in the backend.
Thanks,
Nikhil
Hi,
Private<name>View.I<value node name >Node node = wdContext.node<value node name >();
Private<name>View.I<value node name>Element ele;
<your rfc name> input = new <your rfc name>(); // your rfc name
wdContext.node<your rfc name>().bind(input); // bind
<table name> inputTable;
for (int i=0; i < node.size(); i++ ) // value node - where data is available
if(<check here element for validation>){
inputTable= new <table name>();
ele = node.get<value node>ElementAt(i);
inputTable.set<Attribute>(ele.get<Attribute>());
input.add<table name>();
node.removeElement(ele);
// execute rfc.
Regards,
ramesh
Similar Messages
-
How to make RECORD for saving multiple rows for each employee..
Hi,
How can I create a record for saving multiple rows for each employee... (parent child relationship)
I have created all required fields, then created a record, and then created a page. in that page i dragged-n-dropped a scroll area on that page and dropped all required fields from record into that scroll-area.
whats is happening that its saving ONE (the first) record fine, but for the second record its not storing EMPLID for that row..
Will I have to make some change at RECORD level ?
OR Will i have to make some configuration in parent component ?Hi, the problem is solved. The record will be created in same way. just create more then one keys (allowing to make composite key in DB table)
-
Update row in a table based on join on multiple rows in another table
I am using SQL Server 2005. I have the following update query which is not working as desired.
UPDATE DocPlant
SET DocHistory = DocHistory + CONVERT(VARCHAR(20), PA.ActionDate, 100) + ' - ' + PA.ActionLog + '. '
FROM PlantDoc PD INNER JOIN PlantAction PA on PD.DocID = PA.DocID AND PD.PlantID = PA.PlantID
For each DocID and PlantID in PlantDoc table there are multiple rows in PlantAction table. I would like to concatenate ActionDate and ActionLog information into DocHistory column of DocPlant table. But the above update query is considering only one row from
PlantAction table even though there are multiple rows that match with DocID and PlantID.
DocHistory column is of type NVARCHAR(MAX).
How do I fix my query to achieve what I want ? Thanks for the help.UPDATE DocPlant
SET DocHistory = DocHistory + CONVERT(VARCHAR(20), PA.ActionDate, 100) + ' - ' + PA.ActionLog + '. '
FROM PlantDoc PD INNER JOIN PlantAction PA on PD.DocID = PA.DocID AND PD.PlantID = PA.PlantID
We do not use the old Sybase UPDATE..FROM.. syntax. Google it and learn how it does not work. We do not use the old Sybase CONVERT() string function. You are still writing 1950's COBOL with string dates instead of temeproal data types.
You also did not post DDL, so we have to guess about everything. Does your boss make you work without DDL? How do you do it?
>> For each DocID and PlantID in PlantDoc table there are multiple rows in PlantAction [singular name?] table. I would like to concatenate ActionDate and ActionLog information into DocHistory column of DocPlant table. <<
Why? What does this new data element mean? This is like dividing Thursday by Red and expecting a reasonable answer. Now, non-SQL programmers who are still writing COBOL will violate the tiered architecture rule about doing display formatting in the database.
If you will follow forum rules, we can help you.
--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 -
Selecting multiple rows in a table
Hi All,
I have one problem with selecting multiple rows in a table.I tried with setting table property-selectionMode as Multi, but i dinn't get the solution.
please provide me solution for this.
Thanks & Regards,
Sreelakshmi.HI
Int leadSelection = wdcontext.nodemodelnode.getLeadSelection();
for(int i=0;i<wdcontext.nodeModelNode.size;i++)
if(wdcontext.nodeModelNode.isMultiselected(i) || leadSelection ==i)
String name = wdcontext.nodemodelnode.getnameelementatindex(i).getName();
String address = wdcontext.nodemodelnode.getaddresselementatindex(i).getAddress();
String age = wdcontext.nodemodelnode.getAgeelementatindex(i).getAge();
Create a method for the Table Property onLeadSelect() where you can open a popup window
Create a value node and with attributes same as Table attributes and then set the values of the table
to the value node attributes.
Thanks -
Inserting Multiple Rows in a table
Hello,
I need to insert multiple rows in a table with the selected items from a list (Multiple select).
How do i go about it. I'm using ADF-struts-UIX application on Jdeveloper 9.0.5.2
Thanks.Jonas, I've downloaded the sample application from your ADF UIX Editable table tip but have some problems.
I can't even open the emp.table.uix file - errors are:
Parsing error. Unable to parse binding.
javax.servlet.jst.el.ELException:Function ctrl:createSortableHeaderModel was not found.
and
javax.servlet.jst.el.ELException:Function ctrl:getSortOrder was not found.
Also - is there a place in the sample where you define the sample tables? They do not seem to match the standard sample emp table, for instance.
I've just started using JDeveloper and would like to use the solution.
Thanks - Linda -
Best practice for deleting multiple rows from a table , using creator
Hi
Thank you for reading my post.
what is best practive for deleting multiple rows from a table using rowSet ?
for example how i can execute something like
delete from table1 where field1= ? and field2 =?
Thank youHi,
Please go through the AppModel application which is available at: http://developers.sun.com/prodtech/javatools/jscreator/reference/codesamples/sampleapps.html
The OnePage Table Based example shows exactly how to use deleting multiple rows from a datatable...
Hope this helps.
Thanks,
RK. -
Select multiple rows from dual table
Is it possible to select multiple rows from dual table using a single select statement.
i.e., i want the out put to be
column_name
1
2
3
4
Edited by: vidya.ramachandra on Dec 14, 2009 8:24 AMAside from the fact you're responding to an old thread...
1002424 wrote:
While using CONNECT BY, I see it always leave behind one row.
Suppose I have a condition based on which I have to generate constant rows like
SELECT 1 FROM DUAL WHERE ROWNUM < N;
Here if N = 0, still it gives out single row.... you are obviously doing something wrong in your code elsewhere, because that SQL statement does not always return a single row...
SQL> SELECT 1 FROM DUAL WHERE ROWNUM < 0;
no rows selected
SQL> -
Updating multiple rows in a table in ADF
Hi
How do we update multiple rows in a table.
Onclicking a update button the changed rows must be updated.Hi Prince,
currently I am selecting one row from the table and rendering a region at the top of the table and capturing the user entered data with the following code:
ViewObjectVOImpl vo = getViewObjectVO1();
Row CurrentRow = vo.getCurrentRow();
//After this I perform the checks like user entered value is not null or check input as per business logic.
if(CurrentRow.getAttribute("attributeName") ==null){
//Add what message you want to display
//Add other business logic.
After making all the checks, i commit it.
getOADBTransaction().commit();
Now in my new page I am capturing the user input in the table itself like an excel sheet. Suppose there are ten rows in my advanced table on my page, and each row has one editable field. I have one save button at the bottom of the table.
Now on clicking the save button I have to capture the user input, check whether there is any null value and if all the entered data is correct then only I should commit it.
Can you please let me know how we can accomplish that.
Regards
Hawker -
Multiple row selection for table element
Hi,
I have a requirement where I require to select multiple rows from a table element in a WD for abap application.
I have defined a node with cardinality and selection set to 1..n.
The contex node contains 4 fields : emp_name, pernr, manager and position.
The attributes of the table element for selectionmode is set to 'multi' and 'selectionchangebehaviour' is set to 'auto'.
I have defined an action on the 'onleadselection' event.
The code in this method also includes the statement 'lo_el_team_view->set_selected( EXPORTING flag = abap_true ).'
When I execute the application only 1 row is highlighted at any one time when I select it. You can select multiple rows by holding down the 'ctrl' key but I want to avoid having to do this. Is there anything I have missed out causing multiple row selections not to be all highlighted.
Thanks in advance for any assistance.Hi raj,
you can try the following code in the 'onleadselect' event of the table,
create one attribute ' Flag' of type WDY_BOOLEAN under the node which has been binded to the table.
DATA lo_nd_node_tab1 TYPE REF TO if_wd_context_node.
DATA lo_el_node_tab1 TYPE REF TO if_wd_context_element.
DATA lo_elements TYPE wdr_context_element_set.
DATA lo_ele_select_new TYPE REF TO if_wd_context_element.
DATA lv_deselect TYPE wdy_boolean.
DATA lv_flag TYPE wdy_boolean.
DATA lv_select TYPE wdy_boolean.
DATA lv_index TYPE i VALUE 0.
lo_nd_node_tab1 = wd_context->get_child_node( name = wd_this->wdctx_node_tab1 ).
get the current selected element
lo_ele_select_new = wdevent->get_context_element( name = 'NEW_ROW_ELEMENT' ).
CHECK lo_ele_select_new IS NOT INITIAL.
check whether it has been selected or not
CALL METHOD lo_ele_select_new->is_selected
RECEIVING
flag = lv_select.
lo_ele_select_new->get_attribute( EXPORTING name = 'FLAG' IMPORTING value = lv_deselect ).
check whether element has been previously selected or not,if not, set the flag to select it
IF lv_select IS NOT INITIAL AND lv_deselect IS INITIAL.
lo_ele_select_new->set_attribute( name = 'FLAG' value = 'X' ).
if selected currently and previously then set the flag as false,in order to delect it
ELSEIF lv_select IS NOT INITIAL AND lv_deselect IS NOT INITIAL..
lo_ele_select_new->set_attribute( name = 'FLAG' value = ' ' ).
ENDIF.
CALL METHOD lo_nd_node_tab1->get_elements
RECEIVING
set = lo_elements.
according to the falg, select and delect the elements
LOOP AT lo_elements INTO lo_el_node_tab1.
lo_el_node_tab1->get_attribute( EXPORTING name = 'FLAG' IMPORTING value = lv_flag ).
IF lv_flag = 'X'.
lo_el_node_tab1->set_selected( abap_true ).
lo_nd_node_tab1->set_lead_selection_index( lv_index ). * this statement deselects the lead selection index*
ELSE.
lo_el_node_tab1->set_selected( abap_false ).
lo_nd_node_tab1->set_lead_selection_index( lv_index ).
ENDIF.
ENDLOOP.
I hope this resolves your problem.
Thanks,
krishna -
Selecting multiple rows of a table
Hi Forum,
How to select multiple rows of a table at a time? Please help me..
Thanks
SwapnaHi Swapna,
To select more then one row in table, just set the selectionmode property of table to 'multi' or 'auto' and also change the selection property of the node (to which table is binded) to 0:n.
I hope it helps.
Regards
Arjun
Edited by: Arjun on Feb 4, 2009 11:52 AM -
Inserting multiple rows in child table
i have two entity beans (main and child) with relationship one to many .... when i insert one row in main table (ie when i make one object for main entity bean)... how to insert multiple rows in child table...
Can anyone pls provide some sample code for the above.. how to pass a collection and populate it in the child table.
1.Where to pass the collection, to the childbean directly or to the parent bean and then itereate to the collectio and create child bean.
Much obliged if you could paste some code for the above.. -
Inserting multiples rows into a table using function or procedure..
How do i insert multiples rows into a table using function or procedure?
Please provide me query..Use FORALL bulk insert statement...
eg:
procedure generate_test_data as
type cl_itab is table of integer index by pls_integer;
v_cl_itab cl_itab;
type cl_vtab is table of varchar2(25) index by pls_integer;
v_cl_vtab cl_vtab;
type cl_dtab is table of date index by pls_integer;
v_cl_dtab cl_dtab;
begin
for i in 1.. 100 loop
v_cl_itab(i):= dbms_random.value(1,1000);
v_cl_vtab (i):=dbms_random.string('a',20);
v_cl_dtab (i):=to_date(trunc(dbms_random.value(2453737, 2454101)),'j');
end loop;
forall i in v_cl_itab.first .. v_cl_itab.last
execute immediate 'insert into test_order values( :n, :str , :dt ) ' using v_cl_itab(i), v_cl_vtab (i), v_cl_dtab (i);
commit;
end; -
Reg Selection of Multiple Rows in a Table
Hi all,
I have to select multiple rows from a table and have to display those selected records in another table in the next screen.
The problem is, when I am selecting the records in a table, selection should not be allowed on some records based on a condition. Is it possible with the default selection mode of webdynpro. If so, Please tell me how can we disable the selection of certain records in a table(using the default selection mode provided by webdynpro)
Else, if we have to use check boxes for selection(in case of my problem), please do help me out in how to disable the selection of certain records in a table(using check boxes for selection).
Please help me out. Its urgent...
Reward points guranteed.
Regards,
Murthy.HI Narayana,
Multiple selection property is specific to a table, not for a tableElment(ie. for a row), so u cant set some of the rows as multi selected and some as node
U can use Checkbox for this purpose. Based on the condition u can make the check box as enabled and disabled
To achieve this, Create 2 boolean variables inside table node, one for checkbox value(Let it be <b>CBValue</b> .Bind this to checked property of Checkbox) and other for enabling and disabling Checkbox(Let it be <b>CBReadOnly</b>. Bind this to readonly property of CheckBox).
At the time of creation of table elements, as per the condition, u can control the selection as
IPrivate<View>.I<Table>Node tNode=wdContext.node<Table>();
for(int i=0;i<5;i++)
IPrivate<View>.I<Table>Element tEl=tNode.create<Table>Element();
tNode.addElement(tEl);
tEl.setCBValue(false);//Unchecking Checkboxes initially
if(condition=non selectable)
tEl.setCBReadOnly(true);
else
tEl.setCBReadOnly(false)
Regards
Fahad Hamsa -
How to get multiple rows from database table?
hello !
I need to get multiple rows from a OLEDB database table and display them on a table object.
I did "Wrap in subfrom" on the table, set subform of the table to "flowed", and checked "Repeat row for each data item" of Row1 of the table.
But I can get only one row on the table object.
I need your help.
ThanksHi,
best practices when deleting multiple rows is to do this on the business service, not the view layer for performance reasons. When you selected the rows to delete and press submit, then in a managed bean you access thetable instance (put a reference to a managed bean from the table "binding" property") and call getSeletedRowKeys. In JDeveloper 11g, ADF Faces returns the RowKeySet as a Set of List, where each list conatins the server side row key (e.g. oracle.jbo.Key) if you use ADF BC. Then you create a List (ArrayList) with this keys in it and call a method exposed on the business service (through a method activity in ADF) and pass the list as an argument. On the server side you then access the View Object that holds the data and find the row to delte by the keys in the list
Example 134 here: http://blogs.oracle.com/smuenchadf/examples/#134 provides you with the code
Frank -
Updating data from multiple rows in a table view
Hello,
so far in my OAF programming, I have always selected one particular row from a table and saved from it. Now I have a requirement where in my table, fields from more than one row shall have to be updated.
Can anyone please let me know how to accomplish this.
Regards
HawkerHi Prince,
currently I am selecting one row from the table and rendering a region at the top of the table and capturing the user entered data with the following code:
ViewObjectVOImpl vo = getViewObjectVO1();
Row CurrentRow = vo.getCurrentRow();
//After this I perform the checks like user entered value is not null or check input as per business logic.
if(CurrentRow.getAttribute("attributeName") ==null){
//Add what message you want to display
//Add other business logic.
After making all the checks, i commit it.
getOADBTransaction().commit();
Now in my new page I am capturing the user input in the table itself like an excel sheet. Suppose there are ten rows in my advanced table on my page, and each row has one editable field. I have one save button at the bottom of the table.
Now on clicking the save button I have to capture the user input, check whether there is any null value and if all the entered data is correct then only I should commit it.
Can you please let me know how we can accomplish that.
Regards
Hawker
Maybe you are looking for
-
How do you relink video from low res to high res and keep audio synced?
Hello, I'm trying an offline to online workflow but my synced audio from my offline clips are not transfering to my online clips. Anyone have a solution?
-
Apparently the print order was pressed several times. Now there is a long list of print orders and the printer will not work.
-
Cs6 Indesign keeps asking for missing plugins, eg Install and Find Plug in and Spelling panel plugin, then crashes. I have reinstalled, I have updated and I have tried to delete preferences. Please help. Am so frustrated. Am no techno guru and there
-
Will my new Macbook air mid-2011 be able to run the sims 2 ?
The specs are as follows :- Intel Core i5 @ 1.6 ghz 64 GB SSD Intel integrated HD graphics 3000 2 GB 1333 MHz DDR3 288 MB Mac os x 10.7.1 Lion I also tried my Sims 3 game, but it did'nt run, it used to stop responding when I was just getting them int
-
Hello SCN isn't allowing me to login (SSO) using some URLs, but it is others. For example I can login using http://scn.sap.com/welcome but I can't login using http://wiki.scn.sap.com/wiki/display/BOBJ/Business+Intelligence?original_fqdn=wiki.sdn.sap.