cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple submit buttons

Former Member
0 Kudos

Hi,

I need 2 submit buttons in onlineform(WDA). But in Interactiveform UI element there is only one event "onsubmit".

For example I have submit and posting buttons in my form. As of now when i click submit button it is calling onactionsubmit and trigerring workflow. But how to call another event in webdynpro from Posting Button (Submit button from webdynpro Native)of form so that it can execute the BAPI?

Regards,

Ravi

Accepted Solutions (1)

Accepted Solutions (1)

chintan_virani
Active Contributor
0 Kudos

Ravi,

Well for this you can play with some hidden fields and achieve the results.

Create two buttons on form of SubmitToSAP type and create two hidden TextFields (TextField1, TextField2) bound to Web Dynpro context (Field1,Field2)

When first Submit Button clicked, in the click event of button set the TextField1 value to 1 through JavaScript as follows:-

TextField1.rawValue = 1;

Similarly repeat it for Button2 by setting TextField2 value to 2

TextField2.rawValue = 2;

Now in the onSubmit event on Web Dynpro side write an if else loop based on above condition.

if(wdContext.currentContextElement().getField1().equals("1"))
{
   // write the coding 1st event
}
else (wdContext.currentContextElement().getField2().equals("2"))
{
  // write the coding 2nd event
}

Chintan

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Ravi,

you could add a button in the form, and attach some java script code to the onClick event:

var cURL = enter the WSDL url generated in the first step;

var service = SOAP.connect(cURL);

xfa.connectionSet.name of your custom data connection.execute(0);

2nd way, on a button's propertiy, go to "Object" tab, "Field" tab, chose the button type as "submit", then in the "submit" tab, you can enter the URL of the web service.

also, have a look at this post: /people/lisha.peter/blog/2007/10/16/purely-offline-adobe-scenario-for-bapi-call

hope it helps.

Former Member
0 Kudos

hi,

But Im not using webservice call for my BAPI. Is there anyother approach?

Regards,

Ravi.D

Former Member
0 Kudos

is there a way to attach some java script to those two activx buttons?

if so, you can set an invisible flag value, then in the web dynpro event handler, you can tell which button the event comes from.

i never try this, only my guess.