cancel
Showing results for 
Search instead for 
Did you mean: 

Calling an RFC on check of a radiobutton

Former Member
0 Kudos

Hi All,

I am creating an Adobe Form in WebDynPro wherein I need to call an RFC/WebService when a radiobutton is checked.

Is there a way of doing this????

Thanks,

Sameer

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Sameer,

Do one thing.

Insert radio button on Adobe form. Then choose pallete menu option and there goto Script Editor.

Now, click on your radio button and then choose click for show dropdwon in script editor. and then type following line.

app.eval("event.target.SAPSubmit();");

This will call the OnactionSubmit event.

Now, write your code for calling BAPI/webservice in this action.

Regards,

Bhavik

Former Member
0 Kudos

Hi Bhavik,

I did as you said, but nothing seems to be happening. Do I need to do something before doing this. i opened up the the script editor and in the clik event for the radio button just typed the line app.eval("event.target.SAPSubmit();");

Where does the event get generated???

Pls elaborate...

Sameer

Former Member
0 Kudos

Hi Sameer,

Do you have specified Submit event for your InteractiveForm ui element? If not then do it.

One more thing, place your "Submit to SAP" button also on Adobe form.Then, check whether your submit method is called properly or not by clicking on this button.

Regards,

Bhavik

Former Member
0 Kudos

Hi Bhavik,

It is calling the submit event now. But i have a submit to SAP button as well. Can i have more than one submit action, in this case one for the radio button and one for the Submit to SAP button??

Sameer

Former Member
0 Kudos

Bhavik,

I have three radio buttons and on click of each one I have to call the same RFC but with different import parameter.eg,

three radoi button are HOme, office and college. Now my RFC will will return home address if home radio button is checked and office address if office radio button is checked and college address if college radio button is checked.

In this case i will have to pass parameter from my form to my event which will be the import parameter and retrun different addresses depending on which button selected. Any way of passing this parameter???

sameer

Former Member
0 Kudos

Hi Sameer,

There are only two actions possible for this element.one is submit and second is check.

So, if you are not using Check fields button, then write following line instead:

app.eval("event.target.SAPCheckFields();");

Then create one eventaction for check for Interactiveform element.

regards,

Bhavik

Former Member
0 Kudos

Hi Bhavish,

This seems to be working fine, Oncheck for the radio buttons and OnSubmit for the Submit to SAP button.

There's one problem though, that is I have three radio buttons and only one Oncheck event. Is there a way by which i can find out in my event handler code as to which radio button has been selected because based on that i have to pass three different parameters to the RFC to get different results.

Sameer

Former Member
0 Kudos

Hi Sameer,

Make one context variable under your context node which you have bounded to the Datasource property.

Now, bind this value attribuute to the all radio buttons you want on Adobe form. Also write same code for event for all radio buttons.

Each radio button has their own value like 1,2 etc. So, in your action method get this value in your value attribute and proceed ahead.

Regards,

Bhavik

Former Member
0 Kudos

Hi Sameer,

If you have solved this problem then please close this thread.

Regards,

Bhavik

Former Member
0 Kudos

Hi Sameer,

You can make use of "OnAction"event for RadioButton to do this...Right !!!

regards, Anilkumar