SAP OData 服务关于本地文件作为附件上传的一些错误消息

简介: SAP OData 服务关于本地文件作为附件上传的一些错误消息

错误消息:

{
    "error": {
        "code": "005056A509B11EE3AEB5819C07C69E2F",
        "message": {
            "lang": "en",
            "value": "The server is refusing to process the request because the entity has an unsupported format"
        },
        "innererror": {
            "transactionid": "E472723D614C01E0E0063942C05FFFDA",
            "timestamp": "20221221083147.9877050",
            "Error_Resolution": {
                "SAP_Transaction": "For backend administrators: run transaction /IWFND/ERROR_LOG on SAP Gateway hub system and search for entries with the timestamp above for more details",
                "SAP_Note": "See SAP Note 1797736 for error analysis (https://service.sap.com/sap/support/notes/1797736)"
            }
        }
    }
}


70b12bc8c30c7abc91ced9159818965a.png

当前传进来的文件类型:text/plain

1170f00e50c8291409dfde1932f9ab60.png

支持的文件类型:

75d3ef31373dd9dd3125697c73f49099.png

在 gm4 使用 Opportunity 进行测试:上传一张图片:

015d4f795723460511452364654f4faf.png

成功创建附件,201 created:

d9b1ab7153be23181b1f5606c0b9046a.png

上传文本文件:

61d1879aadfddbebe7559fe3e700e47e.png

d686716bfd23aa5622498590f7d5418d.png

a1213495413540afeb0d4358090421d6.png

如果是 media 的话,所有的类型都支持:

6ae8f5cd7a06bb91a9d6a8643449f455.png

关于输入参数 iv_slug 为空的问题:https://answers.sap.com/questions/12359446/uploadcollection-parameter-slug-does-not-work-anym.html

ded7439b92f08e992db6bb5b52b772f1.png

Service Builder 提供了生成模型提供程序类 (MPC) 的选项。 如果在模型中维护注释,生成的 MPC 类也支持内联注释。

  • 使用基于词汇的注释(Service with Vocabulary-based Annotations)创建服务类型的项目。
  • 导入词汇表。
  • 单击生成运行时对象以生成 MPC 类。
  • 方法 DEFINE_VOCAB_ANNOTATIONS 在模型提供者类中创建以维护基于词汇表的注释。

对于带有 SAP 注释的项目类型服务,将不会创建方法 DEFINE_VOCAB_ANNOTATIONS。


词汇引用在方法 DEFINE_VOCAB_ANNOTATIONS 中创建。


示例代码如下:

lo_reference = vocab_anno_model->create_vocabulary_reference(
                                iv_vocab_id = 'ZCAPABILITIES'
                                iv_vocab_version = '0001').
  lo_reference->create_include( iv_namespace = 'Org.OData.Capabilities.V1'
                                iv_alias     = 'UI' ).


生成项目后,Service Builder 会生成注释提供程序类 (APC,是 Annotation Provider Class 的缩写) 的类。APC 将仅为类型为引用服务的注释模型的项目(Annotation Model for Referenced Service)生成。


APC 生成并存储在树区域的 Runtime Artifacts 文件夹中。 显示生成结果的消息也显示在批量编辑视图中。 方法 DEFINE_VOCAB_ANNOTATIONS 将在 APC 中创建以维护基于词汇表的注释。


示例代码为:

lo_reference = vocab_anno_model->create_vocabulary_reference( iv_vocab_id = '/IWBEP/VOC_CORE'  iv_vocab_version = '0001').
  lo_reference->create_include( iv_namespace = 'Org.OData.Core.V1' ).


相关文章
|
5天前
|
前端开发 数据库 开发者
如何在 SEGW 事务码里为 SAP ABAP OData 服务实现 Function Import 试读版
如何在 SEGW 事务码里为 SAP ABAP OData 服务实现 Function Import 试读版
7 1
|
5天前
SAP ABAP OData 服务里需要指定 guid 类型的请求参数时,正确语法是什么?
SAP ABAP OData 服务里需要指定 guid 类型的请求参数时,正确语法是什么?
6 1
|
5天前
|
安全 API 数据库
SAP ABAP OData 中 Function import 的概念介绍
SAP ABAP OData 中 Function import 的概念介绍
13 2
|
5天前
|
机器学习/深度学习 人工智能 搜索推荐
SAP Commerce Cloud 智能销售服务 (Intelligent Selling Services)概述
SAP Commerce Cloud 智能销售服务 (Intelligent Selling Services)概述
9 0
|
5天前
|
监控 安全 应用服务中间件
SAP ABAP STRUST 事务码里的错误消息 - Local PSE does not match database original
SAP ABAP STRUST 事务码里的错误消息 - Local PSE does not match database original
7 0
|
5天前
|
JSON 应用服务中间件 API
使用 ABAP 代码消费 SAP 系统的 OData 服务
使用 ABAP 代码消费 SAP 系统的 OData 服务
15 1
|
5天前
|
前端开发 搜索推荐 开发者
SAP UI5 sap.m.Column 控件的 minScreenWidth 属性介绍
SAP UI5 sap.m.Column 控件的 minScreenWidth 属性介绍
33 0
|
5天前
|
JavaScript 前端开发 开发者
SAP UI5 控件 sap.m.ListBase 的 inset 属性的作用介绍
SAP UI5 控件 sap.m.ListBase 的 inset 属性的作用介绍
18 0
|
5天前
|
Web App开发 数据采集 前端开发
纯技术讨论:如何让 SAP UI5 应用无法被别人在浏览器里调试 - 这种做法不推荐试读版
纯技术讨论:如何让 SAP UI5 应用无法被别人在浏览器里调试 - 这种做法不推荐试读版
28 0
|
5天前
|
XML 存储 数据格式
SAP UI5 控件 customData 属性的应用介绍
SAP UI5 控件 customData 属性的应用介绍
38 0