Skip to Content
avatar image
Former Member

Personas 2.0: ME51N: How to set a value to all the cells of a column in a table?

Hi Personas 2.0 experts,

Here is the usecase: start tcode "ME51N", expend the icon "Item Overview" to display the table. I added a text field where user will type a free text. Then by pressing a button, I want the free text to be copied into all the lines of a column of the table, eg, into each line of column "Requested by".

Anyone know hwo to do this? I know how to get info from a table, but not write info into the table.

Thanks a lot!

Dong Zhu

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Jun 26, 2015 at 09:57 AM

    The problem, in Personas 2 at least, is the "all lines" bit. There's no way to build a loop in Personas 2 that can iterate over all the lines in a table to write to it. You can do this in Personas 3, but not in Personas 2.

    The best you can do is unroll the loop - assume a maximum number of rows in the table and write code like:

    if cell in row 1 exists

         paste into row 1

    if cell in row 2 exists

         paste into row 2

    if cell in row 3 exists

         paste into row 3

    ...

    It isn't pretty, but it should work if you pick a large enough number.

    If the requisition might have more rows than fit on the screen at once, and so you have to scroll to get to a 2nd or 3rd screenful, this gets more complex, and I'm not sure I'd recommend it.

    Again, Personas 3 can manage this. You don't have long to wait... :-)

    Steve.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Steve Rumsby

      Hi Steve,

      Thanks a lot! I guess I was doing just one cell first why I did not see any script recorded. Later I did a nit more action filling more cells and I got the script recorded.

      All in all it has to be a "static id" of the cell that cannot be variable. I have to apply the copy/paste to each specific cell with given row and column numbers.

      Set to answered.

      Dong