Link to Content's target Space :
A summary of creating Custom Genil Bol components for Z-tables with relationship. We have extended the blog from this SDN Blog.Arun's Blog
Company: Fujitsu Consulting India
Created on: 14 Nov 2011
Dhananjay & Kavindra are SAP CRM consultant at Fujitsu Consulting India.
Table of Contents
As Arun had explained in his blog Arun's Blog , the scenario comprehensively we are not going to discuss that. Here what we have attempted is to extend the scenario provided by him so that we use custom Genil classes , order classes , item classes, shipment and API classes. Also we have designed our component such that data is now persisted in our own tables. The sample coding for Genil class has been provided so that it is ready reference for the beginners. The Order Classes, Item classes & Sample APIs classes could be done easily and how to do it has been explained in the document.
This blog would help out beginners to understand the Genil creation from a coding point of view. Also to run the scenario you would need basic understanding how to execute the scenario using GENIL_BOL_BROWSER.
Steps to Follow
Defining the Object Table
Don’t change the name of the Objects as defined in the document. If you change the names of the objects, do change the same in the code of the classes that you would implement to fetch respective objects.
Also if you have defined Ztables, then also define your Zstructures and use your custom classes to get the data for Orders , Items , Partners & Shipments.
Defining the Model Table
Don’t change the name of the relations. If you want to change the name of the relationship , then do update the coding in your respective classes.
Defining the Component Set & Component
Customizing Settings for defining Custom GENIL Object
Use SPRO->Customer Relationship Management->Generic Interaction Layer/Object layer->Basic settings.
Define Comp Name, Class Name Object Table Name and Model Table Name
Double Click on Component Set Definition
Define Component Set for your Compo.Select Component Set and double click on Component assignment
Defining the Zstructures and Ztables
Creating your ZGenil Class , ZAPI class , Zorder class , ZItem Class , ZShipment class
Create a GENIL Class for the component. In my case I created ZCL_CRM_GENIL_SAMPLE_COMP. As already explained , the GENIL class has to be inherited from CL_CRM_GENIL_ABSTR_COMPONENT.( I did the basic things so that I can have data in my Ztable.If you need to need to implement a full blooded scenario you need to implement all the methods of the interface as they would be needed by different operations)
On the lines of these standard classes, Z classes needs to be Implemented for the following classes.
CL_CRM_GENIL_SAMPLE_COMP -> Main GenIL handler class
Above class must Implement IF_GENIL_APPL_INTLAY and IF_GENIL_APPL_MODEL or directly inherit from the class CL_CRM_GENIL_ABSTR_COMPONENT. Make sure that instead of calling the standard classes you are calling the Z classes for Order, Item, Partner and Shipment.
Update the method signatures and adjust the variables in the code, so that they point to Z structures of the respective entities for all the classes mentioned.
CL_GENIL_SAMPLE_ORDER -> Contains methods for manipulating Order object
CL_GENIL_SAMPLE_ITEM -> Contains methods for manipulating item object
CL_GENIL_SAMPLE_PARTNER -> Contains methods for manipulating partner object
CL_GENIL_SAMPLE_SHIPMENT -> Contains methods for manipulating Shipment object
CL_CRM_GENIL_SAMPLE_API -> Methods for low level API
Following changes should be made to the Z class created for CL_CRM_GENIL_SAMPLE_API .
- Adjust the class constructor so that DATA_BUILD method is not called (Comment the code where it is called).
- Adjust the types with you Z Structures as shown below.
- In the DATA_LOAD method load data from you respective DB tables to you Class IT.
- In the DATA_PERSIST Method implement logic to save data to the respective DB tables.
Please include at least three references to SDN documents or web pages.
If you are new to CRM and looking for information on custom genil objects creation with relationships , this blog will provide a detailed explanation and code snippets to get started.