cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

how to call response collection entity from sap fiori

0 Kudos
190

Hello,

We are uploading Excel data to backend via Function import, in Fiori side via Batch call we are sending payload data.

oModel.callFunction("/uploadBudgetInfo", {
method: "POST",
batchGroupId: "batchFunctionImport",
urlParameters: testUrlParam[i],
changeSetId: "test",
});

oModel.submitChanges({
batchGroupId: "batchFunctionImport", //Same as the batch group id used previously
success: function (oData,response) {
var res = oData;
}.bind(this),
error: function (oError) {
var err = oError;
}
});

But we are getting BatchResponse with 1 collection returntype - cds_zwbsbudget_release.ZD_UPLOADBUDGET_LOG as below - 

biplab_chakraborty_0-1727942275244.png

Function import in Metadata as below,

<FunctionImport Name="uploadBudgetInfo" ReturnType="Collection(cds_zwbsbudget_release.ZD_UPLOADBUDGET_LOG)" m:HttpMethod="POST" sap:action-for="cds_zwbsbudget_release.BudgetType" sap:applicable-path="uploadBudgetInfo_ac">
<Parameter Name="objnr" Type="Edm.String" Mode="In" MaxLength="22" sap:label="Object Number"/>
<Parameter Name="Amount" Type="Edm.String" Mode="In" Nullable="true"/>
<Parameter Name="Currency" Type="Edm.String" Mode="In" MaxLength="5" Nullable="true" sap:label="Transaction Currency"/>
<Parameter Name="status" Type="Edm.String" Mode="In" MaxLength="1" Nullable="true"/>
<Parameter Name="msg_txt" Type="Edm.String" Mode="In" Nullable="true"/>
</FunctionImport>

Please let me know how can I get response data from cds_zwbsbudget_release.ZD_UPLOADBUDGET_LOG, as per ABAP team log is storing inside this.

We are using BAS project and OData V2 service using ABAP RAP.

Accepted Solutions (0)

Answers (1)

Answers (1)

WouterLemaire
SAP Mentor
SAP Mentor

Any reason you use a callfunction?  A post to an entity for each line would also work.

Regarding your question, it depends on the backend implementation. They need to return this. 

A suggestion, have you looked into the spreadsheet importer of @Former Member ? https://spreadsheet-importer.com