on 12-22-2009 9:00 AM
Greetings everyone,
New to WDA world and have some Qs
Required:
I need to create x number of tables (all input ready) in the run time , how many is determined by the user in the previous view, those tables have the same structure , let say like this
Activity Cost1 Cost2 Cost3
Activity1 4 444 444
Activity2 23 55 422
So each table have to have its own context , so also the context creation will be dynamically at run time , here is my problem , how can I create x number of context at run time ??
Can I achieve this by using only 1 context and bind all the table to it , some how ??
This is how I want to see my output
Cost for Org 1
Activity Cost1 Cost2 Cost3
Activity1 4 444 444
Activity2 23 55 422
Cost for Org 2
Activity Cost1 Cost2 Cost3
Activity1 4 444 444
Activity2 23 55 422
u2026u2026u2026.
u2026u2026u2026.
Cost for Org N
Activity Cost1 Cost2 Cost3
Activity1 4 444 444
Activity2 23 55 422
someof my friend mention something about recursion node, but i'm not familiar with that and thus don't know who will i be able to read the different node created for different table ??
Any ideas
Thanks in advance
Regards
hi ,
u can refer WIKI :
http://wiki.sdn.sap.com/wiki/display/stage/dynamiclayoutmanipulationinWD+ABAP
u can create nodes dynamically , u create a attribute in Attribute tab of ur view. There is a parameter VIEW in the WDDOMODIFY of ur view , u can create the attribute of that type IF_WD_VIEW
now u can take tht view reference
and can create the dynamic node in the OnAction method of ur button
In order to create a new independent context node a reference to the metadata of the context root node has to be obtained first. This reference is obtained by calling the method
wd_context->get_node_info( ).
Next, the metadata of the new node has to be defined. To create a new node, the method add_new_child_node( )
from the reference to the context root node can be used.
try to search the class with prefix cl_wd .. for ur table
regards,
amit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Mohammed ,
change the data type for the element to "MATRIX DATA" instead of the "MATRIX HEAD DATA" in the OnAction of your button UI
or wherever u r using it in ur coding .
refer this presentation for dynamic context creation , mapping and data binding
cheers:)
regards,
amit
Edited by: amit saini on Dec 23, 2009 5:20 AM
Thanks Amit,
the problem was that the container layout was set to flow layout and i was trying to add matrix data to it , i used cl_wd_flow_data=>new_flow_data instead and it worked fine , now I'm trying to add the attributes to the context , also is it possible to add n number of attributes but not binding all of them to the table ??
Regards
User | Count |
---|---|
84 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.