Skip to Content

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

image

2. Create a lock object “EZorder_so” for your table zorder_so. (Lock mode E)

image

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)

 image

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)

image

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…

 image

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..

image

2. Check the entry in “zorder_so” table..

image

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. 

To report this post you need to login first.

7 Comments

You must be Logged on to comment or reply to a post.

  1. Suchita Phulkar
    Very good blog Sumit. I Appreciate your efforts !! I find this blog very helpful and looking forward for the next blog 🙂

    Keep it up !!

    Thanks & Regards,
    Suchita

    (0) 
    1. Sumit Mittal Post author
      Hi Geetika,

      To my knowledge advance search is not supported in simple object.

      “IF_GENIL_SO_HANDLER”

      you can debug the implementation of “get_list” method of above interface which is used by the simple object classes to build the query.

      I believe for simple objects to support the advance searchs, simple object genil classes should use “IF_GENIL_APPL_INTLAY” interface, As Get_query_dynamic_result(used for adv. search) is part of the interface “IF_GENIL_APPL_INTLAY”, In this case accordingly all the other SO genil implementation methods has to be adjsuted.

      Thanks for reading the blog, let me know if you find a way to support advance searches in SO.

      Cheers,
      Sumit Mittal

      (0) 
    1. Sumukh Kapoor
      Hi Sumit,

      The test is successful as required using GENIL_BOL_BROWSER but when creating view and assigning the BOL Entity it say the BOL entity doesnot exist.

      any pointers again what exactly is the issue?

      Thanks in Advance.

      Sumukh Kapoor.

      (0) 
  2. Sumeet Gehlot

    Hi Sumit,

    I have done the same as the below steps.

    In genil_bol_browser , When I click on create new root object (ZOrder_SO) fill the parameters value and save that entry ,

    list browser is not filled.

    Secondly the name of the structure and table is same , so where is the value getting saved.

    Do I need to create a component set and add a  bol model in a component so that i can use while creating a context node.

    Guide me with the same as I am new to Webui

    Thanks,

    Sumeet

    (0) 

Leave a Reply