Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to create dynamic context based on a structure defined in the program?

Hi Experts,

I need to create a dynamic context based on a structure wa_struc which i have define programatically.

When I pass wa_struc to structure_name parameter of create_nodeinfo_from_struc, i get a runtime error:

"Parameter STRUCTURE_NAME contains an invalid value wa_struc."

How to create dynamic context based on a structure defined in the program?

I have written the code like this:

TYPES: BEGIN OF t_type,

v_carrid TYPE sflight-carrid,

v_connid TYPE sflight-connid,

END OF t_type.

Data: i_struc type table of t_type,

wa_struc type t_type.

data: dyn_node type ref to if_wd_context_node.

data: rootnode_info type ref to if_wd_context_node_info.

rootnode_info = wd_context->get_node_info( ).

clear i_struc. refresh i_struc.

select carrid connid into corresponding fields of table i_struc from sflight where carrid = 'AA'.

cl_wd_dynamic_tool=>create_nodeinfo_from_struct(

parent_info = rootnode_info

node_name = 'dynflight'

structure_name = 'wa_struc'

is_multiple = abap_true ).

dyn_node = wd_context->get_child_node( name = 'dynflight' ).

dyn_node->bind_table( i_struc ).

Thanks

Gopal

Message was edited by: gopalkrishna baliga

Not what you were looking for? View more on this topic or Ask a question