7 Replies Latest reply: Nov 18, 2015 5:48 AM by Gysbert Wassenaar RSS

    Add a column in a table from the script

      Hello,

       

      I have 2 tables which i read from SAP: EKKO and EKPO.

       

      EKKO contains the headers of the orders and EKPO contains all the lines in the orders.

       

      Here is the thing, i want to add a column in EKKO depending on the value of a column in EKPO.

       

      There is my EKKO table:

      OrderDate
      118.11.2015
      219.11.2015
      320.11.2015

       

      There is my EKPO table:

      OrderStatusQuantity
      1X1
      12
      2X3
      2X4
      2X5
      3X6

       

      And there is the EKKO table i'm looking for:

      OrderDateStatus
      118.11.2015
      219.11.2015X
      320.11.2015X

       

      For the same Order,

          If Status = 'X' for each EKPO line

                Add a column Status in EKKO with the value 'X'

       

      How can i do this please?

      This is how i loop the EKPO table but i have no idea how to do the rest...

       

      LET vNumRows=NoOfRows('EKPO');

      FOR i=1 to $(vNumRows)

        LET vStatus=Peek('Status',$(i));

          //do the stuff

      NEXT;

       

       

      Thank you very much for your responses,

      Best Regards,

      Loïc