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

Not able to locate saved data in custom table of SAP public cloud

rutudixit_15
Discoverer
0 Kudos
536

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.


https://community.sap.com/t5/enterprise-resource-planning-q-a/easily-upload-data-from-excel-to-datab...

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.

 

Accepted Solutions (0)

Answers (1)

Answers (1)

Maciej__Galica
Explorer
0 Kudos

Hello Rutuja,

 

  • Is the behavior implementation saving data to the table you expect (e.g., ZCPR_ITEM_DB_01)?

  • Or is there a separate internal buffer or temp entity used before it hits the actual persistent table?

Nevertheless, 
If you want to see where data is actually going, just add a breakpoint in your behavior class (ZBP_R_CPR_ITEM_DB_01) → create method.
Upload again, and you’ll see exactly what’s being passed to the table and whether modify or insert is called.

 

OR

Verify where the data is actually going in Eclispe :-

SELECT * FROM zcpr_item_db_01 INTO TABLE @DATA(lt_data).
cl_demo_output=>display( lt_data ).

If it returns nothing, try looking at the generated runtime class (like ZR_CPR_ITEM_DB_01), and debug the create call to see what table it's writing to.

Please let me know if you need anything else.

 

Thanks.