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: 
BobShen
Product and Topic Expert
Product and Topic Expert
0 Kudos

背景介绍

  • S/4HANA Cloud ERP云最新支持使用API来批量对固定资产的报废处理。
  • 利用此服务,可对有收入和无收入的资产报废进行批量过账。新 API 是 OData 版本 4 服务。它属于通信场景 SAP_COM_0563。
  • 通过该服务,您可以对以下交易进行过账:
  • 含收入的资产报废(不集成到应收账款)和
  • 无收入资产报废(例如在报废的情况下)
  • 此服务涵盖的交易与“过账资产报废” (F7107) 应用中的交易相对应。

接前一篇,浅析S/4HANA ERP云的新API支持批量资产报废 - (一)有收入报废场景

2024-5-Asset API-Scen00.png

前提条件

在Business Accelerator Hub搜索对应API,可以查询到API Fixed Asset – Post Asset Retirement 相关的Communication Scenario是Finance - Fixed Asset Integration(SAP_COM_0563)。

BobShen_0-1715824992568.png

 

在公有云系统的APP通信安排里,创建对应的通信安排。

测试场景

以下是3个无收入报废场景的详细介绍,#后是关键字段的注释。

无收入报废场景

1.     完全报废

2024-5-Asset API-Scen07.png

Payload代码如下,根据实际情况更改:

{

    "ReferenceDocumentItem": "000001",

    "AccountingDocumentHeaderText": "7.Post with revenue",

    "AssetValueDate": "2024-04-30",

    "BusinessTransactionType": "RA21",

    "CompanyCode": "1310",

    "DocumentDate": "2024-04-30",

    "DocumentItemText": "7.Post without revenue-Manual",

    "FixedAsset": "0",

    "FixedAssetRetirementType": "1", #报废类型,1代表完全报废

    "MasterFixedAsset": "60000006",

    "PostingDate": "2024-04-30"

}

成功运行结果示例如下:

{

    "@odata.context": "../$metadata#FixedAssetRetirement/$entity",

    "@odata.metadataEtag": "W/\"20240504182908\"",

    "FixedAssetPostingUUID": "f7a50ed1-d4ad-1eef-82ef-36af70a8e8a4",

    "ReferenceDocumentItem": "1",

    "CompanyCode": "1310",

    "MasterFixedAsset": "60000006",

    "FixedAsset": "0",

    "AssetClass": "3200",

    "DocumentDate": "2024-04-30",

    "PostingDate": "2024-04-30",

    "AssetValueDate": "2024-04-30",

    "BusinessTransactionType": "RA21",

    "DocumentReferenceID": "",

    "AccountingDocumentHeaderText": "7.Post with revenue",

    "FxdAstRetirementRevenueType": "",

    "AstRevenueAmountInTransCrcy": 0.00,

    "FxdAstRtrmtRevnTransCrcy": "",

    "FxdAstRtrmtRevnCurrencyRole": "",

    "FxdAstRevnDetnDeprArea": "0",

    "FixedAssetRetirementType": "1",

    "AstRtrmtAmtInTransCrcy": 0.00,

    "FxdAstRetirementTransCrcy": "",

    "FxdAstRetirementRatioInPercent": 0.00,

    "FxdAstRtrmtQuantityInBaseUnit": 0.000,

    "BaseUnitSAPCode": "",

    "BaseUnitISOCode": "",

    "FixedAssetYearOfAcqnCode": "",

    "AccountingDocumentType": "",

    "TradingPartner": "",

    "AssignmentReference": "",

    "DocumentItemText": "7.Post with revenue-Manual",

    "SAP__Messages": []

}

运行的截屏如下:

BobShen_1-1715841577783.png

2.部分报废(按金额)

2024-5-Asset API-Scen08.png

Payload代码如下,根据实际情况更改:

{

    "ReferenceDocumentItem": "000001",

    "AccountingDocumentHeaderText": "8.Post without revenue",

    "AssetValueDate": "2024-04-30",

    "AstRtrmtAmtInTransCrcy": 300,

    "BusinessTransactionType": "RA21",

    "CompanyCode": "1310",

    "DocumentDate": "2024-04-30",

    "DocumentItemText": "8.Post without revenue-Manual",

    "FixedAsset": "0",

    "FixedAssetRetirementType": "2",

    "FixedAssetYearOfAcqnCode": "1", #资产购置财年,1代表报废的当年购置,2代表报废的往年购置;

    "FxdAstRetirementTransCrcy": "USD", #这里只能填写功能货币,如果没有配置功能货币,可以删除这一行;

    "MasterFixedAsset": "60000007",

    "PostingDate": "2024-04-30"

}

成功运行结果示例如下:

{

    "@odata.context": "../$metadata#FixedAssetRetirement/$entity",

    "@odata.metadataEtag": "W/\"20240422154325\"",

    "FixedAssetPostingUUID": "f7a50ed1-d4ad-1eef-829f-1ad3210128a0",

    "ReferenceDocumentItem": "1",

    "CompanyCode": "1310",

    "MasterFixedAsset": "60000007",

    "FixedAsset": "0",

    "AssetClass": "3200",

    "DocumentDate": "2024-04-30",

    "PostingDate": "2024-04-30",

    "AssetValueDate": "2024-04-30",

    "BusinessTransactionType": "RA21",

    "DocumentReferenceID": "",

    "AccountingDocumentHeaderText": "8.Post with revenue",

    "FxdAstRetirementRevenueType": "",

    "AstRevenueAmountInTransCrcy": 0.00,

    "FxdAstRtrmtRevnTransCrcy": "",

    "FxdAstRtrmtRevnCurrencyRole": "",

    "FxdAstRevnDetnDeprArea": "0",

    "FixedAssetRetirementType": "2",

    "AstRtrmtAmtInTransCrcy": 300.00,

    "FxdAstRetirementTransCrcy": "USD",

    "FxdAstRetirementRatioInPercent": 0.00,

    "FxdAstRtrmtQuantityInBaseUnit": 0.000,

    "BaseUnitSAPCode": "",

    "BaseUnitISOCode": "",

    "FixedAssetYearOfAcqnCode": "1",

    "AccountingDocumentType": "",

    "TradingPartner": "",

    "AssignmentReference": "",

    "DocumentItemText": "8.Post with revenue-Manual",

    "SAP__Messages": []

}

运行的截屏如下:

BobShen_0-1715841876392.png

3.部分报废(按百分比)

2024-5-Asset API-Scen09.png

Payload代码如下,根据实际情况更改:

{

    "ReferenceDocumentItem": "000001",

    "AccountingDocumentHeaderText": "9.Post without revenue",

    "AssetValueDate": "2024-04-30",

    "BusinessTransactionType": "RA21",

    "CompanyCode": "1310",

    "DocumentDate": "2024-04-30",

    "DocumentItemText": "9.Post without revenue-Manual",

    "FixedAsset": "0",

    "FixedAssetRetirementType": "3",

    "FixedAssetYearOfAcqnCode": "1", #资产购置财年,1代表报废的当年购置,2代表报废的往年购置;

    "FxdAstRetirementRatioInPercent": 50,

    "MasterFixedAsset": "60000008",

    "PostingDate": "2024-04-30"

}

成功运行结果示例如下:

{

    "@odata.context": "../$metadata#FixedAssetRetirement/$entity",

    "@odata.metadataEtag": "W/\"20240504182908\"",

    "FixedAssetPostingUUID": "f7a50ed1-d4ad-1eef-82ef-3e79b82d88a4",

    "ReferenceDocumentItem": "1",

    "CompanyCode": "1310",

    "MasterFixedAsset": "60000008",

    "FixedAsset": "0",

    "AssetClass": "3200",

    "DocumentDate": "2024-04-30",

    "PostingDate": "2024-04-30",

    "AssetValueDate": "2024-04-30",

    "BusinessTransactionType": "RA21",

    "DocumentReferenceID": "",

    "AccountingDocumentHeaderText": "9.Post with revenue",

    "FxdAstRetirementRevenueType": "",

    "AstRevenueAmountInTransCrcy": 0.00,

    "FxdAstRtrmtRevnTransCrcy": "",

    "FxdAstRtrmtRevnCurrencyRole": "",

    "FxdAstRevnDetnDeprArea": "0",

    "FixedAssetRetirementType": "3",

    "AstRtrmtAmtInTransCrcy": 0.00,

    "FxdAstRetirementTransCrcy": "",

    "FxdAstRetirementRatioInPercent": 50.00,

    "FxdAstRtrmtQuantityInBaseUnit": 0.000,

    "BaseUnitSAPCode": "",

    "BaseUnitISOCode": "",

    "FixedAssetYearOfAcqnCode": "1",

    "AccountingDocumentType": "",

    "TradingPartner": "",

    "AssignmentReference": "",

    "DocumentItemText": "9.Post with revenue-Manual",

    "SAP__Messages": []

}

运行的截屏如下:

BobShen_1-1715841937427.png

总结

以上3个无收入业务场景的payload的字段准备,大部分字段一致,有个别字段根据场景不一样会有所区别,使用当中可以对比分析灵活使用。

准备资料

帮助文档