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

Problem in picking row number in table control

Former Member
0 Likes
1,070

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

5 REPLIES 5
Read only

Former Member
0 Likes
726

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

Read only

0 Likes
726

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.

Read only

Former Member
0 Likes
726

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

Read only

Former Member
0 Likes
726

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.

Read only

Former Member
0 Likes
726

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.