cancel
Showing results for 
Search instead for 
Did you mean: 

Screen Personas : Change Cell Value In Table

arifarifoglu1
Explorer
0 Kudos
177

I can read the data in the table as below, but I cannot change the cell value.
The screen does not change. The table is not editable.

if(session.idExists("wnd[0]/usr/cntlC_CONTAINER/shellcont/shell/shellcont[1]/shell/shellcont[1]/shell"))
{
    session.utils.alert("Table exist");
    var table = session.findById("wnd[0]/usr/cntlC_CONTAINER/shellcont/shell/shellcont[1]/shell/shellcont[1]/shell");
    var rowsCount = table.rowCount;
    session.utils.alert("Table Row Count:" + rowsCount);
 for(var index = 0; index < rowsCount; index ++){
     var cellValue = table.getCellValue(index, "FIT_TRA_ID");      
     //Cell value fills successfully.
     session.findById("wnd[0]/usr/cntlC_CONTAINER/shellcont/shell/shellcont[1]/shell/shellcont[1]/shell").
     modifyCell(index,"SOURCE_CREATED_BY",cellValue);//Not Working
 }
}

arifarifoglu1_0-1726054364264.png

 

View Entire Topic
tamas_hoznek
Product and Topic Expert
Product and Topic Expert

I don't know what transaction your screen is from, but I tried changing the 'Customer Material Number' cell value in the first row of the item overview table in VA02's 'Sales' tab and this worked fine for me:

session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_OVERVIEW/tabpT\\01/ssubSUBSCREEN_BODY:SAPMV45A:4400/subSUBSCREEN_TC:SAPMV45A:4900/tblSAPMV45ATCTRL_U_ERF_AUFTRAG").modifyCell(0, 'VBAP-KDMAT', 'test');

The value was changed to test as expected. Of course, the table and field must be editable for this to work.

arifarifoglu1
Explorer
0 Kudos
Thanks for reply.