2009 Aug 04 7:29 AM
Hi,
I have a table control with 6 fields. In that 4 fields are normal text fields and the rest two are buttons. Now i am trying to get the row number whenever i click on the correespong button in that particular row but I am unable to get that particular. I am not getting that row number in CURRENT_LINE. How can i capture that row number whenver we click on button in that particular row.
Thanks in advance
Hi,
I have a table control with 6 fields. In that 4 fields are normal text fields and the rest two are buttons. Now i am trying to get the row number whenever i click on the correespong button in that particular row but I am unable to get that particular. I am not getting that row number in CURRENT_LINE. How can i capture that row number whenver we click on button in that particular row.
Thanks in advance
2009 Aug 04 8:06 AM
Hi,
Try using the Get Cursor key word take the help of key word documentation
or you can take the Row selector on the table control once that is selected you can get the sy-tabix.
if you had used the row selector then,
read table itab with key index = 'X' if sy-subrc is 0 this will give you the sy-tabix filled with the selected row number
Regards
Ramchander Rao.K
Edited by: Ramchander Krishnamraju on Aug 4, 2009 9:13 AM
2009 Aug 04 8:27 AM
I don't have row selector in this ITAB. I am just clicking that button in one particular row. But there is no option to retrieve that particular row.
2009 Aug 04 8:28 AM
Hai,
Use the Get Cursor statement, see the following example:
DATA: l_row type i.
DATA: l_field(10) type c.
GET CURSOR LINE l_row.
GET CURSOR FIELD l_field.
IF l_field = 'GTW_EQCRH-BUTTON1'.
read table gt_eqcrh index l_row into gtw_eqcrh. [gt_eqcrh is the itab and gtw_eqcrh is the work area]
ENDIF.
Best Regards,
rama
2009 Aug 04 2:56 PM
Hi,
I need to use check w/ selColumn in property sheet of Table control then you can check in PAI wihich row is select
PROCESS AFTER INPUT.
MODULE user_command_0110.
LOOP AT it_bapi3008_2_p.
MODULE modify_tcdata3.
ENDLOOP.
mODULE modify_tcdata3 INPUT.
IF sy-ucomm = 'PICK'.
IF sel = 'X'.
READ TABLE it_bapi3008_2_p INTO lw_bapi3008_2_p INDEX tc_data3-current_line .
IF sy-subrc = 0.
.
IF lw_bapi3008_2_p-db_cr_ind = 'H'.
lf_amount = lf_amount + lw_bapi3008_2_p-amount.
ELSE.
lf_amount = lf_amount - lw_bapi3008_2_p-amount.
ENDIF.
endif.
ENDIF.
ENDIF.
ENDMODULE.
with regards.
2009 Aug 05 7:53 AM
HI,
baleeqahmed
MODULE USER_COMMAND_0001 INPUT.
CASE SY-UCOMM.
WHEN 'BACK' OR 'UP' OR 'EXIT'.
LEAVE PROGRAM.
WHEN 'SEL'. "sel is function code of button.
GET CURSOR FIELD SCARR-CARRID LINE SELLINE. "SCARR-CARRID is a field in table control
SELINDEX = TC-TOP_LINE + SELLINE - 1.
READ TABLE ITAB INDEX SELINDEX.
ACT = ITAB-CARRID. " act is internal table I used
ANT = ITAB-CARRNAME.
ENDCASE.
ENDMODULE.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |