cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic Table data cannot be Read.

Shishir_P
Explorer
0 Kudos

Hello,

I have an Adobe Interactive form and I am trying to read the data from the Dynamic Table I have in the Form. The Problem is when I try to read the data using the below code, the data which is entered by user data cannot be read for some reason.

  • navigate from <CONTEXT> to <ADR_DATA> via lead selection

lo_nd_adr_data = wd_context->get_child_node( name = wd_this->wdctx_adr_data ).

  • navigate from <ADR_DATA> to <PREV_EMPLOYMENT> via lead selection

lo_nd_prev_employment = lo_nd_adr_data->get_child_node( name = wd_this->wdctx_prev_employment ).

  • get element via lead selection

lo_el_prev_employment = lo_nd_prev_employment->get_element( ).

  • get all declared attributes

"lo_el_prev_employment->get_static_attributes_table(

lo_nd_prev_employment->get_static_attributes_table(

IMPORTING

table = form_data-prev_employment ).

I have:-

1. Checked the Binding on Adobe Form

2. Checked the Context for the same.

3. Checked the Cardinality of the Nodes.

Please let me know in case i am missing something.

Regards,

Shishir.P

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

if you add new rows in adobe form, your context in web dynpro doesn't know anything about them (you have no context elements for these added rows), I have a workaround to solve this issue by reading directly the xml stream coming from adobe form to web dynpro in submit event and adding context elements.

Regards Jiri

Shishir_P
Explorer
0 Kudos

Hello,

I have tried other method as well but was unsucessful, the procedure is below:-

1. Get PDF content of online form by reading the context.

2. Convert this data to XML

l_fp = cl_fp=>get_reference( ).

l_pdf = l_fp->create_pdf_object( ).

l_pdf->set_document( pdfdata = pdf_data ).

l_pdf->set_task_extractdata( ).

l_pdf->execute( ).

l_pdf->get_data( IMPORTING formdata = l_xstring ).

CLASS cl_ixml DEFINITION LOAD.

DATA: g_ixml TYPE REF TO if_ixml,

streamfactory TYPE REF TO if_ixml_stream_factory,

istream TYPE REF TO if_ixml_istream,

document TYPE REF TO if_ixml_document,

parser TYPE REF TO if_ixml_parser.

g_ixml = cl_ixml=>create( ).

streamfactory = g_ixml->create_stream_factory( ).

  • wrap the table containing the file into a stream

istream = streamfactory->create_istream_xstring( l_xstring ).

document = g_ixml->create_document( ).

parser = g_ixml->create_parser( stream_factory = streamfactory

istream = istream

document = document ).

parser->parse( ).

3. Read the data from the XML. (I was able to extract other data on the form but not the one in the table. The data entered in the table row in the interactive form is not getting converted into XML or not being extracted in PDF at all).

form_data = get_adr_from_xml( document ).

The Code Wizard is an old one and does not support table operations as the new code wizard. Please let me know in case you have any other method of resolving this issue.

Please let me know your work around, I am in desparate need for a solution.

Regards,

Shishir.P

Edited by: Shishir Paltanwale on Apr 21, 2010 8:16 PM

Former Member
0 Kudos

Hi,

you have good beginning, now we should continue:

I have used this code:


DATA: l_fp TYPE REF TO if_fp.
l_fp = cl_fp=>get_reference( ).

DATA: l_pdfobj TYPE REF TO if_fp_pdf_object.
l_pdfobj = l_fp->create_pdf_object( ).
l_pdfobj->set_document( pdfdata = lv_pdfsource ).
l_pdfobj->set_extractdata( ).
l_pdfobj->execute( ).

DATA: pdf_form_data TYPE xstring.
l_pdfobj->get_data( IMPORTING formdata = pdf_form_data ).

DATA: converter TYPE REF TO cl_abap_conv_in_ce, formxml TYPE string.
Converter = cl_abap_conv_in_ce=>create( input = pdf_form_data ).
Converter->read( IMPORTING data = formxml ).

TYPE-POOLS: ixml.
DATA: l_ixml TYPE REF TO if_ixml.
l_ixml = cl_ixml=>create( ).

DATA: streamfactory TYPE REF TO if_ixml_stream_factory,
istream TYPE REF TO if_ixml_istream.
streamfactory = l_ixml->create_stream_factory( ).
istream = streamfactory->create_istream_string( formxml ).

DATA: document TYPE REF TO if_ixml_document.
Document = l_ixml->create_document( ).

DATA: parser TYPE REF TO if_ixml_parser.
parser = l_ixml->create_parser( stream_factory = streamfactory
                                           istream = istream
                                           document = document ).
Parser->parse( ).

DATA: node TYPE REF TO if_ixml_node.

data : item type string.  DATA: nodechild TYPE REF TO if_ixml_node,
        Childschild TYPE REF TO if_ixml_node.
    data: num_of_children type i,
          x type i,
          y type i,
          num_of_attribute.

node = document->find_from_name('ZAM_PROTSTROJF'). "name of table
num_of_children = node->num_children( ).
nodechild = node->get_first_child( ).
data: wa_strojdetail type ZAM_PROTSTROJF,
      wa_strojdetail_tab TYPE TABLE OF ZAM_PROTSTROJF.

Former Member
0 Kudos

next part:


y = 1.
do Num_of_children times.
       num_of_attribute = nodechild->num_children( ).  "  Getting the number of attributes
       Childschild = nodechild->get_first_child( ).
       wa_strojdetail-itemnum  = y.
       x = 1.
       do num_of_attribute times.
          item = Childschild->GET_value( ).
          CASE x.
            WHEN 4.
              wa_strojdetail-anln1 = item.
            WHEN 5.
              wa_strojdetail-anln2 = item.
            WHEN 6.
              wa_strojdetail-bubtr = item.
            WHEN 7.
              wa_strojdetail-belnr = item.
          ENDCASE.
          Childschild = Childschild->get_next( ).
          x = x + 1.
      enddo.
      y = y + 1.
      APPEND wa_strojdetail to wa_strojdetail_tab.
      nodechild = nodechild->get_next( ).
 enddo.

   DATA lo_nd_zam_protstrojf TYPE REF TO if_wd_context_node.
*  navigate from <CONTEXT> to <ZAM_PROTSTROJ> via lead selection
   lo_nd_zam_protstroj = wd_context->get_child_node( name = wd_this->wdctx_zam_protstroj ).
*  navigate from <ZAM_PROTSTROJ> to <ZAM_PROTSTROJF> via lead selection
   lo_nd_zam_protstrojf = lo_nd_zam_protstroj->get_child_node( name = wd_this->wdctx_zam_protstrojf ).

lo_nd_zam_protstrojf->bind_table( new_items = wa_strojdetail_tab ).

This code is very old, my knowledge of ABAP is much better now

Regards Jiri

Shishir_P
Explorer
0 Kudos

Jiri,

I am trying to implement the solution that you have provided but I am still faccing some problems, can I send you detailed document explaining my problem? Perhaps after learing the issue you may be in better position to answer my queries.

Regards,

Shishir.P

Former Member
0 Kudos

Hi,

you can send me any aditional informations about your problem.

Regards Jiri

Shishir_P
Explorer
0 Kudos

Jiri,

Since the document I prepared was big and with screen shots and could not be shown on SDN, I have mailed you the same at the email address in your business card, please let me acknowladge the receipt of the same.

Regards,

Shishir.P

Former Member
0 Kudos

Hi,

have you received my solution? If yes and is working please describe your knowledge here too.

Regards Jiri

Shishir_P
Explorer
0 Kudos

Jiri,

Thanks for taking out time to find solution for me, I have been trying to use your solution and I still am not able to get any data in Web Dynpro from Adobe Form.

I was experimenting to see if the I was able to capture the data entered on the online form in the PDF content, hence I simply extracted the PDF content and downloaded on the local desktop to see if the PDF content has what was entered in the interactive dynamic tables, and I found that PDF Form downloaded on desktop does not have the Data entered in the dynamic Tables.

Only for those fields which were stand alone and not part of any table, the value was captured. However, I had used a similar solution to that of yours for offline scenario and for some reason it worked when the PDF is uploaded from desktop, but same code fails to extract data from online PDF form once provided with PDF content.

I also looked into some notes and the SAP note 1392968 indicates that Dynamic Tables are supported in ABAP Dynpro in SAP only in and after versions Netweaver 7.0, Enhancement Package 2 (7.02). The note says there is an attribute which enables the Dynamic tables, please look into the code below, you need add this in your Web Dynpro WDDOMODIFYVIEW:-

DATA l_interactive_form TYPE REF TO cl_wd_interactive_form.

l_interactive_form ?= view->get_element( `INTERACTIVE_FORM` ).

DATA l_ifba_hndl TYPE REF TO if_wd_iactive_form_method_hndl.

l_ifba_hndl ?= l_interactive_form->_method_handler.

l_ifba_hndl->set_dynamic_tables_enabled( abap_true ).

Below versions of Web Dynpro cannot interpret Dynamic tables.

Thanks for all the help, I am still open to suggestions and work arounds if you have any.

Regards,

Shishir.P

Former Member
0 Kudos

Hi,

my solution works on ECC 6.0 system without any enhancement package so it is based on netweaver 7.0. Yes note is correct, dynamic table is not supported, but my workaround enable them to use.

Regards Jiri

Former Member
0 Kudos

Hi,

There is a work around for your problem which I had used in my form.

For this you need to have rough idea of the maximum number of records the user might enter.

While loading the form , you can append those many number of blank records in the table and then bind it to the node.

On the form , you can uncheck the tick of "Repeat Row for each Data Item". So you now have a table with just 1 row displayed.

Here you can also provide the user with buttons to add/remove rows from the table.

In the backend you will have your table data with the blank records. You just have to ignore the blank records.

Do revert if more explanation required.

Thanks & Regards,

Omkar Miravnkar.

Shishir_P
Explorer
0 Kudos

Hello,

Well the maximum number of records that a user can enter is 3, so that part can be handled to append the number of blank records.

In the other part where you say that I should uncheck the check box to repeat row for every new item, in that case the we are declaring the table as normal table and the JAVA code to add an new instance does not work, as in the backend SAP does not allow to add a new row at runtime and no rows can be appended in the table in the form. In other words the table does not remain dynamic any more and it simply does not suit the business requirement.

And after having said this, the main problem still persists the table being dynamic one and is used in both online and ofline scenario, the data still cannot be exchanged for dynamic tables from ONLINE ADOBE FORM and to WEB DYNPRO and vice versa.

Any other suggestions?

Regards,

Shishir.P

Shishir_P
Explorer
0 Kudos

Jiri,

I am sure your solution works on ECC 6.0. I am working on ECC 6.0 as well, but this has got to something with ABAP patch level, it could be possible that be our systems is on lower support level.

Thanks,

Shishir.P

Former Member
0 Kudos

I was experimenting to see if the I was able to capture the data entered on the online form in the PDF content, hence I simply extracted the PDF content and downloaded on the local desktop to see if the PDF content has what was entered in the interactive dynamic tables, and I found that PDF Form downloaded on desktop does not have the Data entered in the dynamic Tables.

.

Hi,

there is something strange with your form. Is it a ZCI XML based form? Try to save your form with filled table to your local disk, open it in adobe reader and then in reader in Menu->Document->Forms->Export data -> save this file to disk. Now you have XML file with data typed into. Do you have all data rows of your dynamic table in this xml?

Regards Jiri

Former Member
0 Kudos

Hello,

in that case the we are declaring the table as normal table

The table has to be binded so that it has blank rows which will be hidden by removing that check box.

the JAVA code to add an new instance does not work, as in the backend SAP does not allow to add a new row at runtime and no rows can be appended in the table in the form

As the table already has 3 rows you need not go back to SAP on each click on Add Row button, just add a instance of that row to the table using code

 <path>.Table.Row.occur.max = "3";
<path>.Table.Row.instanceManager.addInstance(1); 

Shishir_P
Explorer
0 Kudos

Jiri,

I tried what you have suggested, I saved the form on my desktop with some data in the rows and then convereted this into XML and I could see all the rows with data in the XML. The problem starts when I have Download funcitionality and I have to extract the PDF content in Web Dynpro. To my undersatnding the Data is first transfered to ADS and from ADS it is further transfered to Web Dynpro, I think the ABAP Web dynpro is not able to undersatnd the Dynamic Tables. Please correct me if I making any mistake.

Is there way I can use the Save Funcitonality of Adobe at run time and then convert it to XML and then pick it up once again in XML format and then read it web dynpro? This concept may require JAVA, and unfortunately my expertise in that field is limited. Can you help ?

Regards,

Shishir.P

Former Member
0 Kudos

Hi,

my solution does NOT require java. As I wrote above simply extract xml from pdf stream in submit event in web dynpro abap.

Please look at my screenshots:

My dynamic form:

http://jura55.rajce.idnes.cz/nastenka/#adobe_form.jpg

(Pridej radek means Add row in czech)

Data in abap debugger:

http://jura55.rajce.idnes.cz/nastenka/#abap_debugger.jpg

num_of_children = number of datarows in adobe form

num_of_attribute = number of colums of table

Please note that data are coming from index of attribute >3

Regards Jiri

Edited by: Jiri Neuzil on Apr 26, 2010 10:39 AM

Shishir_P
Explorer
0 Kudos

Jiri,

I hope to explain this and hopefully convey my point in a way you could understand. I have gone through your links and understand the solution works for you. I am converting the PDF content to XML. I fetch the PDF in Web dynpro ABAP content using:-

  • get single attribute

lo_el_adr_pdf->get_attribute(

EXPORTING

name = `PDF`

IMPORTING

value = lv_pdf ).

After I have got the PDF content I have tried to do two things:-

1 . Download the form simply to check if the data entered in Form has been captured. (It was not captured and blank form was downloaded).

2. Convert this in XML using the solution you provided and try to extract the data entered by the the User.

My finding says that when the PDF content is extracted in Web Dynpro ABAP, it does not contain what was entered by user on Screen. Hence even it was convereted to XML, the Data is not there in XML content.

However, I was thinking of another approach of using the SUBMIT button on Adobe Form to Save the form as XML using JAVA Script on the desktop at remote location and the picking it up once again, this way data will be captured from Adobe form and hopefully everything entered by the user will be present in XML content which can later be later extracted in SAP.

Regards,

Shishir.P

Former Member
0 Kudos

Hi,

and normal (not table data) which you enter into the form are OK? Can you read them? Or they can be automatically written to context, is this working?

And pls try to set your context table node cardinality to 1..n and enter some data to first row... this data must be retrieved from form automatically to first context element of table node.

Regards Jiri