Application Development 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: 

Capture Row & Column Index in Table Control

ricky_shaw
Contributor
0 Kudos
331

Hello Experts,


I have a Table control with few columns and rows. One column is of type Radio Button.


1)How do i capture the click of radio button into my internal table rows?

2) I am using the GET CURSOR field v_field lines v_lines. In gv_field, i am seeing only half of the column name of my table control.

eg: I am seeing wa_time_s instead of wa_time_select.

Can someone please suggest.


Thanks

Ricky

4 REPLIES 4

Former Member
0 Kudos
98

Hi Ricky,

What is the length of 'v_field'? Did you try to increase it? Please post your code.

Regards,

Shravan

0 Kudos
98

Hi Perne,

Pls see my code below:

data :  gv_field(20) type c,
           gv_lines type i.

tc_slots : is a table control holding time slots data.

     get cursor field gv_field line gv_lines.

      gv_tabix = gv_lines + tc_slots-top_line - 1.

* Capture the TC_SLOTS index into Internal table index.

  read table it_slots into wa_slots index gv_tabix.

      if sy-subrc eq 0.

        wa_slots-select = 'X'.

        modify it_slots from wa_slots index gv_tabix.

      endif.

Can you also pls answer my Ques 1 below:

1)How do i capture the click of radio button into my internal table rows?   Is my code above right ?

0 Kudos
98

Hi Perne,

Pls see my code below:

data :  gv_field(20) type c,
           gv_lines type i.

tc_slots : is a table control holding time slots data.

     get cursor field gv_field line gv_lines.

      gv_tabix = gv_lines + tc_slots-top_line - 1.

* Capture the TC_SLOTS index into Internal table index.

  read table it_slots into wa_slots index gv_tabix.

      if sy-subrc eq 0.

        wa_slots-select = 'X'.

        modify it_slots from wa_slots index gv_tabix.

      endif.

Can you also pls answer my Ques 1 below:

1)How do i capture the click of radio button into my internal table rows?   Is my code above right ?

0 Kudos
98

Hi Ricky,

You need to assign a function code to the radio button. See attached screenshot. Whenever you click on the radio button PAI module will be triggered. The GET CURSOR can be used to find which field and row were selected. You may then set reset the radio-button in your internal table. Hope this answers your first question.

I still do not understand your other issue and cannot think of a case where that might occur. Check the names of the elements on the screen editor. Are you sure there is no mismatch?    

Regards,

Shravan