‎2010 Apr 19 9:58 AM
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.
‎2010 Apr 19 10:34 AM
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.
‎2010 Apr 19 12:07 PM
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
‎2010 Apr 20 6:28 AM
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.
‎2010 Apr 20 7:28 AM
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
‎2010 Apr 21 12:00 PM
Hi Karthi,
Is your problem solved? If not paste your PAI and PBO code
Regards,
Swarna Munukoti