on 01-28-2009 6:27 AM
Hi,
Can we use the structure of the context for declaring the internal ?
-Sid
Hi Sid,
For each node <node> of a controller context, a structure type element_<node> is implicitly generated in the interface IF_<ctrl>. Similarly, for each node <node> of a controller context, a standard table of
type elements_<node> is also generated in the interface IF_<ctrl>. The line type of this table is element_<node>.
So suppose your view name is INPUT_VIEW and your context node name is NODE_VBAK then you can declare a structure as shown below:
data stru_main type if_input_view=>element_node_vbak.
Similarly you can declare an internal table as:
data lt_main type if_input_view=>elements_node_vbak.
Regards,
Uday
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thnx to all of u for your inputs.
-Sid
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sid,
You can use the above element_ & elements_ notation to define workarea & internal table similar to your context. But the disadvantage of this approach as how pointed out by Thomas in 1 of his earlier threads is that this coding would work fine only for that particular view. If you copy the same code from your view input_view and try to use it in another view say VIEW1 then it wouldn't work as the interface name would have changed from if_input_view to if_view1. So its suggested to use the below approach:
DATA: lt_main TYPE wd_this->elements_node_vbak, " Internal table
wa_main TYPE wd_this->element_node_vbak. " Work area
Try go through this excellent [article|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/60730016-dbba-2a10-8f96-9754a865b814]. It would help you understand what all you need to know about working with the context & its attributes.
Regards,
Uday
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes
IF_<View_name>=>Element_<context_node_name>.
However this is possible only with in your view or with in your component.
Abhi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.