cancel
Showing results for 
Search instead for 
Did you mean: 

ABAP Mapping doubt.

Former Member
0 Kudos

Hi guys,

I’m doing my first ABAP mapping to create a structure for a JDBC request. My request message is something like this:

<root>
  <statement>
    <tableName>
        action attribute
      <access>
        <field1>
        <field2>
      </access>
    </tableName>
  </statement>
</root>

My doubt is how can I define the attribute action with name= action and value=INSERT during the build up of output document? This method only have the “name” as input parameter, how can I fill up the value= INSERT?

Thanks in advance,

Ricardo.

Message was edited by:

Ricardo Quintino

Accepted Solutions (1)

Accepted Solutions (1)

MichalKrawczyk
Active Contributor
0 Kudos

Hi Ricardo,

1. create a yourelement in the mapping

data: yourelement type ref to if_ixml_element.

yourelement = odocument->create_simple_element(

name = 'whatever'

parent = something ).

2. then use method as shown:

yourelement->set_attribute( name = 'name' value = 'insert' ).

this will set the attribute

is this what you need?

Regards,

michal

-


<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

Former Member
0 Kudos

Yes! This is exactly what I’m looking for

Thanks a lot Michal

MichalKrawczyk
Active Contributor
0 Kudos

hi,

no problem:)

Regards,

michal

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Which library are u using to handle xml parsing and building?

If there is a option to create an attribute, there should be a function to set the value. Check your library and get the function to do it.

Regards,

P.Venkat

Former Member
0 Kudos

Hi Venkat,

The interface is IF_IXML_DOCUMENT and I checked on sap help, but no value parameter is available... My knowledge about this subject is very weak; this is my first ABAP mapping like I said on earlier post, so is possible that I’m making some mistake!

Regards,

Ricardo.

MichalKrawczyk
Active Contributor
0 Kudos

check out my code

regards,

michal