on 10-15-2008 6:48 AM
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,
Try this code
for(int i=0;i<wdContext.nodename().size();i++)
{
if(wdContext.nodename().isSelected(i))
{
wdContext.nodename().removeElement(wdContext.nodename().getElementAt(i));
}
}
Thanks & Regards,
Sunaina Reddy T
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
for(int j = 0; j < wdContext.nodeMyNode().size(); j++)
{
if(wdContext.node.getElementAt(j).getCity== cond && ....)
{
wdContext.nodeMyNode().<<setvaluestoDatabase>>;
wdContext.nodeMyNode ().removeElement(wdContext.nodeMyNode ().getElementAt(j));
}
else
{
wdComponentAPI.getMessageManager.reportSuccess("invalid values")
}
Hope this is useful for you
Regards
Ruturaj
Edited by: Ruturaj Inamdar on Oct 15, 2008 11:54 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try this
for(int i = 0; i < wdContext.node<Node Name>().size(); i++)
{
if(wdContext.node.getElementAt(i).get<<Attrname>> == cond && ....)
{
wdContext.node<Nodename>().<<setvaluestoDatabase>>;
wdContext.node<Node Name>().removeElement(wdContext.node<Node Name>().getElementAt(i));
}
else
{
wdComponentAPI.getMessageManager.reportSuccess("invalid values")
}
Regards
Raghu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nikhil,
code to clear elements from table:
int size=wdContext.node<NodeName>().size();
for(int i=0;i<size;i++){
/**Check condition here*/
///
if(/*if element is to be removed*/){
wdContext.node<NodeName>().removeElement(i);
size--;
i--;
}
}
Regards,
Deepti
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nikhil,
You can use the following code to remove the node element
for(int i = 0; i < wdContext.node<Node Name>().size(); i++)
{
wdContext.node<Node Name>().removeElement(wdContext.node<Node Name>().getElementAt(i));
}
Edited by: Aishwarya Sharma on Oct 15, 2008 8:33 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.