on 05-13-2008 9:48 PM
Hi,
In my Component I have to populate one or two sets of recoords in the table. In my data base table no data. I have to create intenally by using Internal table to populate two sets of records for testing other functions.
I have created the context with the std structure .
how to define the Internal table using the context node and append the data to the internal table and populate to table in the view.
If any guys are having codes pl help me to provide.
thanks in advance.
sri
When defining the node with structure of internal table in the context of the component controller, you should define it with cardinality 0..n or 1..n. This case node can have n-records. In the view in which table data must be displayed, you should map the context from the component controller to the context of the view.
Now in a method of the component controller, you can retrieve data from database table, but in your case, you can also simulate the data in a method of the component controller. If you enter the data in the method, it will automatically be part of the view data as well, due to the context mapping.
But before this is the case, you should bind the data from the internal table to the context of the component controller. You do this in the same method in which you fill the data from the internal table. The code for binding the data to the context can be generated almost fully automatically.
Do this by using the code wizard (button with a 'magic' wand) and choose READ CONTEXT. Enter the name of the context node for internal table. The code will give you a method GET_ATTRIBUTE. Change this to SET_ATTRIBUTE and also change the name and value to EXPORTING parameters.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Thanks for the reply. In my Component controller I have created a one method called fill_data.and then as per your reply I tried with creation for method the option Read Context (node/Atribute) is diabled.
how to define the internal table and append the two sets of data for display pupose. pl help me
Thanks,
sri
data:
prod_node type ref to IF_COMPONENTCONTROLLER=>Element_ZS_TTT,
itab_node like table of prod_node.
itab_node-mat_ID = '00001'.
append itab_node.
after defining internal table and put the field name and value it is giving error as internal table with occurs define .
pl help me what is the code I have to put for building the data for internal table and bind to table .
thanks in advance
sri
>
>
> Do this by using the code wizard (button with a 'magic' wand) and choose READ CONTEXT. Enter the name of the context node for internal table. The code will give you a method GET_ATTRIBUTE. Change this to SET_ATTRIBUTE and also change the name and value to EXPORTING parameters.
How/where do we do this? I'm not able to find the Code Wizard... please suggest.
Thanks.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
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.