on 04-06-2009 12:58 PM
Hi,
In the same way how to populate the values for the Check Box.
Let us take an example:
I have created a node called "sport" under that created a Attribute called "Sports" in the view called Profile View.
and written the following code in
WDDoINIT()
{
IsportNode nodesport = wdContext.nodeTransactionaccesstype();
IPrivateprofileView.IsportElement elementsport;
String[] sportsarray = { "cricket","Basketball","Tennis"};
for (int i = 0; i < accesstypes.length; i++) {
elementsport = nodesport.createsportElement();
}
nodesport.addElement(elementsport);
elementsport.setsports(sportsarray);
}
in Onaction submit button of profile view
onactionsubmit()
{
Isport nodesport = wdContext.nodesport();
IPrivateProfileView.IsportElement elementsport;
String[] sportsarray =
{
"cricket",
"Basketball",
"Tennis"
};
for (int i = 0; i < sport.length; i++) {
elementsport = nodesport.currentsportElement();
elementsport.setsports(sportsarray);
nodesport.setSelected(elementsport.index(), false);
}
}
I have to send this value to the import parameters of Function Module "BAPI_SAMPLE_Input", in the import, the attributes in the backend are "cricket" and "basketball" and "tennis".
In the controler method :
BAPI_SAMPLE_Input inp=new BAPI_SAMPLE_Input();
ZAddr addr = new ZAddr();// it is a structure inside the function module import
IPublicprofileform.IsportsElement sportelement=wdContext.currentsportsElement();
if(sportelement.getsports().equalsIgnoreCase("cricket"))
{
addr.setcricket(true);
}
if(transElement.getAccesstype().equalsIgnoreCase("Basketball"))
{
addr.setbasketball(true);
}
if(transElement.getAccesstype().equalsIgnoreCase("Tennis"))
{
addr.settennis(true);
}
inp.setZAddr(addr);
Iam unable to send the selected sport to the above Function module import parameter.
Please Advice.
Sekhar
Hi,
you must bind the input to the context:
wdContext.BAPI_SAMPLE_Input().bind(inp);
Regards
Matteo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.