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

Module pool table control

Former Member
0 Likes
1,977

Hi All,

I have created a table control. When i select the rows and scroll down, the rows i have selected are getting un-selected. But the selected rows are getting printed according to the requirement. Only thing is it is getting un-seelcted once we scroll up/down.

But while debugging i have found this values.

TCCUSTOM-LINE_SELECTOR = 'X'.

TCCUSTOM-LINE_SEL_MODE = '2'.

this is working properly. I dont know what could be the reason for the problem.

Please help me on this.

Thanks,

Karthi.

5 REPLIES 5
Read only

Former Member
0 Likes
1,450

Hi,

Really not able to figure it out what exactly your code was

but u can check this example program demo_dynpro_tabcont_loop in se51.

Regards and Best wishes.

Read only

Former Member
0 Likes
1,450

Hi,

In module pool there is a option with Select-Field ( SEL-Mode)where you can declare a variable(like flag) in ur internal table and pass it to the screen,so whenever u select the Corresponding row, you have to update in internal table as 'X'.

No need for the following..

TCCUSTOM-LINE_SELECTOR = 'X'.

TCCUSTOM-LINE_SEL_MODE = '2'.

Regards

Arbind

Read only

Former Member
0 Likes
1,450

Hi,

In the Table Control, and PAI event is triggered everytime you scroll up or down. So, in the Table Control Wizard you need to select the option with Checkbox. This will take care of automatically mapping the marked line from the UI to the PAI event to the internal Table to the PBO event before finally calling the Table again. So, you can debug the code once and can have a look the area where the marks are not saved.

Have a look at the Demo Table Control programs. Debug them carefully. And also try using the Wizard to create the Table Control.

DEMO_DYNPRO_TABCONT_LOOP Table Control with LOOP - ENDLOOP

DEMO_DYNPRO_TABCONT_LOOP_AT Table Control with LOOP AT ITAB

DEMO_DYNPRO_TABLE_CONTROL_1 Table Control with LOOP Statement

DEMO_DYNPRO_TABLE_CONTROL_2 Table Control with LOOP AT ITAB

Hope this will help.

Thanks,

Samantak.

Read only

Former Member
0 Likes
1,450

HI,

"In TOP include " This is Tested Code
DATA : BEGIN OF itab OCCURS 0,
    mark.
        INCLUDE STRUCTURE sflight." WITH HEADER LINE.
DATA : END OF itab.
"In Flow Logic,
PROCESS BEFORE OUTPUT.
 MODULE STATUS_0100.
  LOOP AT itab WITH CONTROL tc.
  ENDLOOP.

PROCESS AFTER INPUT.
module clear_selection. " To Clear Eerlier Selection
  LOOP AT itab.
    MODULE GET_CURSOR. " Add this one to Pass the Selected Rows to your Program Internal Table
  ENDLOOP.
 MODULE USER_COMMAND_0100.

" In Program
MODULE get_cursor INPUT.
  DESCRIBE TABLE itab LINES tc-lines.
  IF tc-lines >= tc-current_line.
    MODIFY itab INDEX tc-current_line. " This will modify the ITAB with the Selected Rows in Progarm ITAB
  ELSE.
  ENDIF.
ENDMODULE.                 " GET_CURSOR  INPUT
" In PBO

MODULE status_0100 OUTPUT.
  SET PF-STATUS 'ABC'.
*  SET TITLEBAR 'xxx'.
  IF first IS INITIAL. " Incase you are selecting the Data in PBO this needs to be restricted only Once
    first = 'X'.
    SELECT * FROM sflight INTO CORRESPONDING FIELDS OF TABLE itab.
  ENDIF.
  SORT itab BY carrid connid.
  DELETE ADJACENT DUPLICATES FROM itab COMPARING carrid connid.
  SET CURSOR FIELD 'ITAB-CARRID' LINE line.
ENDMODULE.                 " STATUS_0100  OUTPUT
MODULE clear_selection INPUT. " OPtionally You can Add this to clear earler Selection
  LOOP AT itab.
    IF itab-mark = 'X'.
      CLEAR itab-mark.
      MODIFY itab INDEX sy-tabix.
    ENDIF.
  ENDLOOP.
ENDMODULE.

Cheeerz

Ram

Read only

former_member217544
Active Contributor
0 Likes
1,450

Hi Karthi,

Is your problem solved? If not paste your PAI and PBO code

Regards,

Swarna Munukoti