on 03-30-2015 12:14 AM
Hi
Please can anyone throw light on how to read internal table in JS? All i have is:
How to read table in js? |
---|
for (var j=0; j<"<%= cols%>"; j++) { VAR actvty = 0; <% read table gt_bays into bays_wa index j. if sy-subrc is INITIAL. actvty = bays_wa-grc. endif. %>; |
in the above code i want to read the table based on the index 'J' from the JS for loop and also set the actvty variable in the JS? any pointers here please?
try something like this:
var grc;
for (var j=0; ....
{
grc = document.getElementById('model_gt_bays[' + j + '].grc');
if (grc.value == "")
continue;
else
actvy = grc.value;
....
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yeah already tired but didn't work. compiler throwing issues, 'j' not found kind of errors.
but i got this thought of using AJAX JSON to connect to server and get the data which i was able to do but not sure on how to get the data from server to a array. what i have is:
$(document).ready(function()
{
var params = getURLParam().split('?');
$.post("ConnServer.htm", { url: getURLParam() , params: params[1]})
.done(function( data )
{
alert("req ok");
var url = $.parseJSON(data);
} );
});
in server request i have:
CREATE OBJECT oref
EXPORTING
DATA = lt_planord.
oref->serialize( ).
retplanords = oref->get_data( ).
not sure on how to get the retplanords results in the client script. any inputs on this please?
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.