on 07-04-2009 8:19 AM
Hi Experts,
I have created WD Project which calls a RFC. The RFC returns no of records of 100 countries. I want to show only those records to the end user for which Country_Code is India and USA.
How I can do so?
Regards,
Gary
HI,
For example your model node is CountryModelNode and the value node binded to table is CountryValueNode then:
int sizeCountryModelNode=wdContext.nodeCountryModelNode().size();
for(int iCount=0;iCount<sizeCountryModelNode;iCount++)
{
if("IN".equalsIgnorecase(wdContext.nodeCountryModelNode().getCountryModelNodeElementAt(iCount).getCountryCode())
|| "US".equalsIgnorecase(wdContext.nodeCountryModelNode().getCountryModelNodeElementAt(iCount).getCountryCode()))
{
IPrivateCountryValueNode.ICountryValueNodeElement element=wdContext.createCountryValueNodeElement();
element.setCountryCode(wdContext.nodeCountryModelNode().getCountryModelNodeElementAt(iCount).getCountryCode());
element.setCountryName(wdContext.nodeCountryModelNode().getCountryModelNodeElementAt(iCount).getCountryName());
wdContext.nodeCountryValueNode().addElement(element);
}
}
Note: Bind CountryValueNode to the table:
Regards,
Charan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Its simple. while reading the output from the RFC, check in loop if the country code is India or USA, if so then add those values to the Table node, else skip it.
Hope this helps.
Thanks and Regards,
Vivek.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
After the model execution,
try to get the value of the country code
IPrivateView.I<RFC node> rfcn = wdcontext.node<RFC node>
IPrivateView.I<Table node> tn = wdcontext.node<Table node>
for(int i = 0;i<rfcn.size();i++
{
IPrivateView.I<Rfc element> rfce = rfcn.getRFCElementat(i);
if(rfce.<countrycode>.equalsignorecase(<India or USA>))
{
IPrivateView.I<Table table> tne = wdcontext.create<table Element>;
tne.setcountrycode(rfce.get<countrycode);
// add rest of the table fields like this..
tn.add(tne);
}
}
hope this helps you.
Thanks,
Vivek.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.