Skip to Content

Reading ABAP internal table in JS with index


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.



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?

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Mar 30, 2015 at 02:11 PM

    try something like this:

    var grc;

    for (var j=0; ....


    grc = document.getElementById('model_gt_bays[' + j + '].grc');

    if (grc.value == "")



    actvy = grc.value;



    Add a comment
    10|10000 characters needed characters exceeded

    • 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:



      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


      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?

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.