‎2006 Jun 12 9:19 PM
Hello,
I'm trying to use a pushbutton into a table control.
Doing this generate's one push button by table row.
My problem is I can't determine on which table row the button was pressed from the screen's PAI.
Could someone help me please?
Message was edited by: Eric Meunier
‎2006 Jun 12 9:39 PM
Use this logic in the PAI
get cursor field cursor-cursorfield
offset cursor-pos_cucol
line cursor-pos_curow.
Cursor is defined as follows
types: begin of cursor_type,
next_cucol type sy-cucol,
next_curow type sy-curow,
cursorfield(30),
pos_cucol type sy-cucol,
pos_curow type sy-curow,
end of cursor_type.
data: cursor type cursor_type.But you can use any field. 'GET CURSOR' is the key statement for you.
‎2006 Jun 12 9:39 PM
Use this logic in the PAI
get cursor field cursor-cursorfield
offset cursor-pos_cucol
line cursor-pos_curow.
Cursor is defined as follows
types: begin of cursor_type,
next_cucol type sy-cucol,
next_curow type sy-curow,
cursorfield(30),
pos_cucol type sy-cucol,
pos_curow type sy-curow,
end of cursor_type.
data: cursor type cursor_type.But you can use any field. 'GET CURSOR' is the key statement for you.
‎2006 Jun 13 4:46 AM
Hello Eric,
To select rows on the Table Control there is one procedure.
Please follow these steps.
<b>1</b>.
Declare ur Internal table which u want to display on Table control like this.
BEGIN OF i_it0002 OCCURS 0,
Mark type c,<b>This is the field to capture the selected row</b> .
applnno(10),
vorna TYPE pa0002-vorna,
nachn TYPE pa0002-nachn,
rufnm TYPE pa0002-rufnm,
gbdat LIKE pa0002-gbdat,
gbort TYPE pa0002-gbort,
END OF i_it0002,
<b>2</b>.
Go to ur Screen=>Click on LAYOUT=>Double click on ur Table Control
In Table control Attributes u see
Check box for <b>w/SelColumn</b> .Check that checkbox and give i_it0002-mark in the i/o field.
<b>3</b>.
Come back and see ur Table control ,u will see Pushbuttons .
<b>4</b>.
Once u select any row on table control, mark field is 'X'.
<b>5</b>.
Then modify ur Internal table like this .
LOOP AT i_it0002 .
CHAIN.
FIELD i_it0002-applnno.
FIELD i_it0002-vorna.
FIELD i_it0002-nachn.
FIELD i_it0002-rufnm.
FIELD i_it0002-gbdat.
FIELD i_it0002-gbort module check_gbort.
FIELD i_it0002-natio.
FIELD i_it0002-kitxt.
FIELD i_it0002-gesc2.
FIELD i_it0002-fatxt module validate_fatxt.
FIELD i_it0002-famdt module validate_famdt..
FIELD i_it0002-anzkd.
FIELD i_it0002-racky ." MODULE check_racky.
FIELD i_it0002-milsa .
FIELD i_it0002-mail_id MODULE check_mail.
FIELD i_it0002-ictyp MODULE capture_field.
FIELD i_it0002-icnum MODULE check_icnum.
FIELD i_it0002-check.
MODULE tabca_modify ON CHAIN-REQUEST.
ENDCHAIN.
FIELD i_it0002-mark
MODULE tabca_mark ON REQUEST.
ENDLOOP.
MODULE tabca_modify INPUT.
CLEAR without_sel_save.
MODIFY i_it0002 FROM i_it0002 INDEX tabca-current_line.
IF i_it0002-mark = 'X'.
without_sel_save = 'X'.
ENDIF.
ENDMODULE. " tabca_modify INPUT
<b>
6</b>.
Based on the mark field in the ITAB ,u can do further modifications.
I believe that it helps u .
<b>Thanks,
Venkat.O</b>
‎2006 Jun 13 6:48 PM
Thanks Guys, very helpfull to both of you. Srinivas resolved my problem.
‎2006 Jun 13 7:36 PM
Please close the thread once your question is solved. It helps if others have the same problem.
‎2006 Jun 13 8:59 PM
‎2006 Jun 13 9:02 PM
‎2006 Jun 13 9:05 PM
For some reason, even though you selected 'Problem Solved' button, it is not showing the status as 'Answered'. Instead it is still showing 'This is marked as a question'. It is normal that sometimes these things don't work and then they correct themselves after a while.
So you don't have to worry.