Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Gauri
Active Participant
Hello Everyone,

As we are aware, Cloud application studio is being used to make technical development in C4C and Selective movement of code from dev tenant to other tenants is not feasible due to current cloud studio framework constraints i.e. entire solution has to be moved together.

However in the real world, we always come up with challenges where the Development team is working on different build items together with different prioritization,  Multiple Releases build going together with different go live timelines, Support team working on an incident code fix and get a different P1 code fix which requires immediate resolution. In such situation we currently don’t have a solution available to transport selectively a part of the code to next tenants from the development without impacting the ongoing parallel developments. In General we follow a classical Manual approach to comment on all the ongoing code, move our priority change and then uncomment the code to continue the work. Which has its own limitations.

  • Manual version check makes the version management complex

  • Multiple test iterations involved

  • Alignment between multiple stakeholders (Architects, Support teams, Project teams, Regression teams) consumes lot of time

  • Tedious and cumbersome process 

  • Risk of human error may result into application issues

  • Parallel developments of different objects are not possible


Trust now we are clear of the scenario that we want to achieve selective movement of the code without impacting the parallel developments. In the Below solution we will see how you can move the entire solution to the next tenant but then enable/disable selective code in test/production tenants based on your requirements

Prerequisite :- SAP Sales Cloud Technical Consultants and possess sound knowledge of Cloud Application Studio developments.

Solution Approach: Custom tool for controlling selective movements.

  • Complete solution will be moved as per standard SAP strategy however We will create a tool to control the selective execution of code in test/Production tenants.

  • The tool provides flexibility to enable and disable specific features as per business needs.


Steps to follow

Step 1: Build a Custom Business Object as shown below..


BO Screen Shot


BO Definition



// BO Definition in Code

import AP.Common.GDT as apCommonGDT;

businessobject Configure {

// Root node must not be specified, it is created implicitly

//

// Add elements here.

//

// To declare an element as alternative key, use the [AlternativeKey] annotation.

// Please note:

// - An alternative key of type UUID exists implicitly for each node, enabling the node

// to be used as an association target.

// - The QueryByElements query is created automatically for each node.

// - Code completion is available with CTRL + SPACE.

[Label("SolutionNumber")] [AlternativeKey] element SolutionNumber : ID ;

[Label("Release")] [AlternativeKey] element Release : IntegerValue ;

[Label("Solution Description")]element SolutionDes : LANGUAGEINDEPENDENT_EXTENDED_Text;

[Label("Activate")] element Activate:Indicator;

[DependentObject(TextCollection)] node TextCollection;

}


  • Generate screens for both desktop and mobile using the thing inspector technique. Build screens for Quick Create and also add delete feature in OWL screen to delete the entry. Delete action is added to delete an entry using event handler using BO operation and row deletion.

  • Create a Reuse library like Feature and define a function named GetFeature.absl

  • In this we will check if a particular development is to be enabled or disabled using the activate field in the configure BO. The reuse library which will have one function. This function will check the activate flag for a given feature and return true value if the feature is activated, else false if the feature is not activated.



import ABSL;
import AP.Common.GDT;

var result : collectionof DataType::LANGUAGEINDEPENDENT_EXTENDED_Text;


var query = Configure.QueryByElements;
var resultData = query.ExecuteDataOnly();
// 2. Selection
var selectionParams = query.CreateSelectionParams();
// Result
resultData = query.ExecuteDataOnly(selectionParams);

foreach( var elemConfig in resultData)
{

var SolutionNumber = elemConfig.SolutionNumber;
var SolutionDes = elemConfig.SolutionDes;
var rel = elemConfig.Release;
var sactive = elemConfig.Activate;
if ( SolutionNumber == IV_release)
{
if (sactive.ToString() == "X")
{

result = SolutionNumber;
}
}
}

return result;

 

  • When any feature is build using ABSL code then the first check has to be implemented where the entry in the feature control custom business object will be checked. If the feature is activated then the code will be executed else it will not be executed.

  • Let's see how to utilize the about Configure.BO to enable or disable the execution of the code and fix our support issues and also help other teams to continue with their developments.


/*
Add your SAP Business ByDesign scripting language implementation for:
Business Object: LeadCreation
Node: Root
Event: BeforeSave

Note:
- To access the elements of the business object node,
use path expressions, for example, this.<element name>.
- To use code completion, press CTRL+J.
- This script file is mass-enabled, i.e. the keyword "this"
refers to a collection of node instances.
- The solution uses this script when:
- the instance of the business object is being saved.
- the instance of the business object is created from other sources like web services, preview screen, and so on.
*/


import ABSL;
import AP.Common.GDT as gdt;
import AP.PDI.bo as pdi;


var relstring;


//var rel4 : DataType::pdi:ID;
//var rel5 = 2;
var checkentry;
var devkey = "Feature6";
checkentry = Feature.GetFeature(devkey);
var check;
check = checkentry;
if (check == devkey)
{
//Proceed with the logic which is relevant for support issue to be fixed
}

 

  • The above code will first check if entry is present in Configure.BO and is active or not.

  • If active then code will be executed else it won't execute.

  • Reuse library is built and kept handy. This will be referred once this development will be used in actual and called in the respective code as and when required. Reuse Library will be used in the logic building where enabling and disabling of code is needed.


Advantages and benefits

  • Custom Business Object is developed in SAP C4C which will be used to enable or disable the feature in each test or production tenant.

  • Enabling and disabling the solution based on business needs can be done.

  • Access to this custom BO will be controlled i.e. the access will be restricted to certain team members only.

  • Every code development / feature / requirement will be tagged with a unique feature item in the custom BO.

  • The new solution will be moved as an SDK solution to different tenants for the first time. Once the solution is activated in the target tenant then the solution control BO will be manually updated/maintained by designated team members.

  • No Manual involvement to comment and uncomment the code

  • Multiple objects can be developed in parallel

  • Feature wise selective movement is enabled

  • Less human error

  • Alignment with various stakeholders is decreased.

  • Less testing efforts 


Other Thoughts

  • We can use a business configuration object but I prefer a custom BO to build this tool. 

  • The BO structure and fields can vary based on the business requirements.


 

Best Regards,

Gauri Nargunde
Labels in this area