cancel
Showing results for 
Search instead for 
Did you mean: 

How to access value of selected row in screen personas 3.0

Former Member
0 Kudos

screen-perssonas-30.jpg

Hello Experts,

I have requirement where i have to create a button on that button i need to do recording of ME23n tcode. By doing hard coding its working. But requirement is when user selects particular row and hit button than it has to show value of g/l account on newly created text.

How to write code to select purchase order value from that selected row and then ill pass it to ME23n recording.

Accepted Solutions (0)

Answers (1)

Answers (1)

Thomas_Mangler
Active Participant
0 Kudos

Hi,

try it like this

var table = session.findById("wnd[0]/usr/##########");		 // yout table
colname = table.getColumnName(0); 	             // Name of the first column (1 for the second....)
selrow = table.selectedRowsAbsolute;  				 // Numbmer of selected row > String 
selrownum = Number(selrow);  					 // Number of selected row > value
cellvalue = table.getCellValue(selrownum, colname);	         // cell content
console.log(cellvalue);
Former Member
0 Kudos

Thanks.. i'll try this..

Former Member
0 Kudos

Hello Thomas,

Please find the attached word document in which i have show how i am selecting the row and i need purchase order column value of selected row.

Kindly help me out to achieve this.screen-perosonas-30-error-1.jpgscreen-personas-error.jpg

Thanks for your kind support.

Regards,

Mahaveer Mehta

Thomas_Mangler
Active Participant
0 Kudos

Hello Mahaveer,

the question is why you get back a negative col-Number in your Script?
Perhaps this is a spezial table. Unfortunately i have no User Data for ME23N and so i can't test it.

You can try to use table.selectedRows instead of table.selectedRowsAbsolute. But i don't think that there is another result.

Regards,
Thomas