on 04-01-2010 1:44 AM
Hi Experts,
I have a standard component after enhancing , added a custom view with context node BTCustomerI.
In the component controller this context node is not there, so I enhanced the component controller and created BTCustomerI context node (BOL entity is BTCustomerI).
After binding the view context node with component controller , when I execute the web UI, in the view fields what I see is BTCUSTOMERI NOT BOUND".
We debugged and the binding is not happening though I have created the binding(view context to componnet context) .
Has someone faced this issue, is there a way to resolve this?
Highly rewarded.
Regards,
Lakshmi
Hi Lakshmi,
if you have no root entity, you have to create your own one:
component ICCMP_BP_SEARCH/BuPaSearch class CL_CRMCMP_B_BUPASEARCH0_IMPL->DO_INIT_CONTEXT line 34 (SAP CRM 7.0):
lv_wrapper = typed_context->SearchCustomer->get_collection_wrapper( ). "<-- entity in BOL collection?
if lv_wrapper->IF_BOL_BO_COL~size( ) eq 0. "-> no, create one and put it into my collection
* create the query instance
CREATE OBJECT bo_col TYPE cl_crm_bol_bo_col.
query_service = cl_crm_bol_query_service=>get_instance( 'BuilHeaderSearchNew' ).
bo_col->add( query_service ).
typed_context->SearchCustomer->set_collection( bo_col ).
ENDIF.
or you want to get current customer - use this e.g. in DO_INIT_CONTEXT:
data:
lo_bp TYPE REF TO cl_crm_bol_entity,
lo_cucobupa TYPE REF TO cl_crmcmp_b_cucobupa_impl.
* get current customer
lo_cucobupa ?= me->get_custom_controller( 'GLOBAL.CRMCMP_BPIDENT/CuCoBuPa' ). "#EC_NOTEXT
CHECK lo_cucobupa IS BOUND.
lo_bp ?= lo_cucobupa->typed_context->customers->collection_wrapper->get_current( ).
if lo_bp IS BOUND.
" put current customer to my collection
typed_context->BTCustomerI->collection_wrapper->clear( ).
typed_context->BTCustomerI->collection_wrapper->add( lo_bp ).
endif.
best wishes,
Hakan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Arun & Fxhakan,
Thanks for the response.
Requirement is to display an assignment block with three fields(input fields).
I added three fields to BTAdminI using EEWB and in my standard component I used BTAdminI as the context node for the custom view I created.
and bound it to the BTAdminI of component controller by right clicking create binding method. Not directly writing code in create_btadmini(). Also no coding for collection_wrapper of my node.
This was working perfect and later on client came up with a requirement to remove those fields from BTAdminI and add in BTCustomerI.
So using EEWB I added to BTCustomerI those three fields, and created context node in my custom view with BOL entilty BTCustomerI,
also added BTCustomerI context node to component controller for binding purpose, gave dependency BTAdminI and ITem CustRel in wizard, since BTAdminI was alraedy there by standard in the component controller .
After binding the view context node with component controller , when I execute the web UI, in the view fields what I see is BTCUSTOMERI NOT BOUND".
Am I missing some steps, can somebody detail me?
Highly rewarded.
Hi,
All your steps are fine. The only problem is that the BTCustomerI entity is not created automatically for each BTAdminI entity. You have to create it on your own. For exampe, check out the GET_I method of the quantity field of the BTAdminI table view context node. Here, they check if the schedule line relation already exists and if not, they explicitly create it thus opening the field for user input. Similarly, somewhere, preferably in the GET_I methods of your Z-customer I fields, you chould check if the Item Customer extension entity exists and if not, create it when you are in edit mode.
Regards,
Arun Prakash
Hi,
The message BTCUSTOMER Entity not bound simply means that you have no data(entity) in your context node's collection wrapper. While creating this node did you specify any higher node(relationship)? If so, check the on_new_focus method of your context node. If not, how are you populating this context node?
Regards,
Arun Prakash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
3 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.