cancel
Showing results for 
Search instead for 
Did you mean: 

problem in accessing attribute of a context node

Former Member
0 Kudos

Hi All,

I have a context node called REFE and an attribute named REF to the node REFE. I am trying to get access to the attribute REF, so that i can dynamically set properties. But i am getting NULL Object error. I am successfully getting access to node REFE.

Here is the code.

lo_nd_refe = wd_context->get_child_node( name = wd_this->wdctx_refe ).

lo_el_refe = lo_nd_refe->get_element( ).

lo_el_refe->set_attribute(

EXPORTING

name = `REF`

value = 'http://sapsndbp.sbic.co.za:8011/sap/bc/webdynpro/sap/zzdm_audit_report' ).

Regards,

RAvi

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

What is the cardinality of the node.

If it is 1:1 then you can get teh reference of the context element directly.

If it 0:N or 1:N then you need to pass the index of the context element you are trying to get.

Use the method get_element of the context node and pass the index value.

Always check the element is initial or not before you process further for better coding.

Regards,

Lekha.

Answers (0)