Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Table control with Button

Former Member
0 Likes
3,367

Hi Frinds,

I have inserted a button in a table control.I am calling one more screen at the click of this Button. I need the line number of table control when I press this button. This button can be chossen randomly from top to bottom. I am not getting any idea how to add the logic for this.

Can you please help me to find out the solution for this.

Rgds, Krishan raheja.

1 ACCEPTED SOLUTION
Read only

Former Member
1,194

Hi,

You can do it 2 ways.

->One is, you can have a w/sel Column for your table control. Go to the Layout -> Screen Attributes of the Table Control -> Check the w/sel column and give a name.

->Correspondingly, declare a field of type char1 in your internal table declaration for the MARK field. Whenever you depress the MARK field on the table control, simultaneously, update the correspoding field in the internal table to 'X'. This way you can find the row number.

Or the most appropriate way would be to use GET CURSOR FIELD.



get cursor field vbak-vbeln line selectedline.

For further reference, you can check the link which has your same problem answered

[]

3 REPLIES 3
Read only

RahulKeshav
Active Contributor
0 Likes
1,194

Hi,

just add one more field to your internal table as MARK.

and in the property of the Table control give this column name in w/SelColumn.

a new code block will be added to your report automatically..

Once you click any row that MARK field will mark as X.

so just get the index of that row by reading it.

Thnx

Rahul

.

Read only

venkat_o
Active Contributor
0 Likes
1,194

Hi Krishnan, You need to use below GET statement under PAI event.

GET CURSOR FIELD MARA-MATNR LINE LINE_NO.
"Where MARA-MATNR is the column name of the table control 
"LINE_NO is the number of the row of the table control
Thanks Venkat.O

Read only

Former Member
1,195

Hi,

You can do it 2 ways.

->One is, you can have a w/sel Column for your table control. Go to the Layout -> Screen Attributes of the Table Control -> Check the w/sel column and give a name.

->Correspondingly, declare a field of type char1 in your internal table declaration for the MARK field. Whenever you depress the MARK field on the table control, simultaneously, update the correspoding field in the internal table to 'X'. This way you can find the row number.

Or the most appropriate way would be to use GET CURSOR FIELD.



get cursor field vbak-vbeln line selectedline.

For further reference, you can check the link which has your same problem answered

[]