cancel
Showing results for 
Search instead for 
Did you mean: 

Saving values into table from Interactive Form

Former Member
0 Kudos

Hallo together,

iam trying to do the example "Include Tables" (SAP Interactive Forms by Adobe - Galileo Press).

It works, but not as described. When i want to change data in the interactive_forms ui element and press the webdynpro native button send, the value at the webdynpro table does not change. When i change the value at the webdynpro table and press the send button at the form or change the line at the webdynpro, the value in the adobe formular changes too. Thats one problem.

The other problem is that i want to save the changed/added data from the formular at the database. What to do? The form layout is "ZCI Layout" and i added the script:

DO NOT MODIFY THE CODE BEYOND THIS POINT - 800.20070708051308.406522.403406 - ContainerFoundation_JS

I also added this into "wddomodifyview":

METHOD wddomodifyview .

DATA: lr_interactive_form TYPE REF TO cl_wd_interactive_form,

lr_method_handler TYPE REF TO if_wd_iactive_form_method_hndl.

CHECK first_time = abap_true.

lr_interactive_form ?= view->get_element( 'FORM' ).

lr_method_handler ?= lr_interactive_form->_method_handler.

lr_method_handler->set_legacy_editing_enabled( abap_true ).

ENDMETHOD.

I selected also:

execute at: "Server and Client"

I dont know what to do anymore.

Best regards

Philip

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

i have done what you told me. there are no more errors, but changes in the pdf table dont change the scarr table in the data base. after debugging this method i could see that lt_scarr is unmodified.


METHOD onactionstart .

  DATA lo_nd_data_source TYPE REF TO if_wd_context_node.
  DATA lo_nd_scarr TYPE REF TO if_wd_context_node.
  DATA ls_scarr TYPE wd_this->element_scarr.
  DATA lt_scarr TYPE wd_this->elements_scarr.

  lo_nd_data_source = wd_context->get_child_node( name = wd_this->wdctx_data_source ).

  lo_nd_scarr = lo_nd_data_source->get_child_node( name = wd_this->wdctx_scarr ).

  CALL METHOD lo_nd_scarr->get_static_attributes_table
    IMPORTING
      table = lt_scarr.

ENDMETHOD.

Former Member
0 Kudos

Its hard to know the exact reason. By the way please have a look into this doc

http://www.scribd.com/doc/16215702/Dynamically-Adding-Rows-Into-a-Table-in-WD4A

Thanks,

Abhishek

Former Member
0 Kudos

Thanks for your answer!

I did what you wrote. Just had to add one more line to the data part.


lo_nd_scarr type ref to if_wd_context_node.

When i klick on "Send" know i get an RABAX-Error:


Access via 'NULL' object reference not possible

Greetings,

Philip

(first online interactive form )

Edited by: Philip Schmidberger on Jun 4, 2009 3:04 PM

Former Member
0 Kudos

You need to access that particular node and get a refernce then the error will go.

Something like this.

You can use code wizard and do a read context of your SCARR node.

something like this will come

data lo_nd_data_source type ref to if_wd_context_node.

data lo_nd_scarr type ref to if_wd_context_node.

data ls_scarr type wd_this->element_scarr.

data lt_scarr type wd_this->elements_scarr.

lo_nd_data_source = wd_context->get_child_node( name = wd_this->wdctx_data_source ).

lo_nd_scarr = lo_nd_data_source->get_child_node( name = wd_this->wdctx_scarr ).

Then use the method to get all the values.

Thanks,

Abhishek

Edited by: abhishek sinha on Jun 4, 2009 4:08 PM

Edited by: abhishek sinha on Jun 4, 2009 4:10 PM

Former Member
0 Kudos

up

Former Member
0 Kudos

1. I created a dynpro in se80

2. next created a new element "interactive_form" under "rootuielementcontainer"

3. view layout of the element:

Layoutdata: RowHeadData

displayType: native

enabled: true

onSubmit: START (new method without code)

4. view context:


DATA_SOURCE (node) (1:1, no Type)
   SCARR (node) (0:n, Type SCARR, Supply Function S_SCARR)
      CARRID (attribute)
      CARRNAME (attribute)
      CURRCODE (attribute)
      URL (attribute)


METHOD s_scarr .

  DATA: lt_scarr TYPE wd_this->elements_scarr.

  SELECT * FROM scarr INTO TABLE lt_scarr.
  node->bind_table( new_items = lt_scarr ).

ENDMETHOD.

5. added a new "templateSource" with "dataSource" from the context

6. started layout editor


Layouttype: ZCI Layout

pasted the WebDynpro Script


DATA_SOURCE.#variables[0].ContainerFoundation_JS - (JavaScript, client)

// DO NOT MODIFY THE CODE BEYOND THIS POINT - 802.20071213024549.437972.436489 - ContainerFoundation_JS

pasted the "Send"-Button from "WebDynpro native" into the form

and at least pasted the table "SCARR" vom "Dataview" below the button by drag and drop.

7. created new webdynpro application

8. save + active all components/forms

9. test

Former Member
0 Kudos

Hi,

To make an input enabled table. I would suggest to use TABLE element from the PDF library and then binding the columns from your context.

Step 1: Library -> Standard ->Table

Select create using assistance.

Select body rows vary depending on data .

Select number of Columns in your case it will be 4.

Then proceed further and finish as per your need.

Step 2:

Select a table Column .

Select Pallets->Object then chnage the cell type from Text to text field.

Then click on binding tab and bind it to the respective field from hierarchy.

Select upgrade the following properties radio button and check only "default value" option.

This will create binding something like this $record.SCARR.DATA[*].CARRID

Follow this for all other columns.

Step 3:

Now create a button in the View holding your form(you can also use SUBMIT button of form). On action event of this button right the following code to get all the changed values from Table.

data lt_scarr type wd_this->elements_scarr.

call method lo_nd_scarr->get_static_attributes_table

importing

table = lt_scarr.

LT_SCARR will contain all the new values from Form. Then use this table to update ur database table.

Thanks,

Abhishek

Former Member
0 Kudos

Hi,

Generally the data flow takes place automatically if the form fields are bound to the context of the node containing the ITF.

I am not sure how are you designing your TABLE element in Adobe. If you are making use of scripts to add rows dynamically to the table then all the data entered will not be available in your corresponding view context node.

To get around this problem try placing a BUTTON in the view having PDF and on click of this add an element to the node which will in turn bound to the table element of the form. This way whenever you click this button a row will be added to your table in the form and data will be available to the corresponding node when you submit the form.

Since i am not aware of the test scenario you are developing so can't say much right now. If you can provide more details then it will help.

Thanks,

Abhishek