zoukankan      html  css  js  c++  java
  • 如何让SAP C4C自定义BO实现附件上传的功能

    My series of Cloud Application Studio Blogs

    I began to learn how to use Cloud Application Studio today and I record what I have learned into this blog regarding how to enable attachment upload functionality for my custom BO.
    (1) Create a new BO for example TestBO by copying the following source code in Cloud studio and activate it. Here an association to depedent object AttachmentFolder is declared.

    import AP.Common.GDT as apCommonGDT;
    businessobject TestBO {
    [Label("Agreement ID")] [AlternativeKey] element AgreementID:ID;
    		[Label("Start Date")] element StartDate:Date;
    		[Label("Close Date")] element CloseDate:Date;
    		[DependentObject(AttachmentFolder)] node Attachment;
    }
    

    (2) Create all necessary UI screens via wizard by right clicking the created BO and choose “Create Screens” from context menu. Once done you should have several automatically created artifacts as displayed below.

    (3) Assign your business user to the created work center floorplan and after you log on the system, you should see the below OWL with only one “Export” button existing in toolbar. Without New button it is not possible for us to create some test data. As a result we have to create the New button manually.

    Open the OWL in UI Designer, select the toolbar in OWL and click “Configure” button in property tab:

    Select “My Button” and click the triangle to move it to the right part.

    Choose “QuickCreate” as Semantic, and for OnClick property, leave it as blank.

    Under Thing Type section, bind the “Associated Thing Type container” to BO ID field.

    And then bind this BO ID field to the automatically created Thing Type Object.

    Now you could create new BO instance by pressing the New button, and quick create UI will be displayed:



    Click the hyperlink and now you can reach the Thing inspector UI.

    Remove unused tab and only keep Attachments tab. Locate the document reuse UI from path listed below, drag it from Configuration Explorer and drop to the area of Attachments tab.

    Click Bind button, bind Controller root node to the NodeReference Binding under Interface in the right.

    Now you could create new attachment file for a given test BO instance.

    Once you have created an attachment and successfully saved it, next time you open the Thing inspector UI, you can observe there is a HTTP request which fetches the attachment data from backend.

    In the response, the structure fields are exactly mapped to the corresponding fields in attachment DO.

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

  • 相关阅读:
    Ubuntu apt-get 失败验证
    网络服务器处理阻塞问题
    58、剑指offer--对称的二叉树
    57、剑指offer--二叉树的下一结点
    56、剑指offer--删除链表中重复的结点
    55、剑指offer--链表中环的入口结点
    54、剑指offer--字符流中第一个不重复的字符
    53、剑指offer--表示数值的字符串
    52、剑指offer--正则表达式匹配
    51、剑指offer--构建乘积数组
  • 原文地址:https://www.cnblogs.com/sap-jerry/p/13585948.html
Copyright © 2011-2022 走看看