cancel
Showing results for 
Search instead for 
Did you mean: 

Populating Values of Check Box in to Function Module.

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

matteo_fusi2
Participant
0 Kudos

Hi,

you must bind the input to the context:

wdContext.BAPI_SAMPLE_Input().bind(inp);

Regards

Matteo

Answers (0)