Skip to Content

In part 1 (http://scn.sap.com/docs/DOC-42813), I discussed the following scenario: you have an interactive form embedded on the ABAP WebDynpro view and want to email a static copy of the form to an internet email address.

In this document, I will extend the emailing of the form to actually send an interactive form to the email address.  This will allow the recipient to edit the form and submit a call to SAP for updating or retrieving form values.  You will need the WSDL from a web service which exists in the SAP environment.  The form will call the web service and will send/retrieve values to/from SAP.  If you have already looked at Steps 1 through 11 in part 1, go directly to Step 12 for the additional steps for emailing an interactive form.

Step 12:  Emailing an Interactive Form

Now that we have a working form that is able to be emailed, let’s make the form interactive and allow the emailed receiver able to interact with the form and send or receive data to/from SAP.

In one of my web service demo documents (http://scn.sap.com/docs/DOC-38805), I created a web service, which I will also use to call in this forms example.  The web service requires authentication by a valid user to access it.  The WSDL for the service, which I obtained from SOAMANAGER, is as follows:

http://<your server>/sap/bc/srt/wsdl/srvc_5139057D1E052530E10080000A0D9C1F/wsdl11/allinone/ws_policy/document?sap-client=222

Go into the form editor for form:  ZADB_FRM_EMAIL_1 and right click in the data view to select “New Data Connection”:

/wp-content/uploads/2013/06/p_231599.jpg

Select “WSDL File” and give the connection a name (then choose “Next”):

/wp-content/uploads/2013/06/p_231599.jpg

Enter the WSDL (then choose “Next”):

/wp-content/uploads/2013/06/p_231599.jpg

Select the Operation (then choose “Next”):

/wp-content/uploads/2013/06/p_231599.jpg

Select the Security (then choose “Finish”):

*Since my Web Service is required to only accept a valid login, I’m choosing to pass credentials.

/wp-content/uploads/2013/06/p_231599.jpg

Here is some more information on the types of security options available:

/wp-content/uploads/2013/06/p_231599.jpg

Now drag the “DataConnection1” Node from the Data View onto your form:

/wp-content/uploads/2013/06/p_231599.jpg

Notice you get the button which is the action trigger to call the web service.  I also got one output field to display the contents of the value returned by the web service.  Activate the form.

Back in the ABAP WebDynpro editor, enable the InteractiveForm element (set Enabled):

/wp-content/uploads/2013/06/p_231599.jpg

Remember the one line of code which was commented out in the ONACTIONEMAILFORM?  Now it’s time to uncomment that line so the form is editable by the person receiving the email.

fp_docparamsfillable = ‘X’. “Only Use this is Form is Fillable by receiver.

Activate everything and test:

First:  Email the Form

/wp-content/uploads/2013/06/p_231599.jpg

When the form arrives in the email, try selecting the Hello World Button:

Notice, a popup opens requesting credentials:

/wp-content/uploads/2013/06/p_231599.jpg

After logging in, the SAP Web Service is called and the form is updated with the data from SAP:

/wp-content/uploads/2013/06/p_231599.jpg

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply