cancel
Showing results for 
Search instead for 
Did you mean: 

Reading data from pdfsource of adobe form

Former Member
0 Kudos

Friends,

This error pertains to the retrieving data when executing the WDA application.

System details: NetWeaver 2004s. ADS support pack 16.

The Adobe Livecycle Designer version: 7.1.3129.1.296948

The Adobe Reader version: 8.1

The SAP GUI version: 710.

The Web Dynpro component is active.

The Custom Adobe Form is active and is of ZCI layout type. I also inserted the Web Dynpro Script in the layout of the form.

The Custom Form Interface is active and is of XML Schema-Based Interface type. The XML schema source is generated.

The Adobe form has been included as an InteractiveForm UI element in the MAIN view of the WD Component. The displayType property of the InteractiveForm UI Element has been set to "native" and enabled property of the form is checked.

I have included an attribute of type XSTRING called 'USERDATA' under the root context node and set it as pdfsource for the adobe form UI element.

I have included the "Submit" button from web dynpro native library in the form.

I have created a event handler method for the "onSubmit" event of the Adobe form UI element. I have created a reference to the context node 'ZECR' that is the datasource for the adobe form, through the following lines:

data: noderef type ref to if_wd_context_node,

eleref type ref to if_wd_context_element.

noderef = wd_context->get_child_node( name = 'ZECR' ).

when i run the WDA application, i am getting the error:

Subnode MAIN.USERDATA does not exist

Please let me know to rectify this error.

I am not sure how to proceed further ie how to retrieve the data from the XSTRING attribute. I need to populate the data from the attribute to a customized table.

Any hints or help would be greatly appreciated.

Thanks and Regards.

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>I am not sure how to proceed further ie how to retrieve the data from the XSTRING attribute. I need to populate the data from the attribute to a customized table.

Why are you even trying to parse the pdfSource? With ZCI based forms, the framework will do all of this for you and autorestore the data values back into a context node that you have bound to the dataSource property of the interactiveForm.

former_member189058
Active Contributor
0 Kudos

Hi Thomas,

Say I have foll Context struct

DATASOURCE 1..1

ND_01 0..n

attrib_01

attrib_02

..

attrib_n


 lo_node  = wd_context->get_child_node( wd_this->wdctx_datasource ).
 
lo_node = lo_node->get_child_node( wd_this->wdctx_nd_01 ).

data itab type wd_this->elements_nd_01.

lo_node->get_static_attributes_table(
  importing
    table = itab ).

Would I have the data uploaded in the pdf in itab if my pdf has ND_01 as a table?

Edited by: Reema Shahbazkar on Aug 28, 2008 2:22 AM

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>

> Hi Thomas,

>

> Say I have foll Context struct

> DATASOURCE 1..1

> ND_01 0..n

> attrib_01

> attrib_02

> ..

> attrib_n

>

>


>  lo_node  = wd_context->get_child_node( wd_this->wdctx_datasource ).
>  
> lo_node = lo_node->get_child_node( wd_this->wdctx_nd_01 ).
> 
> data itab type wd_this->elements_nd_01.
> 
> lo_node->get_static_attributes_table(
>   importing
>     table = itab ).
> 
> 

>

> Would I have the data uploaded in the pdf in itab if my pdf has ND_01 as a table?

>

> Edited by: Reema Shahbazkar on Aug 28, 2008 2:22 AM

Yes that should be the case as long as DATASOURCE matches the context of the form interface - it gets restored just an online interactive form.

former_member189058
Active Contributor
0 Kudos

Thanks Thomas!!!

Former Member
0 Kudos

Thomas,

I am trying to pass values from Adobe Interactive Form to ztable.

I have created the form context node with attributes that are bound to the form fields using the Adobe Livecycle Designer. The node has more than 100 attributes that are bound to the form fields.

Once the user presses the Submit button, the data is passed to the ztable. In the onSubmit function assigned to the Submit button, I am using the "Read Context" feature of WD Code Wizard to read the values of the attributes.

I am able to read the values of the first 3 attributes of the node which is bound as datasource to the adobe interactive form. I am not able to read the value of the 4th attribute using "Read Context" feature of WD Code Wizard. All the attributes in the datasource node are of string type.

I debugged the onSubmit function code and found out that the value is not being read from the 4th attribute.

Please let me know what is missing.

Thanks and Regards.

Answers (3)

Answers (3)

Former Member
0 Kudos

Resolved.

Former Member
0 Kudos

New questions on the same issue

former_member188831
Contributor
0 Kudos

As per my understanding, what ever the code you have given for get child node that your getting the zecr but why the error is coming for datasource.. for the xstring..

please get the code from wizard using Read Context and select the node, then check the syntaxand activate the whole component and try.

Regards,

Mahesh

Former Member
0 Kudos

Hi Mahesh,

I got the code from wizard using Read Context and selected the node.

The error is removed.

Here is the code in the onSubmit event handler method:

-


DATA lo_el_context TYPE REF TO if_wd_context_element.

DATA ls_context TYPE wd_this->element_context.

DATA lv_userdata LIKE ls_context-userdata.

  • get element via lead selection

lo_el_context = wd_context->get_element( ).

  • get single attribute

lo_el_context->get_attribute(

EXPORTING

name = `USERDATA`

IMPORTING

value = lv_userdata ).

-


I understand data has to be read from lv_userdata parameter using a function module. Is there any standard function module for the same and what are the steps for the process.

Any hints or help would be greatly appreciated.

Thanks and Regards.

former_member189058
Active Contributor
0 Kudos

Hi,


data: 
lo_adobe_service type ref to cl_wd_adobe_service,
lv_xml_data type xstring,
lt_data TYPE cl_wd_adobe_services=>ty_t_data.

lv_xml_data = lo_adobe_service->get_xml_data( lv_pdf_source ).
lo_adobe_service->parse_xml_data(
      EXPORTING
        with_initial_attributes = abap_true
        xml = lv_xml_data ).
lt_data = lo_adobe_service->get_data( ).

Regards,

Reema.

Former Member
0 Kudos

Hi Reema,

I am getting an error when i press the submit button.

The error is: Access via 'NULL' object reference not possible.

The ST22 dump analysis gives the following error description:

You attempted to use a 'NULL' object reference (points to 'nothing')

access a component (variable: "LO_ADOBE_SERVICE").

An object reference must point to an object (an instance of a class)

before it can be used to access components.

Either the reference was never set or it was set to 'NULL' using the

CLEAR statement.

Please let me know what is missing. I would greatly appreciate your help.

Thanks and Regards.

former_member189058
Active Contributor
0 Kudos

Instantiate it by using

CREATE OBJECT lo_adobe_service.