Using Your Liquid UI Products > WS aka Web Scripts (Attended RPA for SAP)
Read, Write Data from SAP table using Table Scrolling Logic
(1/1)
Rahul Gera:
SAP Table Scroll
Usage: This example is to create the logic to scroll SAP table to read and write data from the SAP table in VA01 transaction.
Liquid UI Script:
pushbutton([TOOLBAR],'TableScroll','?',{'process':tableScroll});
function tableScroll() {
onscreen 'SAPMV45A.4001'
// Table Scroll begins here
absrow = 1;
relrow = 1;
// Fetch the table attributes
gettableattribute("T[All items]", {"firstvisiblerow":"FVisRow", "lastvisiblerow":"LVisRow", "lastrow":"LastRow"});
if(FVisRow==1) {
goto new_row;
}
// Scroll to the absolute row
enter("/ScrollToLine=&V[absrow]", {"table":"T[All items]"});
new_screen:;
onscreen 'SAPMV45A.4001'
// Refetch table attributes, in case they might of changed
gettableattribute("T[All items]", {"firstvisiblerow":"FVisRow", "lastvisiblerow":"LVisRow", "lastrow":"LastRow"});
// Reset the relevant row
relrow = 1; // reset the relative row with a new screen
new_row:;
if(absrow>LVisRow){
// end of visible table screen?
enter("/ScrollToLine=&V[absrow]", {"table":"T[All items]"});
goto new_screen;
}
if(absrow>LastRow){
// end of the table?
goto end_of_table;
}
set("V[z_va01_mat]","&cell[All items,Material,&V[relrow]]");
println('0000000000000000000000000000000000 z_va01_mat:'+z_va01_mat+':');
if(z_va01_mat == 'L-60F') {
set('cell[All items,Order Quantity,&V[relrow]]','506');
}
// Increment out counters
absrow++;
relrow++;
goto new_row;
end_of_table:;
// Scroll back to the top of the table
enter("/ScrollToLine=1", {"table":"T[All items]"});
}
Navigation
[0] Message Index
Go to full version