cancel
Showing results for 
Search instead for 
Did you mean: 

ABAP Mapping - how to check for the node name at runtime

Former Member
0 Kudos

HI ,

I have created the target node with name EMP_No .

this field should contain the value from the source node Emp_No.

for this I have to check if the name of the current node is Emp_No.

how can I do this,.

The code is as below

-


node = iterator->get_next( ).

while not NODE is initial.

CALL METHOD NODE->GET_NAME

RECEIVING

RVAL = nodename .

CALL METHOD NODE->GET_Value

RECEIVING

RVAL = val .

if nodename EQ 'Emp_No'.

nodetext = odocument->create_text( val ) .

irc = empno->append_child( nodetext ).

endif.

-


This code is not working . Its leaving the target node as a blank node

Hope to have some solution for this

Regards

Nikhil

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

HI,

It is already explained above , as per above do it or see the below links

Abap mapping test - /people/sameer.shadab/blog/2005/09/29/testing-abap-mapping

abap mapping - /people/alessandro.guarneri/blog/2006/03/05/managing-bulky-flat-messages-with-sap-xi-tunneling-once-again--updated

/people/michal.krawczyk2/blog/2006/09/20/xi-abap-mapping-logs--more-standard-better-visibility

/people/rahul.nawale2/blog/2006/11/01/dynamically-sending-a-mail-to-the-po-creator-using-xslt-abap-mapping

Regards

Chilla

former_member189558
Contributor
0 Kudos

HI Nikhil,

You can find an element by name: When you know there is only one element then use the following:

<i><b>data: node type ref to if_ixml_node.

node = document->find_from_name( name = 'person' ).</b></i>

When you know that there are multiple then use:

<i><b>data: items type ref to if_ixml_node_collection.

items = document->get_elements_by_tag_name( name = 'item' ).</b></i>

Thanks,

HImadri