Author Topic: Fetching Values from Inputfields using Positioning  (Read 4843 times)

Sai Siddhartha

  • GuiXT Forum
  • Newbie
  • *
  • Posts: 47
    • View Profile
Fetching Values from Inputfields using Positioning
« on: March 15, 2018, 06:18:41 AM »
Purpose:
Fetching values from inputfields using there positioning on screen.
This is useful in case where screen has multiple fields with same label technical name.

Below example demonstrates the fetching of values using second screen of 'MB1B' transaction.
This screen has multiple fields with same technical name under 'Items' groupbox.

-Create script file  SAPMM07M.E0421.sjs with below code.

LiquidUI Code:
///////////////////////////////////// SAPMM07M.E0421.sjs ////////////////////////////////////
   z_mat = [];
   z_qty = [];
   i = 0;
   while(true){
      row = 6+i;
      set('V[z_tmp_mat]','&#['+row+',8]');
      z_mat.push(z_tmp_mat);
      set('V[z_temp_qty]','&#['+row+',27]');
      z_qty.push(z_temp_qty);
      i++;
      if(isBlank(z_tmp_mat)){
         goto END;
      }
   }
   END:;
   println('-----------materails-------'+z_mat);
   println('-----------quantity-------'+z_qty);

-   Navigate to 'Enter Transfer Posting: New Items' screen in 'MB1B' transaction and enter some data into fields under labels 'Material' and 'Quantity' inside 'Items' group box.
-   Refresh the screen by entering '?' in command field it will run the code and fetch values entered into arrays specified.
-   Values assigned to arrays will be displayed on Cornelius window.