
In this example we have only one relation ship and all the result and search structure belongs to the root node.
Now let us create the implementation class for this BOL.
Create a new class Z_TEST_BOL_WEBIC using the class CL_CRM_GENIL_ABSTR_COMPONENT2 as super class. This is very important. If you didn’t inherit that super class they BOL object don’t understand your z class module. See the following screen shot for the bol implementation class module creation.
Now you need to redifine the methods from the super class. Because we are planning this bol object for search let us redefine all the methods that are associated for search.See the following screen shot.
Now you need to change the code in all the above method to fit your bol objects. First let us put our bol tables in this Get_Objects and Get_Model. See the following code cut and paste in the right methods.
METHOD if_genil_appl_model~get_model.
* select the model from your z table
SELECT * FROM ztest_model
INTO CORRESPONDING FIELDS
OF TABLE rt_relation_det.
ENDMETHOD
METHOD if_genil_appl_intlay~get_objects.
DATA: lr_object TYPE REF TO if_genil_container_object,
lr_msg_cont TYPE REF TO cl_crm_genil_global_mess_cont,
lv_name_obj TYPE ztest_test_tbl-name,
lr_attr_props TYPE REF TO if_genil_obj_attr_properties,
l_result TYPE zes_test_tbl,
lv_name TYPE crmt_ext_obj_name.
* all entries in the root list have the same type/name -> take first
lr_object = iv_root_list->get_first( ).
lr_msg_cont ?= iv_root_list->get_global_message_container( ).
WHILE lr_object IS BOUND.
* make sure we got an entry.
* Note: the object from the root list must be either a root or access object.
* Dependent objects will never be part of the root list.
lv_name = lr_object->get_name( ).
IF lr_object->check_attr_requested( ) = abap_true.
CALL METHOD lr_object->get_key
IMPORTING
es_key = lv_name_obj.
SELECT SINGLE * FROM ztest_test_tbl
INTO CORRESPONDING FIELDS OF
l_result WHERE name = lv_name_obj.
lr_object->set_attributes( l_result ).
lr_attr_props = lr_object->get_attr_props_obj( ).
lr_attr_props->set_all_properties( if_genil_obj_attr_properties=>read_only ).
ENDIF.
lr_object = iv_root_list->get_next( ).
ENDWHILE.
ENDMETHOD.
METHOD if_genil_appl_intlay~get_dynamic_query_result.
DATA: lr_object TYPE REF TO if_genil_cont_root_object,
lt_result TYPE TABLE OF zes_test_tbl,
l_result TYPE zes_test_tbl.
SELECT * FROM ztest_test_tbl INTO TABLE lt_result.
LOOP AT lt_result INTO l_result.
lr_object = iv_root_list->add_object( iv_object_name = ‘TestRoot’
is_object_key = l_result-name ).
lr_object->set_query_root( abap_true ).
ENDLOOP.
ENDMETHOD.
METHOD if_genil_appl_model~get_object_props.
SELECT * FROM ztest_object
INTO CORRESPONDING FIELDS OF TABLE
rt_obj_props.
ENDMETHOD.
Now compile the code and let us go the the BOL browser and execute this object and see if this is working.
Go to the Transaction GENIL_BOL_BROWSER.
Now give the bol component name. Ours is ZTBOL. See the following screen shots.



That is a very good example.
Thank you very much.
Comment by Musti — July 15, 2009 @ 8:39 am
Its very good example to create Custom BOL for Web-IC
Thank you very much
Comment by Chakri — August 30, 2009 @ 4:15 pm
Really a very good example , can you quote some e.g. some scenario where you had to create a BOL model
Comment by Sujoy — September 7, 2009 @ 8:39 am
Nice one which helps a lot to create new Custom Component..
Comment by RAFI — December 29, 2009 @ 3:41 am
Hi Kumar,
The article is great. Great worka dn effort I really appriciate it.
I am wondering that how a transaction can be done. I need to create a BOL for a transaction (from ERP) in CRM. Can you please provide me soem idea that how it should be done. SHould a BOL be created for transaction or ….?
Any kind of help would be great. I need to start the work ASAP and your help/feed back would a be great help.
thanks
Comment by hansen — January 21, 2010 @ 2:16 pm
Very Useful Blog.
Comment by Krish — March 4, 2010 @ 2:01 pm
Excellent blog/tutorial…. I understood every bit of it.. It is very clearly explained…
Thank you for this.
Comment by Nirmit — April 3, 2010 @ 5:57 pm
Hi,
Thnks for the wonderfully demo ..
However I am getting a short dump in the bol_browser .. when I double click on the value ???
Thanks,
Raghu
Comment by Raghu — April 24, 2010 @ 1:13 am
Great!
Comment by CDplayer — April 27, 2010 @ 12:40 am