cancel
Showing results for 
Search instead for 
Did you mean: 

Extracting data from Adobe pdf form into SAP internal table

Former Member
0 Kudos

How can I extract data from an interactive Adobe from into internal table using ABAP code. Can anybody send me some sample code and/or documentation on it?

Thanks in advance.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Dean,

If we represent your table as XML you will got something like this .

<TABLE>

<RECORD>

<FIELD1>...</FIELD1>

<FIELD2>...</FIELD2>

</RECORD>

<RECORD>

<FIELD1>...</FIELD1>

<FIELD2>...</FIELD2>

</RECORD>

...

...

...

<RECORD>

<FIELD1>...</FIELD1>

<FIELD2>...</FIELD2>

</RECORD>

</TABLE>

So you have to code this to process it .


DATA XML_NODE type ref to IF_IXML_NODE.
DATA l_ref_node_list TYPE REF TO if_ixml_node_list.
DATA l_ref_subnode_list TYPE REF TO if_ixml_node_list.
DATA l_ref_child     TYPE REF TO if_ixml_node.
DATA l_subnode_child     TYPE REF TO if_ixml_node.
DATA v_nodesindex type i.
DATA l_count type i.
DATA v_count type i .
data v_name type string.

xml_node = xml_document->find_from_name( name = 'TABLE' ).
l_ref_node_list = xml_node->get_children( ).
* L_REF_NODE_LIST will contain all subnode of the current node
WHILE v_nodesindex < l_ref_node_list->get_length( ).
      l_ref_child = l_ref_node_list->get_item( v_nodesindex ).
* You will get the node <RECORD>.
l_ref_subnode_list = xml_node->get_children( ).
* You will get number of child of the node <RECORD>.
      clear v_count.
      while v_count <  l_ref_subnode_list->get_length().
         l_subnode_child  =  l_ref_subnode_list->get_item( v_nodesindex ).
        v_name = l_subnode_xhild->get_name().
* You will got the name of the node then you have to code the process for it 
      endwhile.
ENDWHILE

Of course if you XML structure is more complex you can do the same while using recursivity . If you need i can give you a sample code for it.

Best regards.

Former Member
0 Kudos

Ur ans was helpful to me. I am getting fieldname as 'DATA'.

I want the fields to be seperately stored in a table .

ie if the value is m120.8.2009

i want m1 to be stored separately and 20.8.2009 to be stored separately.

how can i do this.Kindly help me.

munishsb
Participant
0 Kudos

Hi

Can you please provide me the exact code

Former Member
0 Kudos

Hi,

What exactly do you need ? Does the code i gave not enougth for solving your problem ?

Regards

Former Member
0 Kudos

Hi,

Sorry for the delay , do you still need help ?

If a node contains several value, when you read it just put it in a workarea define as a structure and that works .

Regards

Former Member
0 Kudos

Hi Dean,

U can get the data of interactive form into the context node of the view, to which u've binded the datasource property of the form. and then wherever you want your data, assign it through the attributes of the node in context.

Hope this helps,

Regards,

Amita.

Former Member
0 Kudos

Hi dean,

This blog takes you through the process of uploading an offline pdf, that fetches the data from pdf to abap internal.

/people/shruti.rathour/blog/2008/02/07/uploading-sap-interactive-form-on-the-abap-webdynpro-view

I guess it'll help.

Regards,

Amita

chintan_virani
Active Contributor
0 Kudos

Dean

Have a look this [article|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/c2567f2b-0b01-0010-b7b5-977cbf80665d]

Chintan