SAP CRM和Cloud for Customer的Excel导出功能比较
发布日期:2021-06-30 14:29:06 浏览次数:2 分类:技术文章

本文共 2481 字,大约阅读时间需要 8 分钟。

Excel export is supported in both CRM and C4C. This blog gives a short introduction about how export is implemented in both system.

Excel export in CRM

In CRM, the exported excel has csv format which could directly be opened by any text editor:

If you would like to study how this functionality is implemented in CRM, just follow the guide below.

Open a WebClient UI component which supports excel export for example PRD01QR, double click the tag chtmlb: configTable

Then double click implementation class of this tag:

Set a breakpoint on method ADD_DOWNLOAD_TO_EXCEL:

Click Export button to trigger the breakpoint, in variable ev_script we can find the SICF service name for export function:

find this service in tcode SICF:

double click it to locate the handler class.

Set a breakpoint in its HANDLE_REQUEST method, and now you can debug how the source code of csv file is generated.

Excel export in C4C

The excel exported in C4C has postfix .xlsx, see one example below.

Rename it to ListofAccounts__EN.zip and unzip it, you will find that the .xlsx is actually a zipped package which contains several files. The actual content from C4C OWL are stored in file sheet1.xml.

Here below are the steps if you would like to explore more detail about excel export from UI perspective in C4C ( since the UI source code is open to partner & customer ).

(1) Launch C4C via Chrome, switch to debug mode via Ctrl+Alt+Shift+P.

Refresh the page and click F12 to launch Chrome development tool.

(2) Click Souces tab, press Ctrl+O and type keyword Button, click the first hit “Button-dbg.js”:

Set a breakpoint in line 154, the event handler for click:

(3) Perform Excel export in UI and breakpoint will be triggered. Debug into the code and soon you will find the url population logic is implemented in function _navigateToURL.

Inside this function you can learn how the final url for excel download is assembled by different parts:

Finally the assembled url is stored in variable url and the download is started by native API window.open. From the url we can also find the SICF service output_document, although its implementation in ABAP backend is not visible to partner & customer.

Further reading

In CRM there are also some standard API which supports to manipulation on Office document by ABAP. See for more detail.

Also refer to Jerry’s other blogs regarding the comparison how CRM and Cloud for Customer implement a given feature using different approaches:

要获取更多Jerry的原创文章,请关注公众号"汪子熙":

转载地址:https://jerry.blog.csdn.net/article/details/108270069 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:使用SAP C4C自定义BO实现自定义的Number Range
下一篇:SAP Cloud for Customer CLR(Code List Restriction)的一种高级用法

发表评论

最新留言

留言是一种美德,欢迎回访!
[***.207.175.100]2024年04月18日 06时00分49秒