cancel
Showing results for 
Search instead for 
Did you mean: 

WM6 SAPJco

Former Member
0 Kudos

Hi

I see in the agentry server, WorkOrderEditBapi source,

tbl.appendRow();

tbl.setRow(0);

and then starting to set vaues. appendrow will add the row at the end.

setrow for move the pointer to that row.

why in this code after appending , move the pointer to beginning  and start to set the values there.it will overrites the values right?

i don't get the point..help needed..

Regards,

Manivannan

Tags edited by: Michael Appleby

Accepted Solutions (0)

Answers (1)

Answers (1)

jason_latko
Advisor
Advisor
0 Kudos

Manivannan,

There probably aren't any rows yet in whatever table that is.  That is why it is safe to set it to the first row after the append.  Normally it goes like this:

tbl.appendRow();

tbl.setRow(tbl.getNumRows()-1);

You could change it if desired, but my guess is that there will only be the one row in the table in whatever routine is running there during the edit.

Jason Latko - Senior Product Developer at SAP

Former Member
0 Kudos

Thanks Jason for the reply.

My thought is we could write like as you suggest and it is one of the best way..but i see the out of box code,why it is written like that? is there any justification.And if only one row is there, we don't need to setRow..and appendRow will automatically move the pointer to there..