‎2009 Aug 25 7:37 AM
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.
‎2009 Aug 25 7:56 AM
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
‎2009 Aug 25 7:45 AM
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
.
‎2009 Aug 25 7:49 AM
Hi Krishnan,
You need to use below GET statement under PAI event.
Thanks
Venkat.OGET 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
‎2009 Aug 25 7:56 AM
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