Enterprise Resource Planning Blogs by SAP
Get insights and updates about cloud ERP and RISE with SAP, SAP S/4HANA and SAP S/4HANA Cloud, and more enterprise management capabilities with SAP blog posts.
cancel
Showing results for 
Search instead for 
Did you mean: 
murthy_v
Employee
Employee
0 Kudos
Partners would need SAP Business ByDesign Cloud Studio reusable libraries for Territory Mapping functionality, which includes libraries to return parties determined in Customer Relationship Management (CRM) documents and libraries to read Organizational Management related information.

the Blog covers the following aspects:

  • Library CustomerRelationshipManagementUtilities.CRMDocumentPartyDeterminationV1 returns Parties determined in Customer Relationship Management Documents

  • the Demo Video covers the aspect of partner consuming released libraries in Cloud Studio and testing in SAP Business ByDesign.

  • for detailed demo please refer to detailed earlier blog post : Demo of Partner libraries for Parties Determined in CRM documents




Capabilities:


As part of 2302 SAP Busniess ByDesign delivered following libraries, which will enable partners to realize lot more functional scenarios like Territory Mapping, with Business User and Technical User (Integration User).

  1. Library CRMDocumentPartyDeterminationV1 enables partners to read Parties determined in CRM documents listed below:

    • Sales Order

    • Service Order

    • Service Request

    • Sales Quote / Quote for Contract

    • Contract

    • Customer Return




Benefits for Customers


Partners enabled to read determined parties

Note: This capability has been requested by partners to realize functional scenarios via partner add-on in SAP Business ByDesign cloud studio and the new version of partner API (CRMDocumentPartyDeterminationV1) works with both Business user and Technial Integration user.

 

Details of Partner Libraries:


Library to return Parties determined in Customer Relationship Management Documents


Description : Library CRMDocumentPartyDeterminationV1(AccountIDs,CRMDocumentType) Returns the parties determined by the specified account IDs for a particular document type.

  • CRMDocumentType parameter is optional and if not passed it is set to 114 ( Sales Order CRM document) by default. sample call would CRMDocumentPartyDeterminationV1(AccountIDs)

  • CRMDocumentType Sample values:

    • for Sales Order pass value 114

    • for Service Order pass value 117

    • for Service Request pass value 118

    • for Sales Quote/Quote for Contract pass value 30

    • for Contract pass value 1092

    • for Customer Return pass value 32




Note: Multiple account IDs can be passed to the API. Number of account IDs passed is subject to system performance. We suggest that you pass an optimal number of account IDs.
import AP.Common.GDT;
import AP.FO.BusinessPartner.Global;
import AP.CRM.Global;

var AccountID: PartyID;
var AccountIDs: collectionof PartyID;
var CRMDocumentType: BusinessTransactionDocumentTypeCode;
/*Multiple account IDs can be passed to the API. Number of account IDs passed is subject to system performance.
It is suggested to pass an optimal number of account IDs.*/
// Account ID or Buyer ID
AccountID.content = "MC9785";
AccountIDs.Add(AccountID);
/* CRMDocumentType Sample values: 114 Sales Order, 117 Service Order, 118 Service Request,
30 Sales Quote/Quote for Contract, 1092 Contract, 32 Customer Return*/
// For Sales Order CRM document, CRMDocumentType optional parameter is set to 114 by default.
CRMDocumentType = "114"; //Sales Order
// Input is always Account/Buyer IDs
var DeterminedParties = CustomerRelationshipManagmentUtilities.CRMDocumentPartyDeterminationV1(AccountIDs,CRMDocumentType);
if (DeterminedParties.FailedIndicator == false)
{
foreach(var DeterminedParty in DeterminedParties.CRMDocumentDeterminedParty)
{

// Given Account/Buyer ID
var ForGivenAccount = DeterminedParty.AccountID.content;
// Determined Party ID
var DeterminedPartyID = DeterminedParty.Party.PartyID.content;
// Determined Party UUID
var DeterminedPartyUUID = DeterminedParty.PartyUUID.content;
// Party Type (Role Code determines the Party type. Examples:Sales Unit Party )
var PartyRoleCode = DeterminedParty.RoleCode;

/* Sample Party Role Codes are listed below (Standard and Partner Defined Parties).
Account/Buyer Party : 1001
Bill-To Party : 8
Ship-To Party : 1005
Payer Party : 10
Sales Unit Party : 44
Seller Party : 2
Invoicing Unit Party : 1101
Employee Responsible : 39
Service Execution Team : 42
Service Performer Party : 43
Sales Partner Party : 29
Sales Employee Party : 46
Freight Forwarder Party : 47
ZParty with ZRole Code : Partner Defined Role Code*/
}
}
else
{
// Error occurred. This could be due to invalid account ID passed to API or invalid document type or technical error.
}

/* Sales Order: Sample Party Role Codes are listed below (Standard and Partner Defined Parties for CRMDocumentType = "114"; //Sales Order)
Account/Buyer Party : 1001
Bill-To Party : 10
Ship-To Party : 1005
Payer Party : 8
Sales Unit Party : 44
Seller Party : 2
Invoicing Unit Party : 1101
Employee Responsible : 39
Service Execution Team : 42
Service Performer Party : 43
Sales Partner Party : 29
Sales Employee Party : 46
Freight Forwarder Party : 47
ZParty with ZRole Code : Partner Defined Role Code
*/
/* Service Order: Sample Party Role Codes are listed below for CRMDocumentType = "117"; //Service Order
Account/Buyer Party : 1001
Bill-To Party : 10
Ship-To Party : 1005
Invoicing Unit Party : 1101
Seller Party : 2
Service and Support Team : 28
Processor Party : 40
Service Execution Team Party : 42
Service Performer Party : 43
Sales Unit Party : 44
Freight Forwarder Party : 47
Supplier Party : 6
Payer Party : 8
ZParty with ZRole Code : Partner Defined Role Code
*/
/* Service Request: Sample Party Role Codes are listed below for CRMDocumentType = "118"; //Service Request
Account/Buyer Party : 1001
Ship-To Party : 1005
Seller Party : 2
Service and Support Team : 28
Processor Party : 40
Sales Unit Party : 44
ZParty with ZRole Code : Partner Defined Role Code
*/
/* Sales Quote/Quote for Contract: Sample Party Role Codes are listed below for CRMDocumentType = "30"; //Customer Quote
Account/Buyer Party : 1001
Bill-To Party : 10
Ship-To Party : 1005
Seller Party : 2
Sales Partner Party : 29
Employee Responsible Party : 39
Sales Unit Party : 44
Sales Employee Party : 46
Freight Forwarder Party : 47
Payer Party : 8
ZParty with ZRole Code : Partner Defined Role Code
*/
/* Contract: Sample Party Role Codes are listed below for CRMDocumentType = "1092"; //Contract
Account /Buyer Party : 1001
Bill-To Party : 10
Ship-To Party : 1005
Invoicing Unit Party : 1101
Authorised Party : 1020
Contract Administrator Party : 1122
Seller Party : 2
Contracting Unit Party : 204
Sales Partner Party : 29
Employee Responsible Party : 39
Service Execution Team Party : 42
Service Performer Party : 43
Sales Unit Party : 44
Payer Party : 8
ZParty with ZRole Code : Partner Defined Role Code
*/
/* Customer Return: Sample Party Role Codes are listed below for CRMDocumentType = "32"; //Customer Return
Account/Buyer Party : 1001
Bill-To Party : 10
Ship-To Party : 1005
Invoicing Unit Party : 1101
Seller Party : 2
Service and Support Team : 28
Employee Responsible Party : 39
Processor Party : 40
Sales Unit Party : 44
Payer Party : 8
ZParty with ZRole Code : Partner Defined Role Code
*/