on 07-26-2007 11:36 AM
Hello All,
In the context of a component controller I have a attribute for the Order number
My view context for the view "Operations" has no corresponding attribute mapped to the Order number of the context of the component controller.
How can I read the Attribute in the component controller. Is it possible..to get the attribute value for the Order number from the context of the component controller directly..?!?!
Warm Regards,
Smita
Yes you can. Introduce a <b>get_order_number</b> method in the component controller, inside which you will read the component controller's context and return the order number. You will access that in your view as
<b>order_no = wd_comp_controller->get_order_no( ).</b>
Also introduce a setter method so that you can do a binding when the value changes. So you can call wd_comp_controller->set_order_no( ).
However, doing a mapping to the view is the neater and easier way to do it. But if you do not want that, this will work too. Award points if it solves your issue.
Regards,
Nithya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey guys,
I found a way out..!!!..Lemme share it with you guys..!!
This is the code snippet..!!!
DATA: L_COMPONENT_CONTROLLER TYPE REF TO IG_COMPONENTCONTROLLER,
L_COMP TYPE REF TO IF_WD_COMPONENT,
L_CONTEXT TYPE REF TO IF_WD_CONTEXT,
L_NODE TYPE REF TO IF_WD_CONTEXT_NODE,
L_CHILD_NODE TYPE REF TO IF_WD_CONTEXT_NODE,
ELEM_OP TYPE REF TO IF_WD_CONTEXT_ELEMENT,
ITEM_AUFNR TYPE STRING.
L_COMPONENT_CONTROLLER = WD_THIS->GET_COMPONENTCONTROLLER_CTR( ).
L_COMP = L_COMPONENT_CONTROLLER->WD_GET_API( ).
L_CONTEXT = L_COMP->GET_CONTEXT( ).
L_NODE = L_CONTEXT->ROOT_NODE->GET_CHILD_NODE( 'ORDERDATA_COMPLETE' ).
L_CHILD_NODE = L_NODE->GET_CHILD_NODE( 'HEADER' ).
ELEM_OP = L_CHILD_NODE->GET_ELEMENT( INDEX = 1 ).
ELEM_OP->GET_ATTRIBUTE( EXPORTING NAME = 'AUFNR' IMPORTING VALUE = ITEM_AUFNR ).
Warm Regards,
Smita
hi,
in the context of the view,
drag the node with your attribute from the right side (component controller)
to the context icon on the left side (view context)
the data binding will be done automatically
grtz,
Koen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
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.