Let's follow up this discussion at the Neptune Community

(this forum will be kept in read-only mode)

Edit row of Table


I've a Table element generated by an ABAP method. Inside a column there is an editable field that should drive values of all cells of the same row.

Could you explain me how can I edit all cells of the same row at onChange event of editable field? I hope it is quite clear what I need...I've attached an image of my sitauation.

Thank you and regards


(41.3 KB)

Hi Alessandro

I think the solution is to update the model data. When selecting the partner, on the OnChange event, you need to update the modeldata for City/Address etc.

and maybe a refresh to display the changed data: modelPartnerList.refresh();


Ole Andre 

thank you for your reply. I was already working with model data, but if I try to update modelPartnerList, I'll update the entire table instead of the line I need.

Could you give me an example how I've to update the current row?

Thank you and regards


Hi Alessandro

I would use the ModelData.Update method to update the correct row.

More information on the Offline ModelData object:



Ole Andre 

Hi Ole Andre,

thank you for your big help, I'm sorry for bothering but I'm quite new with Neptune. I've read doc you refer me and I try to apply it.

From doc I see that UPDATE should be populated in this way:

// obj = FieldName of you object with binded model (in the designer)

// keyField = FieldName of your key in the model

// keyValue = FieldValue of your key in the model

// objData = New Data (workarea of the internal table)

I'm not sure that I've understand correctly what it is requested... 

This is what I wrote, I've tried different things, but I receive always an error. My big doubt is what is needed in the fourth field because it is not too clear for me.

modelPartnerList.Update(PartnerList, "PARTNER_FCT_DESC", "new value", ???);

Thank you very much for your precious help. 


Hi Alessandro,

Were you able to resolve your problem? I have the same problem as you had and I am unable to find a solution.

Please help me if you were able to solve your issue.



Hi Amit 

Here is an example. I hope this is clearly enough explained. If you need further help, please let me know your problem, printscreen from the designer etc.

ModelData.Update fields:

  1. FieldName of you object with binded model (in the designer)
  2. FieldName of your key in the model
  3. FieldValue of your key in the model
  4. New Data (workarea of the internal table)


// Get the model for OrderHeader - Structure (Workarea)
dataHead = modelpageOrder.oData();

// Change Data
dataHead.BSTNK = "Some new Data";

// Update Header - Table



Ole Andre 

Hello Ole Andre,

I tried as per your advise but still no luck. I am attaching the details in the document.

Please take a look and advise how to proceed.




Hi Ole, 

I have a similar requirement...The solution is working fine when I am trying to update one record but it does not work if I have more than 1 record to update (For ex- if I am trying to update two records in the table, botth the records in the table gets updated but with the last change - how to overcome this?). 

Also what if my key field is a combination of Date and Time fields then how can I pass the combination of both the fields as key field?



Hi Rahul,

please set your sap.m.Table object property 'mode' to MultiSelect.

Then use the following code-snippet in order to retrieve all selected table entries:

// Replace yourTable with Table/List ID

// Replace yourField with Field ID

var itemsSelected = yourTable.getSelectedItems();

for (i=0; i<itemsSelected.length; i++){

var item = itemsSelected[i];

var context = item.getBindingContext();

var value = context.getProperty("yourField");

// Do something


Neptune recommends to provide a single surrogate key field, could also be a concatination of fields. All Neptune data methods are based on a single key field.

Best regards


Hi Christoph,

Thanks for your reply..however, in my solution the user doesn't have to select anything. Please see the attached screenshot. Here, the user can change one or more values in the Input field from the f4 help. And then click on a button, my requirement is to just change these values to the backend table. Also the problem I am facing using the ModelData .update method is that my keyfield is a combination of the date and time fields. So I am not sure how to handle this.

I hope I am clear. 

Thanks a lot for your help.



(104 KB)

Hi Rahul

If you are using an inputfield and ValueHelpRequest you can do like this:

On the event: valueHelpRequest


// Set Object
var context = oEvent.oSource.getBindingContext();
objSelect = (context.getObject());

// Open Dialog


The objSelected is a global javascript variable. This will now contain the record you currently pressed on.

On the confirm/select event you can access the objSelected and change the data content. This example uses an selectDialog and the conform event:


// Single Select
var selectedItem = oEvent.getParameter("selectedItem");
var context = selectedItem.getBindingContext();
var matnr = context.getProperty("MATNR");

// Set New Data
objSelect.MATNR = matnr;



Ole Andre  

Hi Ole,

Thanks for your reply. I am already using something similar for my requirement :

I have the below code in the Value HelpRequest event of the Inputfield :



And the below code in the Confirm event of the Select Dialog :

var selectedItem = oEvent.getParameter("selectedItem");

var context = selectedItem.getBindingContext();

var value = context.getProperty("TEXT");

var context_new = objSelected.getBindingContext();

var datahead = modeloPage_HR.oData; //Structure to update my back end table

datahead.PDSNR = context_new.getProperty("PDSNR");

datahead.SATZA = context_new.getProperty("SATZA");

datahead.ABWGR_TEXT = value;

datahead.ENABLED = Boolean(true);

datahead.CHANGED = "X";

// Add Data



This code works absolutely fine when I am changing data in 1 of the input field of the table and pressing update button, but when I change 2 of the input fields and then press update both the records in the back end are update but with the values of the 2nd record. I am not sure why?

I hope I was able to explain the issue.



I have now been able to resolve the issue myself. Thanks a lot for your help.

Hi Amit,

Were you able to resolve your issue? 



Login or Signup to post a comment