2 weeks ago - last edited 2 weeks ago
Hello,
I am referring to below link to uploaded data from excel and save it to custom table which is created in SAP S4 public cloud.
back end manage :
managed implementation in class ZBP_R_CPR_ITEM_DB_01 unique;
strict ( 2 ) ;
define behavior for ZR_CPR_ITEM_DB_01 alias AMD_ID//upload // amd_id
persistent table zcpr_item_db_01
etag master LocalLastChangedAt //comment
lock master
early numbering
authorization master( global )
{
determination AmmendamentID on save {create;}
field ( readonly )
Cputm,
Cpudt,
Cngtm,
Chuser,
LocalLastChangedAt;
field ( readonly ) //: update )
AmdID;
create;
update;
delete;
mapping for ZCPR_ITEM_DB_01
{
AmdID = amdid;
Amdno = amdno;
.
.
.
.
.
.
.
.
}
Front End :
onUpdatePriceButton: function(AmdID) {
debugger;
var oModel = this.getOwnerComponent().getModel();
//all excel file data
var items = this.getView().getModel("localModel").getData().items;
var indices = this.byId("ExcellUploadTable").getSelectedIndices();
for (var i = 0; i < indices.length; i++) {
// var obj = items[i];
var obj = items[indices[i]];
var oldfr = this.onDateConvert(obj['Old From']);
var Enddate = this.onDateConvert( obj['End Date']);
var engdt = this.onDateConvert(obj['Entered at']);
var ExcellpayLoad={
"AmdID": parseInt(Math.random()*1000).toString(),
//"AmdID": obj['POAM ID'],
"Amdno": obj['POAM No'] ,
"Lifnr": obj['Vendor'],
"Bstnk": obj['PO Number'],
"Posex" : obj['item'] ,
.
.
.
.
.
.
};
var that =this;
this.oModel.create("/ZCPR_UPLOAD", ExcellpayLoad, {
success: function(response) {
sap.m.MessageToast.show("Excell File Data Saved Successfully.");
},
error: function(error) {
sap.m.MessageToast.show("Failed to save Excell Fil Data.");
}
});
}
I have already created oData and published it. The oData is being consumed from Fiori application. The Fiori application is uploading excel sheet properly and seems like saving data.
I have created another oData to fetch the table content. The same is again used in Fiori application for consumption. The fiori application is displaying data properly.
However, in Eclipse ADT when CDS view is created on the same table to check if the data is saved or not. It's not reflecting.
I am confused, from where the data is stored.
Your help is appreciated.
Regards,
Rutuja.
User | Count |
---|---|
65 | |
8 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.