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: 

rows selection in table control without mark disappearing after inputing

raffinkira
Participant
0 Kudos

I have a question about Table Control.


Firstly, the screen of my ABAP program contains a text field and a table control. When I input something contents into the text field as search condition to get data from database, the table control will display the corresponding data.


I have succeeded in data displaying in table control. The second step is to select rows in table control without selection mark disappearing after doing some kind of actions like pushing ‘enter’ key.

Followed is part of my coding.

Tables: sflight. ”table control field name in screen

Data g_select type c. “mark name in table control

In PBO:

Module select_data_from_db.

LOOP AT   it_xxx
INTO wa_xxx
WITH CONTROL TB_CL01.

   MODULE move_to_ sflight.

  1. ENDLOOP.

In PAI:

LOOP AT it_xxx.

  MODULE modify_internaltable.

  1. ENDLOOP.

Module move_to_sflight is:

g_select = wa_xxx-mark.
MOVE-CORRESPONDING wa_xxx to sflight.

Module modify_internaltable is:

wa_xxx-mark = g_select.
modify it_xxx from wa_xxx index tb_cl01-current_line.


The problem is “Module select_data_from_db” will refresh the it_xxx and make the mark ‘X’ clear. So marked selected rows will be unselected after inputing.


I tried to move “Module select_data_from_db” into PAI and settle this problem, but someone told me it is better to put “Module select_data_from_db” in the PBO.


I am just wondering a solution or some standard samples if existed.

Thank you guys.

1 ACCEPTED SOLUTION

former_member217544
Active Contributor
0 Kudos

Hi,

if the given solutions are not working. try this one:

In PAI pass it_xxx into another table it_xxx_temp.

Now when it comes to PBO, you compare both it_xxx and it_xxx_temp and update the mark field in it_xxx based on it_xxx_dummy table.

Regards,

Swarna

5 REPLIES 5

Former Member
0 Kudos

hi ming , just take your select indicator with in internal table

likes this , hope it will solve ur problem,...if not then let me know

Tables: sflight. ”table control field name in screen

************************

types : begin of ty_xxx,

types : include structure sflight.

types : g_select type c. “mark name in table control

type : end of ty_xxx.

data : it_xxx type standard table of ty_xxx initial size 0 with header line.

or you can take it separately as work ares.

*********************

In PBO:

Module select_data_from_db.

LOOP AT   it_xxx
INTO wa_xxx
WITH CONTROL TB_CL01.

   MODULE move_to_ sflight.

  1. ENDLOOP.

In PAI:LOOP AT it_xxx.  MODULE modify_internaltable.

  1. ENDLOOP.

Module move_to_sflight is:

g_select = wa_xxx-mark.
MOVE-CORRESPONDING wa_xxx to sflight.

Module modify_internaltable is:

wa_xxx-mark = g_select.
modify it_xxx from wa_xxx index tb_cl01-current_line.

0 Kudos

what have you changed?

I know the definition between ************************

0 Kudos

if you have specified the def. of internal table then

go to screen painter

double click on table control

it will open attribute of table control

in attribute there should we a tick on "w/selcolum" and  in the input field write " it_xxx-g_select"

Former Member
0 Kudos

Hi,

Try writing the code in events.find some examples in links.

In se11 Display table.

Go to Utilities ---> Table maintenence Generator

Then Environment ---> Modification ---->Events-->click on new entries.

Press F4 and select appropriate event when u want changes to be triggered and create Include  and write code in it.

check

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/8129f164-0a01-0010-2a8e-876528725...

http://****************/Tutorials/ABAP/TableMaintenance/events.htm

former_member217544
Active Contributor
0 Kudos

Hi,

if the given solutions are not working. try this one:

In PAI pass it_xxx into another table it_xxx_temp.

Now when it comes to PBO, you compare both it_xxx and it_xxx_temp and update the mark field in it_xxx based on it_xxx_dummy table.

Regards,

Swarna