on 01-08-2009 8:10 AM
hi friends..
I am new to web dynpro. In WDA i facing one issue..
while activate this code:
METHOD input_validation .
DATA :
node_main TYPE REF TO if_wd_context_node,
elem_main TYPE REF TO if_wd_context_element,
stru_main TYPE REF TO if_input_view=>element_node_vbak ,
i_vbeln LIKE stru_main-vbeln.
node_main = wd_context->get_child_node( name = 'NODE_VBAK').
elem_main = node_main->get_element( ).
elem_main->get_attribute(
EXPORTING
name = 'VBELN'
IMPORTING
value = i_vbeln ).
ENDMETHOD.
I am having 2 context node NODE_VBAK and NODE_VBAP
I am getting tis ERROR..
Web Dynpro Comp. / Intf. YSMTEST_ALV1,Web Dynpro View MAIN
Method INPUT_VALIDATION
The type "IF_INPUT_VIEW=>ELEMENT_NODE_VBAK" is unknown.
regards
selva
Hi Selva,
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
Regards,
Uday
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks uday..
your points help me lot and also i facing one more probs...
i have 2 node node_vbak and node_vbap.
in node_vbak i have only one field vbeln and
in node_vbap i have 6 fields.
but in my output it shows all the fields in vbap structure (here i need only the fields i declared in node_vbap)
Regards
Selva
Hi Selva,
I guess that you would have mentioned VBAP in the "Dictionary structure" property & selected the desired attributes one-by-one. Now when you finish with selecting your attributes clear the "Dictionary structure" property. If you leave it as it is with VBAP the system would show all the VBAP fields in the output.
Regards,
Uday
Hi Selva,
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.
Hi Selva,
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>.
I guess that you were trying to declare a structure similar to your context when you said like below:
data stru_main TYPE REF TO if_input_view=>element_node_vbak.
It does however contain a few mistakes as a result of which you get that syntax error message. 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.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.