cancel
Showing results for 
Search instead for 
Did you mean: 

Offline PDF form validation

Ratherfish
Explorer
0 Kudos

I'm in the process of developing an offline interactive adobe form in order to automate the update of multiple ECC custom tables.  I'm going to perform the table update using a Web Dynpro application.  Within the Web Dynpro I want to validate the data in the form to ensure that all the required data is in place for the eventual update of the ECC tables.  In the event that there is an error with the data I want to inform the user the field in error and the required input.

The Web Dynpro has two views.  A main view for the user to select the form to be uploaded and a second view to display the form and contain a button to validate/submit the update data.

I'm familiar with how to build the form, use the required field option, scripting functionality etc...  The form is built with numerous input fields and numerous dropdown lists which have tables that are dynamically bound to them.  There is also a dynamic table that has the remove and add instance instanceManager methods coded.

Where I'm hitting the snag is in the validation-user notification process within Web Dynpro.  There is an on action event button  (outside the InteractiveForm UI element) on the view containing the PDF that triggers the validation.  I identify that there is an error with the data and display the error message in the Message Area of the view containing the form.

The problem is that after the error notification the form now only has the data that was filled in.  The drop down list fields have just the value selected not all the previously available values.  The dynamic table gets cleared losing all the data entered.  The fields with a single value are ok.  I want to give the user uploading the form the ability to correct the data in the form and retry the update but the form now doesn't have all the functionality that it did prior to the validation.

How do I refresh the InteractiveForm UI element so that the form is back in the pre validation state?

I've found bits and pieces to the solution but I don't know how to put it all together.

Component     Release     SP-Level      Support Package     Description

SAP_BASIS     740             0004             SAPKB74004        SAP Basis Component

SAP_ABA        740             0004             SAPKA74004        Cross-Application Component

Accepted Solutions (1)

Accepted Solutions (1)

Ratherfish
Explorer
0 Kudos

I managed to resolve this myself.  Not sure if it's advisable but it worked for me.

In the WDDOMODIFYVIEW method I captured the VIEW reference to a global attribute of the view.

Within the validation method I capture the "pdfSource" to a global attribute of the view using the get_attribute method.

I created an action that I only call programmatically (after I issue the error message) that sets the "pdfSource" to the global attribute value using the set_attribute method.

In the WDDOAFTERACTION method I execute the reset_view method using the global attribute captured earlier in the WDDOMODIFYVIEW as the reference.

ramakrishnappa
Active Contributor
0 Kudos

Hi Gerald,

Please close the discussion by marking answers as helpful / correct answers if those helped you in resolving issue.

Regards,

Rama

Answers (1)

Answers (1)

ramakrishnappa
Active Contributor
0 Kudos

Hi,

You can refresh a view using code VIEW->RESET( ), use the method WDDOMODIFYVIEW(  ).

Regards,

Rama

Ratherfish
Explorer
0 Kudos

I've tried this (the correct method is VIEW->RESET_VIEW()) but the WDDOMODIFYVIEW method only gets called prior to the view being rendered.  I don't want to refresh the view before it's rendered but rather after it has been rendered.

My situation has on the view an InteractiveForm element and a button that triggers the validation of the form as well as the update of the custom tables if the validation is successful.  There is also a MessageArea element on the view to display the validation error messages.

I want to refresh the view after the validation has displays the error messages.  The interactive form should be in the same state that it was in prior to the button for the validation is pressed.  I'm losing the data on the form which renders it useless for the user to correct the error.

I've thought about a pop-up to display the error messages (don't know if that would help) but I want the users to see the errors to help guide them in the correction.

ramakrishnappa
Active Contributor
0 Kudos

Hi Gerald,

First, you need to check if the data gets lost after any action. i.e. if the data is getting lost on any action, then the data is not bound to context / some where the data is being reset from the context.

You can use the MENU for displaying messages, so that it will be available for the user for further reference.

Please check the below document

Display messages in menu - Web dynpro ABAP

For refreshing the view, you can control in wddomodifyview( ) using a view attribute viz GV_REFRESH of type WDY_BOOLEAN

     if wd_this->gv_refresh eq abap_true.

          view->reset_view( ).

          wd_this->gv_refresh = abap_false.

     endif.

Hope this helps you,

Regards,

Rama