Rapid Application Development in CRM
We are in demanding world to have CRM in place or ready to be use as soon as possible and RAD came as a breather for custom development requirement.
RAD is available from CRM 7.0 EHP 1 and is very useful in developing an application including search facility with RDBMS in place.
I got inspired by two Demo posted by Tzanko Stefanov :
These demo content most of steps to create a RAD application and it hosted with a simple example.
Here in this blog I would focus more on RDBMS concept and in-depth analysis and maintenance or enhancement of the component.
In your business role CT-ADMIN (Administration) work center with AXT_RAPP_S (Manage Rapid Applications) should be assigned / visible.
Scenario for this example:
Let’s build an application of Employee Header, Employee Monthly Salary and Salary Wages.
Below are structures:
So here you can see there is a relation ship between three tables 1: N : N
Please create an application ZEMP through wizard (demo contain video links, please follow that) and 1) select ZEMP_HEADER at the time adding ZEMP_MSALARY, 2) select ZEMP_MSALARY when adding ZEMP_MSALARYWG.
After you finish with RAD wizard, please check status is green or not -> yellow means ‘In Progress’ status and red means error.
After it got green status, the application ZEMP is ready for testing in BSP_WD_CMPWB transaction.
What happens in background?
SAP uses AXT_CA component and component set as a Model to host any application been created following RAD process.
It also add entry for component ZEMP in ‘Working Context Repository’ and create Logical links for Create, Search and Display.
It also create four structures for each tables used in wizard with different usability:
1. Z*ATTR – Attrbiutes from table
2. Z*WORK – Runtime structure
3. Z*LOGKEY – Key fields from table
4. Z*DYN_QUER – Structure for searching records dynamically in table
It also create entries in below tables for Root, Access, Dynamic Query nodes and their fields (wherever applicable):
It creates different function modules for each table as ZFUNC* under function group ZFUGR00000 for handling of database operations like Insert, Update and Delete.
How request / event handles in component?
Classes under package AXT_RUNTIME and AXT_COMMON are used for request and event handling.
For example process flow happens for event handling in view of component:
Class CL_WCF_BSP_EVENTS_HANDLER called -> navigate proper event handling -> CL_WCF_BSP_NEW_COMMAND (New) / CL_WCF_BSP_EDIT_COMMAND (Edit) / CL_WCF_BSP_SAVE_COMMAND (Save) / CL_WCF_BSP_CANCEL_COMMAND (Cancel).
Enhancement of component:
I would suggest to use component workbench for configuring views not AET; because if AET used in one view and another component workbench sometimes it does supersede later one due to metadata selection (but it might be depend on EHP).
In execution mode component navigation is same like in transaction GENIL_BOL_BROWSER, whcih is Search -> Root node -> Access node -> Details -> Access node -> Details based on relation ship.
You can create some extra Overview page to have some different user interface or skip Details section but please do not delete anything rather hide in OVP page.
Adding an extra parameter in search criteria:
If you want to add an extra search criteria then that field should be available in Z*ATTR, Z*WORK and add that field in Z*DYN_QUER with an related entry in table AXT_RUN_QUERYMAP (please add the entry in transport request also).
Also that field should be added in search view manually to make that available in search list.
Adding an extra view with a new bol entity:
After creating a table, structures like *ATTR / *WORK (as I mentioned above) should be created keeping in mind the relation maintained already!
For example if we want to add monthly leave plan then the table would look like below:
Then proper entry should be added in require tables as I mentioned above (please use already added entry as a reference).
A new FM should be created (as per entry in AXT_RUN_TAB_DEF table) to handle database operation.
Now add an extra view with table type (if require) in component, add proper hierarchy BOL entities and change the below properties:
1. Change super class of Controller Implementation from CL_BSP_WD_VIEW_CONTROLLER -> CL_AXT_BASE_TABLE_VIEW
2. Change super class of Table node from CL_BSP_WD_CONTEXT_NODE_TV -> CL_WCF_BSP_BASE_TV_CN
Please assign the view in Runtime Repository Editor to be viewed in proper place.
Adding / deleting primary key combination of base table:
If you want to add / delete key field from base table then apart from changing the table related structures which are Z*ATTR, Z*WORK, Z*LOG_KEY, Z*DYN_QUER should be changed.
Also we need to make sure related bol entity is also effected by adding / deleting entries in table AXT_RUN_KEY_MAP (please add the entry in transport request also).
Related FM ZFUNC* under function group ZFUGR00000 should also be changed to reflect the changes in key fields.
Please finalize the database design before going for application creation through RAD wizard as it would be really complex to change the relation after it generated. Please use custom data elements in table as it would be useful for length / data type changes in modification phase.
Courtesy: To my colleague Shashi Jha for referring to interesting world of RAD.