on 11-28-2009 7:59 AM
Hi All,
I am getting this following error:
Error :'Customer' in not type- compatible with formal parameter 'KUNNR'.
here both Customer and KUNNR is of type kna1-kunnr.
can any one tell me why do i get this error....
Thanks,
Susil.
Hi,
Still i am getting the same error.. Error :'lv_Customer' in not type- compatible with formal parameter 'KUNNR'.
Component1:
method EXECUTE_CUSTOMER .
data:
node_input type ref to if_wd_context_node,
node_output type ref to if_wd_context_node,
node_visible TYPE REF TO if_wd_context_node,
it_kunnr type kna1-kunnr,
itab type table of kna1.
node_input = wd_context->get_child_node( name = 'CUST_INPUT' ).
node_output = wd_context->get_child_node( name = 'CUST_OUTPUT' ).
node_input->get_attribute( EXPORTING name = 'KUNNR'
IMPORTING value = iT_KUNNR ).
SELECT * FROM KNA1 into table itab WHERE kunnr = it_kunnr.
node_output->bind_table( itab ).
endmethod.
Parameter i passed here is KUNNR of type kna1-kunnr.
In the below action i am calling that method of component1..
Component 2
ONACTIONCALL METHOD:
DATA lo_nd_cust_input TYPE REF TO if_wd_context_node.
DATA lo_el_cust_input TYPE REF TO if_wd_context_element.
DATA ls_cust_input TYPE wd_this->element_cust_input.
DATA lv_CUSTOMER LIKE ls_cust_input-KUNNR.
navigate from <CONTEXT> to <CUST_INPUT> via lead selection
lo_nd_cust_input = wd_context->get_child_node( Name = IF_REUSEVIEW=>wdctx_Cust_Input ).
get element via lead selection
lo_el_cust_input = lo_nd_cust_input->get_element( ).
get single attribute
lo_el_cust_input->get_attribute(
EXPORTING
name = `KUNNR`
IMPORTING
value = lv_customer ).
DATA: l_ref_INTERFACECONTROLLER TYPE REF TO ZIWCI_DEMO_WDA .
l_ref_INTERFACECONTROLLER = wd_This->wd_CpIfc_Reuse( ).
l_ref_INTERFACECONTROLLER->Execute_Customer(
KUNNR = lv_customer " Ref to kna1-kunnr
).
endmethod.
I have mapped the same node from the component 1 to component 2...
Can any one help me?
Thanks,
Susil.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What is the data type/DE you have given for both of the below ones...
DATA lv_CUSTOMER LIKE ls_cust_input-KUNNR. "DE for this lv_customer
Parameter i passed here is KUNNR of type kna1-kunnr. "DE for this ..
Are they referring to same DE...
I guess the probelm is here...
Have you decalred this KUNNAR as importgin parameter for execute methiod or not...
If yes, then it should be of type TYPE not TYPE REF TO...
l_ref_INTERFACECONTROLLER->Execute_Customer(
KUNNR = lv_customer " Ref to kna1-kunnr
).
Edited by: Lekha on Nov 30, 2009 4:43 PM
Hi,
This is the following code which i used pass the parameter from component to other...
method CALLMETHOD .
data:
node_input type REF TO if_wd_context_node.
node_input = wd_context->get_child_node( 'CUST_INPUT' ).
data customer type kna1-kunnr.
node_input->get_attribute( EXPORTING name = 'KUNNR'
IMPORTING value = customer ).
DATA: l_ref_INTERFACECONTROLLER TYPE REF TO ZIWCI_DEMO_WDA .
l_ref_INTERFACECONTROLLER = wd_This->wd_CpIfc_Reuse( ).
l_ref_INTERFACECONTROLLER->Execute_Customer( KUNNR = customer " Ref to kna1-kunnr
).
endmethod.
Thanks,
Susil.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Susil ,
instead of
data customer type kna1-kunnr.
do it like
DATA ls_cust_input TYPE wd_this->element_cust_input.
DATA CUSTOMER LIKE ls_cust_input-KUNNR.
where ls_cust_input is a structure which is like the node cust_input of my context
this is the code u shud try , it shud work perfect
// node cust_input and a context attribute KUNNR under it
DATA lo_nd_cust_input TYPE REF TO if_wd_context_node.
DATA lo_el_cust_input TYPE REF TO if_wd_context_element.
DATA ls_cust_input TYPE wd_this->element_cust_input.
DATA lv_CUSTOMER LIKE ls_cust_input -CUSTOMER.
* navigate from <CONTEXT> to <CUST_INPUT> via lead selection
lo_nd_cust_input = wd_context->get_child_node( name = wd_this->wdctx_kunnr).
* get element via lead selection
lo_el_cust_input= lo_nd_cust_input->get_element( ).
* get single attribute
lo_el_cust_input->get_attribute(
EXPORTING
name = `KUNNR`
IMPORTING
value = customer ).
regards,
amit
hi
lo_nd_cust_input = wd_context->get_child_node( name = wd_this->wdctx_kunnr).
actually we r doing a data declartion of type if_wd_context_node and thn we ar moving to the context node
so as to read th attributes using get_attribute method
I believe u r using the context node CUST_INPUT and reading the context attribute KUNNR under it , so do it like :
this code is automatically generated using code wizard :
1 press CONTROL + F7
2 click on the radio button Read context node/ attribute
3 press F4
4 choose the attribute under ur context node, which u want to get/set using the wizard
regards,
amit
Hi Sushil,
You can just use the code provided by Amit with a small correction.
lo_nd_cust_input = wd_context->get_child_node( name = wd_this->wdctx_kunnr).
Instead of the above line just use this line
lo_nd_cust_input = wd_context->get_child_node( name = wd_this->wdctx_cust_input).
Then your error will be gone.
Could you provide the code where you are getting this error?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
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.