on 11-19-2010 3:56 AM
I want to display an alv report for which the structure is binded with the node.
Now i have a requirement where i have to add some fields to that node dynamically in different scenarios. Please let me know how to about it.
Thanks in advance.
Along the same lines as Chris said, you can have a look at demo WD component DEMODYNAMIC present in package SWDP_DEMO. In this component assistance class you will find the code for dynamic adding attributes to a node.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
First check if you can get away with just hiding/making visible some fields. This is much easier to do and also easier to understand when it comes to supporting your development.
Otherwise, I believe you will have dynamically create the entire node - using the IF_WD_CONTEXT_NODE_INFO method ADD_ATTRIBUTE results in dynamic attributes, which I think the ALV does not process.
Thomas Jung has once (at least) discussed how to do this:
You need to generate an RTTI Structure type using the cl_abap_structdescr=>create. You have to build up the internal table parameter p_components (type CL_ABAP_STRUCTDESCR=>COMPONENT_TABLE) for the individual components of the structure.
So far none of this is really WDA specific. Just normal RTTS stuff to build a dynamic data object.
You cna then use the node info method ADD_NEW_CHILD_NODE. Use the static_element_rtti parameter to pass in the dynamic structure definition you just created.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.