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: 

How to find out the selected line in the table control

Former Member
0 Kudos

Hi Guys,

i have a requirement like this. i have table control and the internal table for that table control as IT_CASE. this internal table i declared as CHECKBX, MATNR, QUANTITY. but when i am enter the values in the table control i am getting the values in MATNR and QUANTITY in the that internal table IT_CASE. but when iam selecting that that line iam not getting CHECKBOX as 'X' in that internal table IT_CASE. i declared the table control as CAS_CONTROL and in that i have given the "w/selcolum" property as IT_CASE-CHECKBOX. now i want to fill that CHECKBOX as 'X' inthat internal table IT_CASE whatever the lines we are selecting only for those lines i want to fill up as 'X' in that internal table.

Can you please suggest any one reg this.

Thanks in advance

Rahul

5 REPLIES 5

Former Member
0 Kudos

Hello body,

You can give a name such as 'SEL' in w/selcol and declare SEL as char1. Then follow the coading.

in TOP.

data: sel type c.

PROCESS AFTER INPUT.

user_command_0011.

loop at <Your internal table>.

module get_data.

endloop.

Inside Module get_data.

if sy-ucomm = <Your Fcode>

if sel = 'X'.

<Your internal table>-<Field for checkbox> = 'X'.

append <Your internal table>.

endif.

endif.

I think your issue is resolved.

Regards.

S Mahanta.

Former Member
0 Kudos

Hi,

you don't give

"w/selcolum" property as IT_CASE-CHECKBOX

you just give filed name only

"w/selcolum" property as CHECKBOX

Then chek in PAI event. is it getting or not inside the loop statment

some tips, don't use standard name like CHECKBOX

L.Velu

Former Member
0 Kudos

hi,

u can get selected table control line by

GET CURSOR LINE lin.

so u can use this line number to make checkbox field 'X'...

reward if useful....

Former Member
0 Kudos

Hi Rahul,

When you hit enter and execute after you modify the content in table control - table control module will be processed in PAI.

In that module you need write the below logic to modify the contents of the internal table then only changed lines will be updated in the internal table.

modify ITAB index TC-current_line.

ITAB is the internal table and TC is the table control name.

please let me know if you need more info.

regards,

Satya

Former Member
0 Kudos

In top-include.

data : BEGIN OF it_mara occurs 0,

check TYPE c,

matnr

quantity

end of it_mara.

PAI module.

MODULE modify_itab INPUT.

MODIFY it_mara INDEX tbc1-current_line.

ENDMODULE.

Note: Give the checkbox name in Table Control as

it_mara-check. Then definitely you will get.

Regards

Sandeep.