Quantcast
Channel: SCN : All Content - SAP Cloud Applications Studio
Viewing all 1101 articles
Browse latest View live

Change the layout of a standard screen

$
0
0

Hi everyone,

 

I have a requirement to reposition the elements under the Overview tab of standard Appointment TI screen.

Untitled.png

Basically, in the above screen I need to move the Notes section at the top. Is this possible via cloud studio or via adaptation ? Please suggest.

 

Regards

Shruti Sharma


SAP Cloud SDK : Create OData Service For Custom Business Object

$
0
0

Hi Experts,

 

I have developed custom business object using SAP Cloud Application Studio.

I want to know can we create OData service for the custom business object?

If yes what is the steps require to do that?

If No what is the alternative way to do that?

 

I want to connect Cloud Custom solution with HTML5 / SAPUI5 apps. so please suggest me what is the best way to connect both.

 

Many Thanks,

Mithun

Unable to find cloud studio

$
0
0

I'm unable to find the latest version of the sap cloud applications studio.

I used to be able to download it via support.sap.com/software/search.html and then search for "cloud studio" or something similar but the search results are coming up empty when I try to search for it.

I have tried with different S-users but still no luck.

Have they moved the installer or could there be some other reason?

Filter field Sales Phase on Opportunity shows all values

$
0
0

Hi,


We do not have control over the values for the search Sales Phase filter on Opportunity. Unfortunately this is influenced by the business configuration since the system does not allow me to remove unwanted values once they are gone live. We can remove these values in Cloud Test but not from our Cloud Prod environment.


1. BC - Sales Cycle and Sales phase, we just maintain values and also assign Sales Phases to each Sales Cycle.

2. In Opportunity Thing Inspector screen or Quick Create screens, I can see that if Sales Cycle is kept blank, there is no value on Sales Phase. Meaning it works exactly similar to BC relation between 2 fields.

3. In Opportunity Filter screen fields are not working according to BC relation and they are independent of each other.

4. In Cloud Test, when I removed Sales Phase value with Key 006 and Desc 'Close', I can see this value now not appearing on filter screen Sales Phase field. Same cannot be done in Cloud Prod.

 

Please advice if something can be done for Sales Phase via SDK i.e. to hide values in grey highlighted area and just show valid values marked by an arrow OR is there any possibility to make Sales Phase field dependent on Sales Cycle field on Opportunity filter screen i.e. something similar to Opportunity Thing Inspector Screen.

unnamed.png


Alim

Where I can get the SDK Complete document of version 1411.

$
0
0

Hi All,

 

I have tried of downloading the complete print version of the SDK document from the following link. Unfortunately only half document (until page 638) is getting downloaded and the file is not getting saved when tried to save it as PDF. It is saving but not opening when tried to open. Please help me out in having this document. Previous version documents are downloaded successfully from here itself.

 

 

SAP Cloud Applications Studio – SAP Help Portal Page

 

 

Regards

Hanu

Filter Dropdown of Sales Phase based on Sales Cycle.

$
0
0

Dear all,

 

I have created a quick create for opportunity ( need to create custom due to some reason of extensibility explorer limitations)

I have added two fields 1. Sales Cycle and Sales Phase.

 

Sales Phase dropdown should be prepopulated as per fine tuning. Currrently it is showing all the values.

 

Please help!

 

Regards,

Dhruvin

Mapping External Transaction Codes with Payment Methods for Custom Bank Statement Format

$
0
0

Hello,

 

I have created a custom bank statement format through PDI. It has few external transaction codes which relates to different Payment Methods on ByDesign. I followed the localization document and created the format and enhancement implementation.

 

I am passing the external transaction codes in the following field in the Enhancement Implementation :

 

bankStatementItem.PaymentTransactionTypeCode.content = "01";

 

I have done the mapping for the external transaction codes and Payment Methods through business configuration --> Fine Tune Activity --> Automatically Generated Bank Statements. The code 01 is mapped with Payment Processing - Of Outgoing External Payment.

 

But whenever I upload the bank statement with the code 01 the payment method doesn't get changed accordingly. I also tried adding the following code:

 

bankStatementItem.PaymentTransactionTypeCode.listID = "Format ID";

 

In the document it is advised to do the mapping through PDI but the field Payment Method is not there in the BC Set.

 

How can I make it work?

Please help me with your suggestions.

 

Thanks & Regards,

Meghna

Cloud Studio SDK: Can we create embedded reports

$
0
0

Hi All

 

Hopefully someone can just let me know if this is possible or not. If not possible then hopefully this requirement will be noticed for a future release.

 

 

Requirement:

We need the ability to embed our custom data source report into the Account TI screen and pass account number to the report so we can display customer sales data.

 

Background Info:

I have created a report we wish to embed in the Accounts TI screen. Report was defined as follows.

EmbedReport1.png

I have extended the COD_Account_TI and created an embedded component called Report_EC in the charts tab.

EmbedReport2.png

I have used extensibility explorer and passed AccountID to my Report_EC as follows:

EmbedReport3.png

OK now that my component is successfully embedded, I need to attempt to call the Analytics components.


ATTEMPT #1 - Using ANA_ICP.EC

1. I have embedded the ANA_ICP.EC component inside the Report_EC:

EmbedReport4.png

2. I entered all the report details as follows:

EmbedReport5.png

Result 1: Report starts loading but never opens as below... (Loading Forever)

EmbedReport6.png

I then removed the references to Variant and View ID.

EmbedReport7.png

Result 2: Report loads with default variant, however I can't pass an account number to the report?

EmbedReport8.png

 

ATTEMPT #2 - Using ANA_ICP_Embedded.EC

 

  1. I have created an ANA_ICP_Embedded.EC component inside the Report_EC:
    EmbedReport9.png
  2. I created an outport on my Report_EC and configured as follows:

EmbedReport10.png

 

3. Data Model structure was added 'StructureForNavToSalesCycleReport'.

EmbedReport11.png

When I check the standard ACCOUNT_TI page, the following values are defined for the sales cycle report navigation:

EmbedReport12a.pngEmbedReport12b.png

 

EmbedReport13a.pngEmbedReport13b.png

4. I tried to replace __ROOT with Report_ID below and __TARGET with Report View ID below.

EmbedReport14.png

EmbedReport15.png

EmbedReport16.png

5. I clicked on the bind button in designer view from Report_EC and created a navigation link as follows:

EmbedReport17.png

EmbedReport18.png

6. I configured my Inport AccountID and bound to my data structure 'StructureForNavToSalesCycleReport' field (AccountID_ANA). Now I don't really expect this to work but I just followed the standard SAP configuration.

Note that I configured "Onfire" to eventhandler EV_ToSalesReport

EmbedReport19.png

7. EV_ToSalesReport has the following configuration:

EmbedReport20.png

EmbedReport21.png

Result: Report will not open

EmbedReport22.png

Question:

Is there any way I can achieve the requirement using the SDK tools available. None of this is documented and I am just trying to mimic the standard solution. What should be passed to __ROOT and __TARGET for this to work with a custom report/data source?

 

I changed the __ROOT and __TARGET (In data model) to the standard sales cycle report values and the embed works... as below:

EmbedReport23.png

 

This makes me think that everything I have done is correct except the data values passed.. however something happens behind the scenes I think.. maybe a SAP employee can help how I might pass to custom?


Display Analytic in the embedded component

$
0
0

Hi,

 

I have a requirement to embed a few important KPI of the customer, in dashboard/graph format, to the overview tab of the Customer.

The dashboards would display data some custom data source.

I would appreciate if someone can give some hints.

 

Thanks.

 

 

cheers,

- julius

Using QueryByTypeCodeAndPropertyIDAndPropertyValue in SalesPriceList BO

$
0
0

Hello All,

 

I have a requirement to fetch the Customer Group Specific Price List from the SalesPriceLsit BO but there is no query in the BO which gives you all data.

I am using QueryByTypeCodeAndPropertyIDAndPropertyValue query which needs to be written in a proper way which I got to know from Query Service documentation.

Even after structuring the query as required I am not able to get data. Whenever the query is executed I get an error saying "(PRC_SALES_PRICE_LIST, ROOT) A technical error (Mandatory initialization missing) occurred: PRC_ESF_CND_MAINT 502. Report an incident."

 

Following is the code that I have written:

 

QuerySalesPriceList1.pngQuerySalesPriceList2.png

By any chance if anyone have worked on it and can help me?

 

Thanks & Regards,

Meghna

How to implement SSO in C4C in URL/HTML Mashup.

$
0
0

Hi ,

 

 

 

I am able to create a mashup (URL/HTML) using static url by passing user credential in url as below. And it is working fine by getting in.

 

 

 

 

 

http://xxxx.corp.xxxxxx.com:8000/sap/bc/bsp/sap/crm_ui_start/default.htm?sap-user=xxxxx&sap-client=200&sap-password=xxxxxx&saprole=SERVICEPRO&crm-object-type=CRM_SRQM_INCIDENT&crm-object-action=A

 

 

 

 

 

 

 

 

 

Now I would like to create URL/HTML Mashup by using SSO(single sign on) to get in third party application automatically, which is included using mashups.

 

 

 

Could you please help on this how to implement Single sign on in SAP C4C application..

 

Thanks,

Niranjan.

Embed multiple embedded components in the single tab

$
0
0

Hi,

 

I've created a single BO extension for customer and created an embedded component for it.

At the same time, i also have several custom BO that linked to customers and had created embedded components for each of the custom BO.

Now, I wanted to included all these embedded component in a single tab for customer and can create or view it in that single tab, just like customer->activities.

So far, i'm able to embed only 1 embedded component to the Account (COD_ACCOUNT_T1).

Any idea?

 

 

Thanks.

 

 

cheers,

julius

Need help in user interface designer

$
0
0

Hi Experts,

 

Hope all are doing Good..

 

I am in search of practical documentation related to user interface designer. I have gone through the 1505/1508 documentation but i dint find much practical information regarding Data model, Controller, properties explorer. This tabs has different attributes where can i find the information related to this tabs. Please find the below images for clear info.

1.png

 

2.png

3.png

 

Please help me. I would be glad for your help.

Thanks,

Quddus.

C4C Application Enhancements: Building a Change Log for Business Partners

$
0
0

Note of the 31st July 2015:

 

the following solution has been thought and realized for the Release 1411 and carried on until Release 1505.

 

SAP Cloud for Customer Release 1508 delivered a Standard Solution for the Business Partner Change Log, available by simply enabling the CHANGES tab in your user/role layout and playing with it, as shown in the picture below:

 

changes tab.png

 

From a personal point of view, the article content has been anyway an interesting and challenging achievement that let us figure out anyway how to deliver a complex enhancement on the standard C4C solution. Consequently, the lessons learnt have been helpful for few of other Client's requirements we are achieving by enhancements.

 

Thank you all for having appreciated the content of the article during the last months.

 

All the best wishes,

Davide

 


SAP Cloud for Customer is the new Customer-Centric Enterprise Cloud solution designed and released by SAP for the Customer Engagement and Relationship Management. This new solution enables you to align the business organizations and units around the Customer, with Marketing, Sales and Customer Service functionalities at the front line to the Customer.

 

In the new SDK Framework provided with SAP C4C (called SAP Cloud Application Studio) the main advantage is the model of Designing and Programming based on Business Objects. Every business entity, such as Master Data entities, can be seen as an instance of a specific class: the Business Object, with inside all the contained data and fields seen as a member properties, and with all the actions seen as class methods. The picture below shows the architecture of the BusinessPartnerBusiness Object:

 

image001.png

 

As you can see, all the properties defined in the BusinessPartner BO definition map the fields and the tables which are present in the Customer Account WorkCenter View, where Users can check and change any information on their managed Customers and Prospects, as shown in the picture below:

image004.png

The advantage of this programming model is that the designer is not just free to use the given actions programmatically in the code, but even to define and extend the BO with new fields, new referenced child BO and new actions.


In this article we focus on an Implementation and Realization of an Extension on the Account functionality. Consider for instance the case that a User in the Company’s Sales Department needs to keep track of the full maintenance and management of the information stored for the Customers in his portfolio. Sometimes, in our past CRM Project experiences, our User asked if was possible to track the changes done in the system for some relevant information such as the Company name, the address and the contact phone. In a way to track the changed field, the value, the time of the change and even the User who did the change on the system.

 

Using the SAP CRM system, this result would have been achieved by enabling the Change History Assignment Block on the Account UI Page for the required User(s). Nevertheless, in SAP Cloud for Customer Rel. 1411 a functionality similar to the Change Log is still missing in the Account WorkCenter, and in order to achieve a similar User requirement we should define a custom enhancement that keeps tracks of the changes on relevant Account information.

 

In order to define our scope and purposes, we can summarize the desired requirements in the following numbered list:

 

RQ01.    Supervisors MUST have the ability to flag a BP record as "Monitored Customer" and add a "Review Date” and then capture changes in the change log if the flag is set;

 

RQ02.    The fields created in RQ01 need to only be available to a user of a specific business role (Supervisor);

 

RQ03.    The tracked changes must be displayed in a Change log, strictly available just for a few set of roles.

 

The following sections will explain the solution developed in order to achieve that result.

 

 

Solution

The solution has been realized using the SAP Cloud Application Studio. The core of the solution is based on an enhancement on the BusinessPartner Business Object, made by adding a custom behaviour on the BeforeSave Event. In details, the list of the enhancements on the core logic is the following:

 

·        Define a new Business Object, which will collect all the changes done on each relevant field (such as the Name, the Address, the Phone and the Email) with the old value, the new value, the user who did the change and the time it has been done;

 

·        Enhance the BusinessPartner Business Object by adding a new checkbox field (called “Monitored Customer”);

 

·        Enhance the BusinessPartner Business Object by adding a new BeforeSave Event Handler with the following logic: if the Monitored Customer flag has been checked, then create a new entry for the Change Log;

 

·        Create a new UI screen that will collect all the Change Log entries, making them available for part of the Business Roles defined in the Cloud for Customer implementation.

 

The sections below will illustrate each of the components in details.

 

Business Object definition

The data modelling which will provide the Change Log functionality could be easily designed and built by defining a new Business Object (AccountChangeLogEntry), which will represent one of the log entries. The BO code is shown below:

 

import AP.Common.GDT as apCommonGDT;

import AP.FO.BusinessPartner.Global;

importAP.PC.IdentityManagement.Global;

 

[DeploymentUnit(Foundation)] businessobject AccountChangeLogEntry {

 

      [Label ("Change Log Entry ID")]  element ChangeLogEntryID:ID;

      [Label ("Change Type")]          element ChangeType:ChangeTypeCode;

 

      [Label ("Field Name")]            element FieldName:LANGUAGEINDEPENDENT_MEDIUM_Name;

      [Label ("Old Value")]            element OldValue:LANGUAGEINDEPENDENT_EXTENDED_Text;

      [Label ("New Value")]            element NewValue:LANGUAGEINDEPENDENT_EXTENDED_Text;

 

      [Label ("Changed At")]            element ChangedAt:Time;

      [Label ("Changed On")]            element ChangedOn:Date;

      [Label ("Timestamp")]            elementChangedAtTimestamp:GLOBAL_DateTime;

      [Label ("Active")]                elementActive:Indicator;

 

      [Label ("Account ID")]            element AccountID:BusinessPartnerID;

      associationRefBusinessPartner   to BusinessPartner;

 

      [Label ("Identity UUID")]         element IdentityUUID:UUID;

      associationRefUser               to Identity;

     

}

 

Important: if you want that the created Business Object will interact with the Business Partner BO, it is required that they both share the same Deployment Unit. Otherwise the BO content will be read-only for the Business Partner, and no new entries could be created!

 

Furthermore, in order to use the BO and look up the BO data in another block of code, it is necessary to define a custom Query on the AccountChangeLogEntry BO. The Query could be created by using the Create Query functionality in the BO Contextual Menu:

 

image006.png

And will be defined by the following parameterization:

image007.png

 

 

Business Partner BO extensions

The code for the BusinessPartner BO Extensions is displayed below:

 

import AP.Common.GDT;

import AP.FO.BusinessPartner.Global;

 

[Extension] businessobjectAP.FO.BusinessPartner.Global:BusinessPartner {

           

            node Common {

                    [Label ("Name Validation Flag")] element flgNameValidation:Indicator;

 

                    [Label ("Monitored Customer")] element flgMonitoredCustomer:Indicator;

                    [Label ("Review Date")] elementreviewDate:Date;         

              }

}

 

In order to change the value for these fields, they has been put on the Header pane in the UI component COD_Account_TI, as shown below:

image009.png

 

The effect on the account screen is shown in the picture below:

 

image012.png

 

 

 

BeforeSave Event Handler Logic

The BeforeSave logic has been developed in a way that the initial value of a field is tracked with a new AccountChangeLogEntry BO, if the flag "Monitored Customer" has been enabled. Then, every time the BeforeSave Event Handler is called, the current value is compared with the latest value in the AccountLChangeLogEntry BOs list. If it is different, a new value is stored.

 

Important: if you are interested to track the value for the fields belonging to the BusinessPartner Common node, then you should put the following logic in the Common node Event-BeforeSave.absl script. Otherwise the code won’t ever be triggered!

 

The full implementation code (with comments for all the steps done) has been displayed below:

 

importABSL;

importAP.Common.GDT;

 

// we start setting up all the required variables:

varbp = this.ToRoot.InternalID;

varoldLogEntry:BusinessObject::AccountChangeLogEntry;

varlogEntry:BusinessObject::AccountChangeLogEntry;

varoldValue:LANGUAGEINDEPENDENT_EXTENDED_Text;

varnewValue:LANGUAGEINDEPENDENT_EXTENDED_Text;

vartypeCode:ChangeTypeCode;

varfieldName= "";

 

// The logic has been restricted for those Accounts who have the flag "Monitored Customer" enabled:

if (this.flgMonitoredCustomer == true) {

 

// we extract the list of field to monitor from the BCO MONITORED_FIELDS:

varfieldList= MONITORED_FIELDS.QueryByElements.Execute();

varcount = MONITORED_FIELDS.QueryByElements.Count();

 

foreach (varfieldinfieldList) {

fieldName = field.FIELD_NAME;

 

// For each of them, the new value should be found in a particular position in the Business Object structure:

switch (fieldName) {

      case (FieldListCode.CO_ORG_NAME) {

              newValue= this.Organisation.Name.FirstLineName+ " " + this.Organisation.Name.SecondLineName;

              typeCode= ChangeTypeCode.CO_NAME;

      }

      case (FieldListCode.CO_GIVEN_NAME) {

              newValue= this.Person.Name.GivenName;

              typeCode= ChangeTypeCode.CO_NAME;

      }

      case (FieldListCode.CO_FAMILY_NAME) {

              newValue= this.Person.Name.FamilyName;

              typeCode= ChangeTypeCode.CO_NAME;

      }

}

 

// at first we query the existing ChangeLog entries for that BP and field:

varquery = AccountChangeLogEntry.QueryLastEntry.QueryByElements;

varresultData= query.ExecuteDataOnly();

varselectionParams= query.CreateSelectionParams();

 

selectionParams.Add(query.RefBusinessPartner_InternalID, "I", "EQ", bp);

selectionParams.Add(query.FieldName, "I", "EQ", fieldName);

 

resultData = query.ExecuteDataOnly(selectionParams);

 

// The processing of which line add to the table will depend on which are the existing results:

if (resultData.Count() == 0) {

 

      // In this case, this is the first monitored entry for the BP/Field.

      // The old value has been thus set to empty:

      if (!newValue.IsInitial()) {

              logEntry= AccountChangeLogEntry.Create(

                    ChangeLogReuseLibrary.CreateNewEntry(typeCode, fieldName, "", newValue, bp, true));

              logEntry.RefBusinessPartner = this.ToRoot;

      }

} else {

 

      //In this case, we get the old value by the most recent entry in the table:

      resultData.OrderByDescending(n=>n.ChangedAtTimestamp);

      oldValue= resultData.GetLast().NewValue;

     

      if (oldValue != newValue) {

      //just in case that the extracted vaue is different than the current value, then add a new line:

            logEntry = AccountChangeLogEntry.Create(

                    ChangeLogReuseLibrary.CreateNewEntry(typeCode, fieldName, oldValue,  newValue, bp, true));

              logEntry.RefBusinessPartner = this.ToRoot;

      }

}

}

 

}

 

After encapsulating the core logic in an external Reuse Library (see the section below) the Event Handler logic has been converted in a simpler implementation, which is displayed below:

 

·        For the Common node BeforeSave Event Handler:

 

importABSL;

ChangeLogReuseLibrary.ChangeLogController(this.ToRoot.InternalID, ChangeTypeCode.CO_NAME);

 

·        For the AddressInformation node BeforeSave Event Handler:

 

importABSL;

ChangeLogReuseLibrary.ChangeLogController(this.ToRoot.InternalID, ChangeTypeCode.CO_ADDRESS);

 

·        For the Identification node BeforeSave Event Handler:

 

importABSL;

ChangeLogReuseLibrary.ChangeLogController(this.ToRoot.InternalID, ChangeTypeCode.CO_ID);

 

ChangeLog Reuse Library

Some common procedures:

·        The creation of a new Change Log Entry;

·        The generation of a new number (given a number range);

·        The core logic of looking-up the old field value, comparing with the new value and adding a new Entry in the Change Log

have been encapsulated in a Reuse Library called ChangeLogReuseLibrary. The listings below will show you the code implemented for each of them.

 

Create New Entry Function

image014.png

importABSL;

importAP.FO.BusinessPartner.Global;

 

varresult: elementsofAccountChangeLogEntry;

 

result.ChangedAt= Context.GetCurrentSystemTime();

result.ChangedOn= Context.GetCurrentSystemDate();

result.ChangedAtTimestamp= Context.GetCurrentGlobalDateTime();

 

result.ChangeLogEntryID= ChangeLogReuseLibrary.GetNumber(AccountChangeLogEntryNumberRan.CO_LOG_ITEM);

result.ChangeType= ChangeType;

result.FieldName= FieldName;

result.OldValue= OldValue;

result.NewValue= NewValue;

result.Active= Active;

result.AccountID= RefBusinessPartner;

 

result.IdentityUUID= Context.GetCurrentIdentityUUID();

 

returnresult;

 

 

 

 

Get a new ID Number (by Number Range)

image015.png

importABSL;

 

varresult : DataType::ID;

varnumber = NumberRange.DrawNumber(NumberRangeCode);

 

switch (NumberRangeCode) {

      case (AccountChangeLogEntryNumberRan.CO_LOG_ITEM) { number= number + 1000000000; }

      case (AccountChangeLogEntryNumberRan.CO_OTHER) { number= number + 2000000000; }

}

 

result = number.ToString();

 

varstop_the_damn_debugger_here= true;

 

returnresult;

 

Change Log Controller and Comparing tool

image016.png

importABSL;

importAP.Common.GDT;

importAP.FO.BusinessPartner.Global;

importAP.PC.IdentityManagement.Global;

 

// we start setting up all the required variables:

varbp = Parameter::BusinessPartnerID;

varbp2:BusinessPartnerID;

varem2:IdentityID;

varrefBP:BusinessObject::BusinessPartner= BusinessPartner.Retrieve(bp);

 

varoldLogEntry:BusinessObject::AccountChangeLogEntry;

varlogEntry:BusinessObject::AccountChangeLogEntry;

varoldValue:LANGUAGEINDEPENDENT_EXTENDED_Text;

varnewValue:LANGUAGEINDEPENDENT_EXTENDED_Text;

vartypeCode:ChangeTypeCode;

varfieldName= "";

 

// The logic has been restricted for those Accounts who have the flag

// "Monitored Customer" enabled:

if (refBP.Common.GetFirst().flgMonitoredCustomer == true) {

 

varavailableFieldsByTypeQuery= CHANGETYPE_FIELD_ASSOCIATION.QueryByElements;

varafbtqParams= availableFieldsByTypeQuery.CreateSelectionParams();

afbtqParams.Add(availableFieldsByTypeQuery.CHTYPE, "I", "EQ", ChangeTypeNode);

varavFieldList= availableFieldsByTypeQuery.Execute(afbtqParams);

varaCount = avFieldList.Count();

 

// we extract the list of field to monitor from the BCO MONITORED_FIELDS:

varfieldListQuery= MONITORED_FIELDS.QueryByElements;

varflParam = fieldListQuery.CreateSelectionParams();

 

if (aCount != 0) {

      foreach (varrecordinavFieldList) {

              flParam.Add(fieldListQuery.FIELD_NAME, "I", "EQ", record.FIELD);

      }

}

 

varfieldList= fieldListQuery.Execute(flParam);

varcount = fieldList.Count();

 

foreach (varfieldinfieldList) {

fieldName = field.FIELD_NAME;

 

// For each of them, the new value should be found in a particular position

// in the Business Object structure:

switch (fieldName) {

      case (FieldListCode.CO_ORG_NAME) {

              newValue      = refBP.Common.GetFirst().Organisation.Name.FirstLineName

                                  + " "

                                  + refBP.Common.GetFirst().Organisation.Name.SecondLineName;

      }

      case (FieldListCode.CO_GIVEN_NAME) {

              newValue= refBP.Common.GetFirst().Person.Name.GivenName;

      }

      case (FieldListCode.CO_FAMILY_NAME) {

              newValue= refBP.Common.GetFirst().Person.Name.FamilyName;

      }

      case (FieldListCode.CO_PHONE) {

              newValue= refBP.CurrentDefaultAddressInformation.Address.DefaultConventionalPhone.FormattedNumberDescription;

      }

}

 

// at first we query the existing ChangeLog entries for that BP and field:

varquery = AccountChangeLogEntry.QueryLastEntry.QueryByElements;

varresultData= query.ExecuteDataOnly();

varselectionParams= query.CreateSelectionParams();

 

selectionParams.Add(query.RefBusinessPartner_InternalID, "I", "EQ", bp);

selectionParams.Add(query.FieldName, "I", "EQ", fieldName);

 

resultData = query.ExecuteDataOnly(selectionParams);

 

// The processing of which line add to the table will depend on which are the existing

// results:

if (resultData.Count() == 0) {

 

      // In this case, this is the first monitored entry for the BP/Field.

      // The old value has been thus set to empty:

      if (!newValue.IsInitial()) {

              logEntry= AccountChangeLogEntry.Create(

                    ChangeLogReuseLibrary.CreateNewEntry(

                          ChangeTypeNode, fieldName, "", newValue, bp, true));

              logEntry.RefBusinessPartner= refBP;

              logEntry.RefUser= Identity.Retrieve(logEntry.IdentityUUID);

              //logEntry.RefBusinessPartner = BusinessPartner.Retrieve(bp);

              bp2= logEntry.RefBusinessPartner.InternalID;

              em2= logEntry.RefUser.ID;

 

      }

} else {

 

      //In this case, we get the old value by the most recent entry in the table:

      resultData.OrderByDescending(n=>n.ChangedAtTimestamp);

      oldValue= resultData.GetLast().NewValue;

     

      if (oldValue != newValue) {

      //just in case that the extracted vaue is different than the current value,

      //then add a new line:

              logEntry= AccountChangeLogEntry.Create(

                    ChangeLogReuseLibrary.CreateNewEntry(

                          ChangeTypeNode, fieldName, oldValue,    newValue, bp, true));

              logEntry.RefBusinessPartner= refBP;

              logEntry.RefUser= Identity.Retrieve(logEntry.IdentityUUID);

              //logEntry.RefBusinessPartner = BusinessPartner.Retrieve(bp);

              bp2= logEntry.RefBusinessPartner.InternalID;

              em2= logEntry.RefUser.ID;

      }

}

}

 

}

 

 

Address management

In the SAP C4C Data Model, the Address is a different Business Object than the Business Partner, and the AddressInformation node for the Business Partner BO stores just the association between an Address (stored in its Master Data) and the Business Partner.

 

This means that in case the user updates the association stored in the AddressInformation node (ex: by adding a new Address or removing an existing one for the Account), then the AddressInformation node BeforeSave Event will be fired. In the case instead the user updates the data within an existing Address (ex: by replacing the Phone Number) the AddressInformation node BeforeSave Event won’t be fired.

 

We then defined a better way to handle eventual changes to the Address data by implementing an extension to the AddressSnapshot BO (defined in the namespace: AP.FO.Address.Global), on the nodes with relevant information fields:

·        Telephone;

·        FormattedAddress;

·        PostalAddress;

·        Email.

 

A custom BeforeSave Event Handler implementation has been provided for each of them. In addition, a custom association between the Address UUID and the Business Partner ID has been defined in the Cloud Data Model by defining a new custom Business Object, called BusinessPartner_Address_Check. The custom BO definition is displayed here below:

 

import AP.Common.GDT as apCommonGDT;

import AP.FO.BusinessPartner.Global;

 

[DeploymentUnit(Foundation)] businessobject BusinessPartner_Address_Check {

 

              elementBusinessPartnerID:BusinessPartnerID;

              elementAddressUUID:ID;

}

 

The logic has been defined as it follows:

 

1.    As soon that the Monitored Customer flag is set, the Common node BeforeSave Event Handler stores the association between the BP and the Address UUID in a new BusinessPartner_Address_Checkentry (if no previous entry existed);

 

2.    At the time the Address data (telephone number or street, for instance) have been changed within the same address, the BeforeSave event for the AddressSnapshot BO is fired. A custom Event Handler will:

a.    Check if the Address has been monitored (by executing a query the existing BusinessPartner_Address_Check BOs);

b.    In the case it has been, read the Business Partner data, check its Monitored Customer flag, and call the ChangeLogController Change Library function.

 

The following sections will show the changes to the code in order to provide the desired implementation.

 

BusinessPartner-Common BeforeSave Event Handler

The code for the Common node BeforeSave Event Handler implementation has been then changed to the following listing:

 

importABSL;

 

// RQ01-RQ02: Call to the Core Logic: ADDRESS:

// The following logic will the address UUID against the Monitored BP,

// in a custom Business Object.

if (this.flgMonitoredCustomer == true) {

      varbpac:BusinessObject::BusinessPartner_Address_Check;

 

      varaddressUUID = this.ToRoot.AddressSnapshot.UUID;

      varbp = this.ToRoot.InternalID;

 

      // at first the code checks that the address-bp relation has been registered

      // into the BO data:

      varquery = BusinessPartner_Address_Check.QueryByElements;

      varparams = query.CreateSelectionParams();

      params.Add(query.AddressUUID, "I", "EQ", addressUUID.content.ToString());

      params.Add(query.BusinessPartnerID, "I", "EQ", bp);

 

      varresults = query.Execute(params);

      varcount = results.Count();

 

      // the new record is submitted into the cloud only if no data is already there:

      if (count == 0) {

              bpac= BusinessPartner_Address_Check.Create();

              bpac.AddressUUID = addressUUID.content.ToString();

              bpac.BusinessPartnerID = bp;

      }

 

}

 

// RQ01-RQ02: Call to the Core Logic: NAME:

ChangeLogReuseLibrary.ChangeLogController(this.ToRoot.InternalID, ChangeTypeCode.CO_NAME);

 

 

 

AddressSnapshot BeforeSave Event Handler

The following code has been implemented for the BeforeSave EventHandler for the following nodes:

·        Telephone;

·        FormattedAddress;

·        PostalAddress;

·        Email.

 

importABSL;

importAP.Common.GDT;

importAP.FO.BusinessPartner.Global;

 

varbpac:BusinessObject::BusinessPartner_Address_Check;

varaddressUUID= this.ToParent.UUID;

varbp:BusinessPartnerID;

 

// for each address, the code checks the related bp in the Adress-BP Business Object data:

varquery = BusinessPartner_Address_Check.QueryByElements;

varparams = query.CreateSelectionParams();

params.Add(query.AddressUUID, "I", "EQ", addressUUID.content.ToString());

 

varresults = query.Execute(params);

varcount = results.Count();

 

// address could potentially have been shared among contacts.

// then update the log for everyone:

foreach (varrecordinresults) {

      if (!record.BusinessPartnerID.IsInitial())

              ChangeLogReuseLibrary.ChangeLogController(

                    record.BusinessPartnerID,

                    ChangeTypeCode.CO_ADDRESS);

}

 

 

 


 

User Interface additional tools

This section will deal with some additional tools we can realize on the Cloud for Customer User Interface, in order to let it be suitable for Administrators and Customer Managers.

 

In the solution we realized the following UI tools:

·        A global ACCOUNT CHANGE LOG UI WorkCenter, that will show all the tracked changes for all the Account defined in the system (with a query to the Business Object AccountChangeLogEntry);

·        A local CHANGE LOG, that will show all the tracked changes for the single Account, and which has been attached as a new Tab to the Account/Customer WorkCenter.

 

The following sections will describe the single UI Tools.

 

Global ACCOUNT CHANGE LOG WorkCenter

For the Account Change Log WorkCenter, the following steps have been followed:

 

1.    Select Create Screens from the Business Object Contextual menu, as shown below:

 

image017.png

 

 

2.    Select the options below, specifying a Short ID:

image018.png

 

 

The environment will automatically define the following UI Screens:

 

image019.png

 

 

3.    In particular, we chose the Object Work List item (the AccountChangeLog_OWL.OWL.uicomponent screen), because it was the one that could better resemble the Log Layout, and defined the following additional functionalities inside:

 

·        Refresh button: done by Firing an Event Handler that execute again the Default Set for the Default Query, as shown below:

 

image020.png


 

·        Delete button: done by adding LayoutStackPanel item on every line, which content is a Delete button:

 

image021.png


 

The button will fire the Event Handler defined below:

 

image022.png

 

·        Thing-Type Navigation to the Account: define the InternalID field proprieties as shown below:

 

image024.png

 

 

 

And then, on the Data Model tab select the UUID field. The DataField proprieties should be set up as shown below:

 

image026.png

 

4.    After these changes, activate and save the screen. After allowing your user to the New WorkCenter Frame, you will be able to see the new ACCOUNT CHANGE LOG functionality.

 

 

 

Embed the Change Log as a Tab on Customer Workcenter

In order to show the data at the Account TI screen level (as a new tab) the following activities have been done:

 

1.    Add a new Embedded Component (EC) to the Solution, and filling it with a table made by the fields provided by the QueryByBP query:

image030.png

       

 

2.    Define a new Inport for getting the Account ID from the main application:

image032.png

 

 

3.    Define a new UI Query that runs the QueryByBP and put the result in the DataList Data Model node:

 

image033.png

 

4.    Define a new Event Handler (and put on the OnFire properties of the Inport), that copies the input parameter to the query parameter and runs the Query:

 

image034.png

 

5.    Save and Activate everything.

 

6.    Open a new extension of the UI Screen COD_Account_TI, and in the Extensibility Explorer, add the generated EC, with the binding specified below:

 

image035.png

 

image036.png

7.    Save and Activate the TI.

 

Business Roles Restrictions

In order to achieve the RQ02 Requirement, we can use the configuration of a custom Page Layout, assigning it then to few of the Business Roles available. The steps are explained below:

 

1.    From the UI5 interface, select the menu voice Adapt New Page Layout:

 

image037.png

 

2.    After creating the new Layout, deselect the option “Visible” from both the CHANGE LOG tab and the Monitored Customer field;

 

3.    Select the menu voice Adapt Assign Page Layout, and modify the options in the list as shown below:

image038.png

 

 

4.    Save and logon with the Sales Representative to check the result.

 


 

Final result

The final result has been shown in the pictures below.

 

The Change Log has been displayed as a Tab into the Account TI UI Screen, with all the tracked changes inside, sorted by hour and date of change:

 

image040.png


Furthermore, the ACCOUNT CHANGE LOG WorkCenter (containing all the tracked changes from all the monitored Accounts in the system) gave us the result below:

 

image042.png

 

About the Author

image044.jpgI am Davide De Luca, and at present time I work as a Senior Consultant at Bluefin Solutions Ltd for Manufacturing Business Process, coming from several work experience as IT Specialist and SAP CRM Consultant in Capgemini, E-Utile – an ATOS WorldGrid Company and in Accenture (Rome office).

 

I can offer a consistent experience on System Integration oriented on the Engineering of new and innovative services and solution for small/medium and big Enterprises based on SAP Product and Services. My experience in this market is such of 8 years.

 

 

In details, I have been reaching gradually the following skills:

·        Project design and deployment of enterprise resource planning services and software’s (based on SAP solutions);

·        Business Implementation, Configuration, Tuning and Technical Design of IT Solutions based on SAP Cloud for Customer (C4C) landscapes and scenarios;

·        Technical design and customizing of IT solutions based on system SAP CRM landscapes and scenarios;

·        Project design and deployment of new services and application for business purposes for SAP NetWeaver enterprise portal solutions.

 

More information about Bluefin Solutions at: http://www.bluefinsolutions.com/

 

SAP Cloud SDK : Custom OVS for Custom Business Object and Add Into Extension Fields

$
0
0

Hi Experts,

 

I have created custom business object Called ChainAccount

 

businessobject ChainAccount {

     element ChainAccount : BusinessPartnerInternalID;

     element Description : LANGUAGEINDEPENDENT_MEDIUM_Text;

     element CheckFlag : Indicator;

}

 

I have created Object Based Navigation screen and upload data through XML file Input

When I am going for creating custom OVS using right click on Custom Business object and Select OVS screen I have followed below steps :

1) Select Query

2) Select Element from Custom BO

3) And Click on OK button and added new screen under my Custom Solution (OVS screen).

 

Requirement:

1)  How to make filter in Custom OVS based on ChainAccount mean how to search ChainAccount in OVS screen.

2)  How Make this OVS as public OVS

3)  How to Add this custom OVS into standard business object extension fields.

4)  How to selected valued from custom OVS populated in extension field.

 

Please let me know how to achieve this above requirements.

 

Regards,

Mithun


Error when more than 1 BOs in the EC

$
0
0

Hi,

 

I have created a BO extension of customer and create the embedded component for it.

I've successfully display in the customer tab (under the undefined).

I've further test to include another custom BO into this same embedded component with AdvancedListPane. 

When i test it, i've encountered the following error upon the loading of the tab.

Any idea?


Thanks.

Another.png

 

 

 

cheers,

julius

Slow Performance - External Web-Service Call in BeforeSave Event of Customer

$
0
0

Dear Experts,

 

currently, we have a customer specific solution which invokes an external webservice when a customer is saved or updated (BeforeSave & AfterModify Event). The customer data is transfered to SAP Netweaver PI which then forwards the message to MS Navision.

Unfortunately, it makes the creation of a new customer via frontend very slow. Do you have  idea how to improve the performance by improving code? Or maybe other optimizations are possible.... I already created an incident in the tenant.

 

SampleCode in BeforeSave Event

 

createRequest.CustomerData.No  = this.InternalID;

createRequest.CustomerData.Customer_Status = this.Status.LifeCycleStatusCode;

 

 

//check if customer is a person or organisation

if (this.CategoryCode == "Person"){

createRequest.CustomerData.Customer_is_a_Person = true;

}else{

createRequest.CustomerData.Customer_is_a_Person = false;

}

 

if (this.AddressSnapshot.IsSet()){

//Name & Address Snapshot information

createRequest.CustomerData.Name = this.AddressSnapshot.Name.GetFirst().Name.FirstLineName;

createRequest.CustomerData.Name_2 = this.AddressSnapshot.Name.GetFirst().Name.SecondLineName;

createRequest.CustomerData.Address = this.AddressSnapshot.FormattedAddress.GetFirst().FormattedPostalAddressDescription;

}

 

// execute the web service 

createResponse = Library::CustomerDataWebServInt1.Create(createRequest, "", "CustomerDataCommSc");

 

var commFault = createResponse.CommunicationFault;

var commFaultItem = createResponse.CommunicationFault.Item;

 

var CustomerInternalID = createResponse.CustomerData.No;

raise MsgExternalResponse.Create("S", CustomerInternalID);

}

 

Thank you in advance!

 

 

Best regards,

Rufat Gadirov

Query master data into custom business object

$
0
0

Dear Expert,

 

I need to create custom business object for query Price List from account id and product code.

Just query, not create new one.

Now I've ABSL code to query already but I can't set sales price list master data to my OWL.

 

1. How to call my custom query to get standard data into my OWL?

2. How to binding data in OWL?

 

Please tell me some advice or another solution?

 

Best Regards,

Nuttha s.

A linked image to an object

$
0
0

Hi,

 

I need to upload a picture at the moment an object is being created from the QA. I'm using a "File upload" component, but i can't see the file in the OWL when I create the instances.

 

This is because i need to create objects with a linked image.

 

Regards

Create a dependent extension field(list) from activity field

$
0
0

Hi,

 

I just started to work with studio 1 month ago, so I would like to know if anybody could help me

 

I have a customer that wants an activity field with 3 options -> I already created with standard field.

 

In dependently of each activity option is choosen, I need to show a list with diferents fields.

 

Thanks in advance for your time!

Viewing all 1101 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>