cancel
Showing results for 
Search instead for 
Did you mean: 

Error while connecting to the webservice

Former Member
0 Kudos

Hi Experts,

I am working on the offline time sheet .

As per the client requirement I am using two methods to upload the time records to the SAP table.

1. I am using webdynpro upload method which is working fine.

2.Second methods is : I have one button on the offline 'SUBMIT TO SAP' , on clicking on this the Time entries should be saved to the SAP table.

Problem is in second method:

To enable the functionality of button:

1. I create a RFC function module.

2. A web service based on this RFC FM.

3.Configured this web service in SOAMANAGER T code.

4.I save the wsdl file generated from web service .

5.From form side I created a data connection for the button "SUBMIT TO SAP"  which takes the URL of webservice. Then I save and activate the form.

Then I download the offline time sheet and fill the entries and clicked on the button to save the time entries to the SAP table.

But I am getting the below error :

Error attempting to read  from file :

http://project-abcd.com8080/sap/bc/srt/rfc/webservice

Please suggest me the solution.

Regards,

Akhilesh Bhagat.

Accepted Solutions (0)

Answers (1)

Answers (1)

sandeep_katoch
Contributor
0 Kudos

Hi Akhilesh,

Check this one may be you can get a clue

http://saptechnical.com/Tutorials/AdobeForms/Webservices/Index.htm

. If webservice has been configured correctly and you have used it in the format both the places

1: In the form properties

2: In the button properties then it should work.

If still not able to solve the error paste the error snapshot here.

Hope it helps.

Rgds,

Sandeep Katoch

Former Member
0 Kudos

Hi Sandeep,

I followed all the steps of that link.

The attached error I am getting while clicking on the button :

Thanks,

Akhilesh Bhagat.

sandeep_katoch
Contributor
0 Kudos

Hi,

If all the steps are configured correctly then probably you need to place the breakpoint on the function module you have created.

remember o place an external breakpoint and see whether the debugger is triggering or not.

rgds,

sandeep katoch

Former Member
0 Kudos

Hi Sandeep,

As u replied :

If webservice has been configured correctly and you have used it in the format both the places

1: In the form properties

2: In the button properties then it should work.

Second point I get : for this we create a dataconnection which take the URL of webservice.

But how we use the webservice in form property (First point).

Can you please explane.

Regards,

Akhilesh Bhagat.


sandeep_katoch
Contributor
0 Kudos

Hi Akhilesh,

You will first have to define the data connection at form level also

1: Go to layout tab ---> Edit--------> New data connection

2: Choose WSDL file from radio button

3: Give your wsdl webservice name

4: Press finish.

You will see a data connection in data view tab on left side of your form

Hope it helps

Rgds,

Sandeep katoch

Former Member
0 Kudos

Hi Sandeep,

Thanks I did all the steps which u proveded.But still I could not solve the issue.

But in below screen

In above screen one button ZUpdOffBtn is there, what is the use of this .

And when I am clicking on this , it is visible on my Form!!!!

Regards,

Akhilesh Bhagat.

sandeep_katoch
Contributor
0 Kudos

Hi,

This is the button on which you need to provide the data connection name and you will have to use it as the submit button.

Rgds,

Sandeep katoch

Former Member
0 Kudos

Hi Sandeep,

For submit the records I have a different button "SUBMIT TO SAP" which I create while designing the form .

But the button which is associated with the connection is displaying on my form only when I am clicking on this and on run time it is not visible and the second thing the data connection is already created for this automatically.

And the same data connection I provided to my actual button "SUBMIT TO SAP".

Its confusing!!!!!!

Regards,

Akhilesh Bhagat.

sandeep_katoch
Contributor
0 Kudos

Hi Akhilesh,

Yes so now you have to go to the properties of this button and then check the visibility.

make it visible and use this button for the submit.

Actually the thing is now there are two buttons and the coding you have done on some other button.

make this button as defaulyt and do all other changes as you have done for the other one which you created yourself.

Rgds,

Sandeep katoch

Former Member
0 Kudos

Hi Sandeep,

Still not get the solution, facing the same problem .

Is there any other possibility/solution to correct this.

I applied all possible methods.

Regards,

Akhilesh Bhagat.

sandeep_katoch
Contributor
0 Kudos

Hi,

If still you are getting an error then there is an issue with the webservice you have created.

Please test it via following this link

http://help.sap.com/saphelp_nwpi71/helpdata/en/46/7a875063e42d86e10000000a11466f/content.htm

If you need any other option you can have it accomplished via manually uploading the filled form into SAP and then updating the tables.

Rgds,

Sandeep katoch

Former Member
0 Kudos

Hi Sandeep,

Now the data is saving into the table.

But

1.the error pop up is still coming , how can I disable these pops up . I did not write any java script for pop up.

2.If I am uploading 9 records , in a first attempt it is uploading correct but in second time it is uploading 27 records....and so on

When I am using my upload wed dynpro component which is using the same function as used in web service, data is updating correctly.

Please help me to remove these two issues.

Regards,

Akhilesh Bhagat.

sandeep_katoch
Contributor
0 Kudos

Hi Akhilesh,

Glad to know now you are able to save the data.

Now comes these two errors

1: The error that is coming for reading file must be coming somewhere from xml.

Search in xml of the form for messages and remove that particular condition.

2: Check whether the data is clearing or not.

You can include an additional check in the FM you hace created for duplicacy.

One more thing you can do is on submit button you can write a reset form coding.

Hope this helps

Rgds,

Sandeep Katoch

Former Member
0 Kudos

Hi Sandeep,

I checked whole XML but I did not get the error which is coming in the pop up.

Second I want to know about reset form coding.

Thanks & Regards,

Akhilesh Bhagat

sandeep_katoch
Contributor
0 Kudos

Hi,

This is the simple command used to reset the form

xfa.host.resetData();

Rgds,

Sandeep katoch

Former Member
0 Kudos

Hi Sandeep ,

I debugged the Function Module and i found that after excusing the below method , the application is exiting from the debugging and giving the popup.

class lcl_hr_timer implementation.

method if_abap_runtime~get_runtime by kernel module ab_kmGetRuntimeHR.
endmethod.
endclass.

Regards,

Akhilesh Bhagat

sandeep_katoch
Contributor
0 Kudos

Hi Akhilesh,

Then this problem is with your webservice.

Actually here you need to test your webservice only because the error here is coming from ABAP side.

If possible read the documentation of class CL_ABAP_RUNTIME

Rgds,

Sandeep katoch

Former Member
0 Kudos

Hi Sandeep,

Finally the problem solved.

I change the button control EXECUTE to REGULAR and wrote the below code in CLICK event:

var cURL = "URL";

xfa.connectionSet.DC_PRCreateChangeWebService.soapAddress = cURL;

xfa.connectionSet.DC_PRCreateChangeWebService.execute(0);

Thanks & Regards,

Akhilesh Bhagat.

sandeep_katoch
Contributor
0 Kudos

Hi Akhilesh,

very pleased to know that finally the problem solved...

Rgds,

Sandeep Katoch

Former Member
0 Kudos

Hi Sandeep,

The web service issue did not solved yet..

I got a defect in that :

when I am clicking on "SUBMIT TO SAP" button it ask the user-id and password its OK, but it works only for my user id and password .

It is not working for other user-ids and passwords...

Please help me its a big issue ...

Thanks & Regards,

Akhilesh Bhagat.