cancel
Showing results for 
Search instead for 
Did you mean: 

Calling webservice in Adobe interactive form

Former Member
0 Kudos

Hi,

I have a webservice created for a function module which in turn calls the BAPI_PR_CREATE (purchase requisition creation) BAPI. I am trying to call this webservice from an Adobe interactive form I've created. Basically the user will enter all necessary data inside the form and when he presses a button the webservice should be called and the purchase requisition should be created.

My question is what type of "Control type" should I use for the button "Regular", "Execute" or "Submit" and how should the javascript code look like?

I have tried a lot of solutions that I've found on the internet but nothing worked.

The ADS service is not yet installed, I know that this is a big issue but could this affect the functionality or could this be the cause why nothing seem to work?

Thank you and Best Regards,

Mihai

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

This message was moderated.

Florian
Active Contributor
0 Kudos

Hi Mihai,

first of all you need to install the ADS.

Without having the ADS-Server available nothing will work in your interactive form.

So please configure the ADS and afterwards if the already discovered solutions won't work come back here and share more details.

As you told us you found some solutions you might also share these to not get the same suggestions again.

~Florian

Former Member
0 Kudos

Hi Florian,

thank you for the given information.

Unfortunatelly I was waiting for a long time from the BASIS team to install the ADS. Yesterday they've told me it's finally done.

Consequently I started to retest the solutions I've found but with no result so far.

I've tried to make the button an "Execute" control type and added the Connection inside the Execute tab.

I've also tried with the following javascript inside the xml file (inside the click event of the button) and all of the button control types:

var tempsoapAddress = xfa.connectionSet.DataConnection.getElement("soapAddress").value;

var tempwsdladdress = xfa.connectionSet.DataConnection.getElement("wsdlAddress").value;

var ServerPath = body.systemConfig.system.rawValue;

var client = <Get Client from a data attribute>

var Soap_PreServerPort =  "http://";

var Soap_PostServerPort =  "/sap/bc/soap/rfc?sap-client=";

var SoapAddress = Soap_PreServerPort + ServerPath + Soap_PostServerPort + client ;

var Wsdl_PreServerPort =  "http://";

var Wsdl_PostServerPort1 =  "/sap/bc/soap/wsdl11?services=ZBAPI_PO_CREATE2&amp;sap-client=";

var wsdlAddress =  Wsdl_PreServerPort + ServerPath + Wsdl_PostServerPort1 + client ;

xfa.connectionSet.DataConnection.getElement("soapAddress").value = SoapAddress;

xfa.connectionSet.DataConnection.getElement("wsdlAddress").value = wsdlAddress;

xfa.connectionSet.DataConnection.execute(0);

xfa.connectionSet.DataConnection.getElement("soapAddress").value = tempsoapAddress;

xfa.connectionSet.DataConnection.getElement("wsdlAddress").value = tempwsdladdress;

xfa.connectionSet.DataConnection = null;

I've also found that maybe I should have attached the following roles and authorization objects to my user:

Authorization objects: S_USER_PRO, S_SERVICE and S_ICF_ADMIN, S_SRT_ADM

Roles:

a) SAP_BC_WEBSERVICE_ADMIN

b) SAP_BC_WEBSERVICE_ADMIN_BIZ

c) SAP_BC_WEBSERVICE_ADMIN_TEC

d) SAP_BC_WEBSERVICE_CONSUMER

e) SAP_BC_WEBSERVICE_DEBUGGER

f) SAP_BC_WEBSERVICE_OBSERVER

g) SAP_BC_WEBSERVICE_SERVICE_USER

Do you have ideea what could be the issue? Can you give me another solution?

Thank you and Best Regards,

Mihai

Florian
Active Contributor
0 Kudos

Hi Mihai,

here is a document which should guide you. This is a good example and it works for sure. Tested by myself a few month ago

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/20280d13-7b93-2e10-51a0-ba05fd263...

HAve fun

~Florian

Former Member
0 Kudos

Hi Florian,

I have an offline scenario adobe interactive form. I'm not using the form inside a webdynpro application.

Will the above solution still apply in my case?

Thank you,

Mihai

Florian
Active Contributor
0 Kudos

As the author said in his document the solution will also work in an offline scenario...

~Florian

Former Member
0 Kudos

This message was moderated.

Florian
Active Contributor
0 Kudos

Hi Ashin,

did you really read through the conversation?

I think your reply doens't help to solve the issue...

~Florian

Former Member
0 Kudos

Hi Florian,

sorry for the late response but the BASIS team had some problems with the ADS configuration again. Now it works.

I've tried to test the tutorial you've send me but it does not work. I'm sure I'm missing something small.

Which control type is the button. In the tutorial it shows "Execute". I've tried this way but it does not work. Also when you go to the execute tab for the button what Execute options should I use ? ..."Client" "Server" or "Client and Server" should I check the "Re-merge Form Data" checkbox?

One more thing when you enter the Data connection which option should I choose on the last step?

"Requires HTTP/HTTPS Authentication" or

"Require Message-Level Authentication"?

Thank you and Best Regards,

Mihai