cancel
Showing results for 
Search instead for 
Did you mean: 

Offline Adobe Form:Call web service & send complete form data in xml format

Former Member
0 Kudos

Hi,

I am working on a Offline Interactive Adobe Form scenario.

The scenario is that the end user can download the form into his/her desktop/laptop.

Then fill the data in the form and submit the form by clicking a button on the form itself.

The entire form data should be sent in xml format to the SAP system.

I am using web service to send data to SAP system.

Steps Followed:

1) Create a RFC Function Module in SAP system and create a web service from it.

2) Do the necessary settings in SOAMANAGER. Get the WSDL file for the web service.

3) Create a Adobe form using transaction SFP.

4) Create a new data connection using the WSDL file.

5) Add a new field "XML_DATA" on the form. Data Type (String or XString???)

6) Add a button on the form. On click of the button, use javascript to fill the field "XML_DATA" and call the web service.

The issue is when i use the data type "XTRSING", the web service itself is not called and i get an error stating "Cannot Read from file 'wsdl'".

When i use the data type "String", the form on the field displays the entire xml data but when i debug the web service, the xml data i get is truncated.

Q1) Should i use XSTRING or STRING?

Q2) If XStRING, how do i get rid of the error?

Q3) If STRING, how do i make sure that the entire xml is transported?

Of course the other solution i can think of is to map all fields on the adobe form to the web service.

Then in the web service use a XSLT Transformation to convert the entire form data to xml data.

But from what i gather from all SDN Forums and blogs, adobe form should send me the data in XML format.

So me converting the data into xml seems absurd to me.

Please help me out here as this is a show-stopper.

Thanks and Regards

Gaurav Kumar Raghav

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Gaurav ,

I am facing the same issue in offline ADOBE form.

can u please tell me what did you do to remove this error.

Thanks,

Akhilesh Bhagat.

Former Member
0 Kudos

Hi guys, I worked this out. And I am able to post as in create sales order with minimum fields which are mandatory. Gaurav from first post mentioned everything right. But in step 4..I have worked out something different. I am not sure that's the issue..but it might be helpful for you guys...

In SOAManager, once XML code is visible, I have saved the whole IE window as a file with WSDL extension... for example... Upload.WSDL...

After that,, going to SFP, creating empty interface.. and in adobe layout, new data connection,,, WSDL...browsing it for the saved WSDL file.... and then drag and drop.. along with response option which shows created SO....and button to submit....

Note:   I tried to drop the whole has a table in adobe layout, but it wasn't reflecting when I download the form as PDF... so have manually selected each node in adobe layout.

Saving and activating... and a download program for downloading PDF to desktop... guess all are aware of fillable option of PDF as F and dynamic as X......Guys.....Fillable as X doesn't allow you to save the PDF with data......

Entering relevant data....and clicking button should do the job.....First time execution of PDF....generally gives a warning and a confirmation to access privileged sources, and saving it and re-executing the PDF should do it...

I had to get SAPALL access rights from the SAP Security for my userid... though there are specific roles needed for successful Webservice posting....

Hoping...this might help... please get back to me...for further questions.....

This is my first solution posting.... might be a bit jarred and technical jargon missed out...Bear with me

Former Member
0 Kudos

Hi Santhosh,

I am able to save the data to the table but , the error pop up is  coming , how can I disable these pops up . I did not write any java script for pop up.

Regards,

Akhilesh Bhagat.

Former Member
0 Kudos

Hi Akhilesh, sorry for the delayed response... error pop-ups coming up,,,,, where are these coming up???  while saving... As you mentioned that.....data is getting saved.... if the pop-up's are coming from the PDF side.... there should be a NO-DIALOG = 'X' in the program which has been employed to download the PDF...

Please let me know.... if I misunderstood.... I am ready to share the screenshots as well as the code for downloading PDF....

Cheersss

Former Member
0 Kudos

Hello Santhosh,

While downloading the form I am not getting popup.

I have button "SUBMIT TO SAP" in the form , the functionality of this button is to save the data to the CATSDB table (SAP table to save the time recording).

When I am clicking on this button data is saving to the table but I am getting the below popup.

Regards,

Akhilesh Bhagat.

Former Member
0 Kudos

Akhilesh...I guess...this might be the solution...

https://rapidshare.com/files/1173638957/Webservices.jpg

......Please download the JPEG file..screenshot of the issue...If that's exactly your issue... then ...u can c on top of the PDF...yellow bar showing features disabled.....There, you can select options...and select''TRUST THIS DOCUMENT ALWAYS'... and then it pops up for saving...save it and then run .... it should work.....

If it doesn't...then your system's host is not connecting....so In SYSTEM32 of windows in drivers folder... you need to update hosts... with IP... which is basis job.....

Hope this helps you out.... Let me know...otherwise..

Note: I am not sure.,..if I can post a link to download a screenshot... as I wasn't able to paste it...

If it is forbidden, consider it as a first offence and warn off...

Thanks

Former Member
0 Kudos

Hi Santhosh,

After saving t he form in the desktop the yellow bar is not coming and IP is already updated.

Regards,

Akhilesh Bhagat.

Former Member
0 Kudos

Akhilesh,, My best guess.. is some security constraints are stopping webservice. While creating webservice in function module...in wizard, 3rd step,,,the level of protection you have chosen might be affecting...

Secondly, in SOAMANAGER, if you select webservice, click on edit, and scroll down...a userid, password and language fields will be available and, they must be filled....

Please try it...as my understanding goes, tat might be the issue....

Let me know otherwise-----

Santhosh

Former Member
0 Kudos

Hi Santhosh,

The level of protection is LOW , which is by default.

In soamanager I gave the user Id password.

Important thing is that data is updating successfully to the back end , if data is saving successfully then this pop up should not come.

Pop up should come when data is not saving to the back end.But in my case data is saving successfully.

Thanks & Regards,

Akhilesh Bhagat

Former Member
0 Kudos

Ok, I am still thinking... but my guess, is the properties of the PDF downloaded, that's triggering this message... as data is getting posted, Webservices are perfect and so is Adobe....

I will do my research.... but the download program you used for getting PDF,,, please look for options of ouput params u have missed out... I will try to find the solution .....

Former Member
0 Kudos

Akhilesh,,,Got an idea.... 2 things..

1)  the function module you are using must have mandatory fields...import and export.....In WSDL the export is saved as response... and you need to place that on the PDF for the ouput to display...

In my case.... I am trying to create a sales order, with minimum required fields... and I do have a extra field in place in my PDF saying, created sales order....and mapped it to response in the adobe layout.... Once i execute the PDF... after 6-8 seconds...I get the sales order number in that box...

tats case 1...

2)  binding issue in Adobe... if you are dragging and dropping as table instead of nodes....hope u got my drift......

Former Member
0 Kudos

Hi Santhosh ,

Did not get Solution yet 

You were saying about ,the properties of the PDF downloaded,can u pls explane with screen shot.

Regards,

Akhilesh Bhagat.

Former Member
0 Kudos

Akhilesh,,,, if u checked the binding and mandatory fields and if all is placed correctly, I am not able to figure out what can go wrong????  For the coding part you mentioned...

ie_outputparams-getpdf = 'X'.

ie_outputparams-nodialog = 'X'.

fp_docparams-langu = 'E'.

fp_docparams-country = 'US'.

fp_docparams-FILLABLE = 'F'.

fp_docparams-DYNAMIC = 'X'.

the whole logic is below

data: ie_outputparams type sfpoutputparams.

data: i_name type fpname,

       i_funcname type funcname.

data: fp_docparams type sfpdocparams.

data: fp_formoutput type fpformoutput.

data: data_tab type SOLIX_TAB.

ie_outputparams-getpdf = 'X'.

ie_outputparams-nodialog = 'X'. " suppress printer dialog popup

CALL FUNCTION 'FP_JOB_OPEN'

   CHANGING

     ie_outputparams = ie_outputparams.

try.

     i_name = 'XXXXXXXXXXXXXXXXXXXXXX'.   "Your Form Name

     CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'

       EXPORTING

         i_name     = i_name

       IMPORTING

         e_funcname = i_funcname.

   catch cx_fp_api_repository.

   catch cx_fp_api_usage.

   catch cx_fp_api_internal.

endtry.

fp_docparams-langu = 'E'.

fp_docparams-country = 'US'.

fp_docparams-FILLABLE = 'F'.

fp_docparams-DYNAMIC = 'X'.

CALL FUNCTION i_funcname

   EXPORTING

     /1bcdwb/docparams  = fp_docparams

   IMPORTING

     /1bcdwb/formoutput = fp_formoutput

   EXCEPTIONS

     usage_error        = 1

     system_error       = 2

     internal_error     = 3.

CALL FUNCTION 'FP_JOB_CLOSE'

   EXCEPTIONS

     usage_error    = 1

     system_error   = 2

     internal_error = 3

     others         = 4.

data: filename type string,

path type string,

fullpath type string,

default_extension type string value 'PDF'.

cl_gui_frontend_services=>file_save_dialog(

exporting

default_extension = default_extension

changing

filename = filename

path = path

fullpath = fullpath ).

check fullpath is not initial.

CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'

   EXPORTING

     buffer     = fp_formoutput-pdf

   TABLES

     binary_tab = data_tab.

cl_gui_frontend_services=>gui_download(

exporting

filename = filename

filetype = 'BIN'

changing

data_tab = data_tab ).

cl_gui_frontend_services=>execute(

exporting

document = filename ).


Try to download and workout with this logic and let me know..

Thanks


Former Member
0 Kudos

Hi Santhosh,

i_funcname does not exist.

Regards,

Akhilesh Bhagat.

Former Member
0 Kudos

Hi Santhosh ,

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

Former Member
0 Kudos

Please copy the whole mentioned above program and just replace your form name.... Downloading it will be done...

Coming to popup....I am still trying to figure out...... asked couple of guys... they were of same opinion about authorization...since you are mentioning method....will try to figure out.....how to disable the pop-up....

Will get back to u, Please do let me also know..if you are able to disable it.... I am eager to learn

Thanks

Former Member
0 Kudos

Hi Santhosh,

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.

Former Member
0 Kudos

Congrats Akhilesh...very glad...after all the effort.... you were able to fix the issue....

great job.....It was pleasure interacting with you.....Looking forward to interacting with you again...

Cheers

Former Member
0 Kudos

Hi Santhosh,

I came back ....

but with the issue .....

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.

NithinBacholla
Explorer
BenPatterson
Participant
0 Kudos

Hello Gaurav,

You don't need to manipulate the WS XML at all. You can just use the data connection execute button. You can drag and drop this from the data connection definition in the data view palette on to your form. Adobe Reader and SAP abstract and handle the XML layer for you and the web service will be called with the data values bound to the connection.

I hope this makes sense and helps you.

Ben.

former_member906594
Participant
0 Kudos

Hi,

I am in the same scenario ( offline forms with weservice ) as described above .

I am getting an error saying 'Error unable to read the WDL file '. any clue ?

can u also let me know what the form type should be . i am using standard layout.

should I do anything else to invoke the webservice from form .