0% found this document useful (0 votes)
16 views17 pages

Fetching Report's Data From ECC To C4C Via CPI (Alternative For Mashups in C4C Integr

The document outlines a solution for fetching report data from ECC to C4C using SAP Cloud Platform Integration (CPI) as an alternative to HTML Mashups. It details the step-by-step process of creating web services in ECC, configuring CPI, and setting up C4C to display the report data without requiring VPN access for end-users. The solution aims to enhance user experience by simplifying data access across private networks.

Uploaded by

jaydata2018
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views17 pages

Fetching Report's Data From ECC To C4C Via CPI (Alternative For Mashups in C4C Integr

The document outlines a solution for fetching report data from ECC to C4C using SAP Cloud Platform Integration (CPI) as an alternative to HTML Mashups. It details the step-by-step process of creating web services in ECC, configuring CPI, and setting up C4C to display the report data without requiring VPN access for end-users. The solution aims to enhance user experience by simplifying data access across private networks.

Uploaded by

jaydata2018
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 17

SAP Cloud Platform Integration (CPI) || Fetching Report's data

from ECC to C4C via CPI (Alternative for Mashups in C4C/


Integration fo ECC, CPI, and C4C)
SAP Cloud Platform Integration (CPI) || Fetching R... - SAP Community

SCENARIO:

There is a report in ECC, and the idea is to show the report's data in C4C. Now,
the C4C experts will say that you can create Webservices in ECC and they can be
displayed in the "HTML Mashups"which has been provided by SAP, out-of-the-
box i.e. by standard.

Now I will tell you what is the problem with Mashups. In the configuration for
Mashups you maintain the link to access the report, and the credentials to ECC.
Your client's ECC runs in their private network, and hence, the moment the end-
user is outside the company's network, these reports won't run. To run these
reports you shall need VPN. But, isn't it much of a trouble for the client, and their
end-users? The idea should always be to provide ease to the end-users while
transacting.

So what should be done?

SOLUTION:

1. [ABAP] Create a webservice


2. [CPI] Generate an end-point URL, and share it with [ABAP]. Maintain the
Connection details as shown below, and Deploy the IFlow to generate the

end-points.

3. [ABAP] Share the structure in the form of abcd.wsdl to [CPI], otherwise,


the [CPI] person can extract the structure from SE80 from the package in
which the [ABAP] has created the Service defination.
4. [ABAP] Create a proxy program to send the report's data. [ABAP/
CPI]Please take a note of the Logical Port name maintained in the program.

5. [ABAP /CPI] Enter the TCode, SOAMANAGER. Typically this TCODE when
entered, opens in your webbrowser. Now, go to Web Service Configuration.
6. [ABAP/ CPI] Search for the consumer proxy program as show below:

7. [ABAP/ CPI] By Manual Configuration, create Logical Ports using the same
Logical Port, as mention in the proxy program (refer point number 4).

8. [ABAP/ CPI] Below is the configuration details for the Logical Port created:
9. [ABAP/ CPI] Execute the program in SE80 to send the report data to CPI,
so that you can see the incoming Payload which is to be shared with the
[C4C] consultant.
10. [CPI] Below is the Payload which you can see in the TRACE mode.

11. [C4C] Create a custom Business Object in SDK.

12. [C4C] Here is the code for the Business Object, which you can creting
seeing the payload shared by the [CPI]. Basically, the elements decalred
are going to be the columns of the Data Store which you are going to

13. import AP.Common.GDT as apCommonGDT;


14.
15. [WithAdministrativeData][ChangeHistory] businessobject
SaleOrder_Report {
16.
17. [Label ("Report Name")] element ZReportName :
LANGUAGEINDEPENDENT_LONG_Text;
18. [Label ("External ID")] element ZExternalID : ID;
19. [Label ("Internal ID")] element ZInternalID :
BusinessPartnerInternalID;
20. [Label ("Sales Order Number")] element ZSONumber :
LANGUAGEINDEPENDENT_MEDIUM_Text;
21. [Label ("Sales Order Item Number")] element ZSOItem
: LANGUAGEINDEPENDENT_MEDIUM_Text;
22. [Label ("Purchase Order Number")] element ZPONumber :
LANGUAGEINDEPENDENT_MEDIUM_Text;
23. [Label ("Purchase Order Date")] element ZPODate
: Date;
24. [Label ("Quality")] element ZQuality :
LANGUAGEINDEPENDENT_MEDIUM_Text;
25. [Label ("Grade")] element ZGrade :
LANGUAGEINDEPENDENT_MEDIUM_Text;
26. [Label ("Thickness")] element ZThickness :
LANGUAGEINDEPENDENT_MEDIUM_Text;
27. [Label ("Width")] element ZWidth :
LANGUAGEINDEPENDENT_MEDIUM_Text;
28. [Label ("Length")] element ZLength :
LANGUAGEINDEPENDENT_MEDIUM_Text;
29. [Label ("Finish")] element ZFinish :
LANGUAGEINDEPENDENT_MEDIUM_Text;
30. [Label ("Edge Condition")] element ZEdgeCon :
LANGUAGEINDEPENDENT_MEDIUM_Text;
31. [Label ("Document Date")] element ZDocDate : Date;
32. [Label ("Quantity")] element ZQuantity :
LANGUAGEINDEPENDENT_MEDIUM_Text;
33. [Label ("Basic Rate")] element ZBasicRate :
LANGUAGEINDEPENDENT_MEDIUM_Text;
34. [Label ("Product Type")] element ZProdType :
LANGUAGEINDEPENDENT_MEDIUM_Text;
35. [Label ("Reason for Rejection")] element ZROR :
LANGUAGEINDEPENDENT_MEDIUM_Text;
36. [Label ("Part Weight Min")] element ZPWtMin :
LANGUAGEINDEPENDENT_MEDIUM_Text;
37. [Label ("Part Weight Max")] element ZPwWtMax :
LANGUAGEINDEPENDENT_MEDIUM_Text;
38. [Label ("Creation Date")] element ZCreationDate : Date;

39. [C4C] A script (.absl) for the "Event-BeforeSave" to be created, and below
is the script for it.

40. import ABSL;


41. import AP.FO.BusinessPartner.Global;
42.
43. foreach (var each5 in this)
44. {
45. if (each5.SAP_SystemAdministrativeData.CreationDateTime ==
each5.SAP_SystemAdministrativeData.LastChangeDateTime)
46. {
47. each5.ZCreationDate =
each5.SAP_SystemAdministrativeData.CreationDateTime.Convert
ToDate();
48. }
49. }
50. foreach (var each2 in this)
51. {
52. var QueryUpdate = SaleOrder_Report.QueryByElements;
53. var SelUpdate = QueryUpdate.CreateSelectionParams();
54. var CurrentDate = Context.GetCurrentSystemDate();
55. var CurrentDate1 =
Context.GetCurrentGlobalDateTime().ConvertToDate();
56. SelUpdate.Add(QueryUpdate.ZCreationDate, "E", "EQ",
CurrentDate);
57. var ResultUdpate = QueryUpdate.Execute(SelUpdate);
58.
59. if (ResultUdpate.Count() > 0)
60. {
61. ResultUdpate.Delete();
62.
63. }
64. }
65. foreach (var each in this)
66. {
67. var Query = Customer.QueryByBusinessObjectCustomer;
68. var SelectionPar = Query.CreateSelectionParams();
69. SelectionPar.Add(Query.ExternalID.content, "I",
"EQ", each.ZExternalID.RemoveLeadingZeros());
70. var result = Query.Execute(SelectionPar);
71. if (result.Count() > 0)
72. {
73. foreach (var custinfo in result)
74. each.ZInternalID = custinfo.InternalID;
75. }

}
76. [C4C] Create a Data Source on the custom Business Object created.
Follow the screeshots below
77. [C4C] Create a custom OData Service. Select the Business Object, Select
the elements/ fields, Assign the workcenter, Save the OData Service, and
Activate it. Share the link with [CPI] Consultant.
78. [CPI] Connect the End event to the Receiver using an OData adapter.
79. [CPI] In the Message Mapping, maintain the .xsd file generated in the
Target, and seeing the incoming payload from ECC, create a structure for
the source.

80. [CPI] Make the necessary mapping as per the Mapping Sheet shared by
Business Team.

81. [ABAP/ CPI] Now run the program in SE38, and this will do the following:

o From SE38, the consumer proxy program will send the data from the ERP
to CPI, bases on the Transport Settings mainted in SOAMANGER.

o The Data comes to CPI, and gets consumed by the Receiver i.e. C4C on
the basis of the OData Adapter Connection setting, and hits C4C.

o In C4C, you may create a report on top of the Data Source created in
step number 14, and view the data.

You might also like