SAP CRM Web UI Simple Objects
This blog is about simple objects, which is quite useful for sap crm web ui technical consultants when they have requirements to create custom bol/genil objects.
This blog shows how to create custom 1…n entities in sap crm via bol browser, which can be linked to any other crm objects by keeping the guid of that object in our simple object…There are multiple simple object genil classes provided by sap which provided the basic CRUD operations by default, we don’t have to modify these genil classes for create/read/update/delete operations.
For creating 1…n entities will use ‘CL_CRM_GENIL_GEN_TABLE_OBJ’ as the genil class for simple object… Once implemented Simple objects will be available as a root object in SO2 genil component and “ALL” component set… If you want to integrate it to your application make sure you add SO2 genil component to your component set.
For e.g. I will be using it for marketing application for which component set is “CRMD_MKTPL” not “ALL”, so I need to include SO2 genil comp. in “CRMD_MKTPL” comp. set in genil customizing available under : spro->crm->cross appl. comp-> genil->basic Settings
Let’s consider if we have to create/store multiple order information (assuming 2 field’s order_id and order_type)) in CRM for which we don’t use any existing bol/genil relation, then we are using this simple object approach…
To start with…
1. Create a table zorder_so in se11…
CLIENT type MANDT
GUID type CRMT_OBJECT_GUID
REF_GUID type CRMT_OBJECT_GUID ” To store parent/related object guid…
ORDER_Id type VBELN
ORDER_Type type char30
2. Create a lock object “EZorder_so” for your table zorder_so. (Lock mode E)
3. Define the customizing entry for simple objects in :
“spro->crm->cross appl. comp-> genil->comp. spe. Setting->define SO”
Create a SO entry in the object definition…
Object Name – ‘zorderso’
Implementation Class – ‘CL_CRM_GENIL_GEN_TABLE_OBJ’
Att. str — ‘zorder_so’ “Define attribute structure of your SO, usually it would be similar to the DB table which will store data”
Structure of mand. Field at create: zorder_so –
Key Struc. – GUID (key structure would be “GUID” only as the genil class CL_CRM_GENIL_GEN_TABLE_OBJ->Create methods supports only guid as the key field, check the coding inside create method)
4. We can define search object for our simple object as well…
Create a entry in the search object definition under simple object…
Search Object name — ‘zso_ordersearch’
Structure name – ‘zorder_so’ (Check the SO genil search query impl. which all search parameters are supported, didn’t try yet so using the same structure)
5. Optional – this part is optional…(This simple object object can be associated to other root object via association. in the customizing we can define the relationship of our simple object with the other root objects.. for e.g. check MktInteractionObject is related to MktCampaign via MktInteractionObjectCampaignRel..)
If anyone has any idea of how to integrate SO with the existing object via genil relation, pls provide your valuable comments
6. Create a mapping entry for our “Simple object – ‘zorderso’, table name – ‘zorder_so’ and lock object – ‘EZorder_so'” in the table “CRMC_TBLOBJ_MAP”
(this entry is being read by the framework in the class_constructor of our sample genil “CL_CRM_GENIL_GEN_TABLE_OBJ”)–
Use view CRMV_TBLOBJ_MAP to maintain entry…
Save the entries..Now let’s test this in bol browser :
execute genil_bol_browser (give “All” or any other component set which has SO2 genil component)
1. Create new root object… select ‘zorderso’…
Provide Order_id, Order_type and Ref Guid- (For Testing give any object’s guid to which we want to link this simple object entity) save entry..
2. Check the entry in “zorder_so” table..
3. Now test the Search Simple object.. Reset bol .. Click new search select ‘zso_ordersearch’
Try searching by any of the search structure attribute field. See the results…
Hope this will help to SAP CRM technical developers for quickly creating custom 1…n bol entities…I will post another blog to show how to build custom view based on this sample object.