01-08-2009 4:01 PM
Hi abapers,
I have a trouble with my table control when i want to scroll down. My table control is for input data and when i fill the rows in my tc and then i scroll down, the data i filled is cleared. I have this in my PBO:
PROCESS BEFORE OUTPUT.
*&SPWIZARD: PBO FLOW LOGIC FOR TABLECONTROL 'TAB_CTRL_FICHA'
MODULE TAB_CTRL_FICHA_CHANGE_TC_ATTR.
*&SPWIZARD: MODULE TAB_CTRL_FICHA_CHANGE_COL_ATTR.
LOOP AT I_FICHA
WITH CONTROL TAB_CTRL_FICHA
CURSOR TAB_CTRL_FICHA-CURRENT_LINE.
*&SPWIZARD: MODULE TAB_CTRL_FICHA_CHANGE_FIELD_ATTR
MODULE G_CTRL_FICHA_GET_LINES.
ENDLOOP.
MODULE G_CTRL_FICHA_GET_LINES OUTPUT.
"G_TCTRL_LINES = SY-LOOPC.
TAB_CTRL_FICHA-LINES = 90.
TAB_CTRL_FICHA-V_SCROLL = 'X'.
ENDMODULE. " G_CTRL_FICHA_GET_LINES OUTPUT
Also this happen when i change of tab. How can i mantain the data in my table control when i scroll down or navigate on the tabs?
Regards
Danyel Ramírez..
Code Formatted by: Alvaro Tejada Galindo on Jan 8, 2009 11:01 AM
Edited by: Danyel Ramírez on Jan 8, 2009 5:04 PM
01-08-2009 4:57 PM
your table control is for input data
and when u fill the rows in tc and scroll down
pai is called
save the data in PAI and not in PBO
01-10-2009 6:58 AM
Hi,
try this code during code:
Hi,
Select PBO module status & click on that.
Just you write a code after normal code as:
TABLECONTROLNAME-LINES = SY-DBCNT.(this will enable the table control vertical scroll bar.)
Normal code before above statement is(for eg.),
MOVE WA-EBELN TO EKKO-EBELN.
MOVE WA-AEDAT TO EKKO-AEDAT.
Regards,
BBR.
01-10-2009 2:10 PM
Follow the below the code snippet... table_control is the name of the TableControl
module STATUS_1000 output.
SET PF-STATUS 'BEN_MENU'.
SET TITLEBAR 'xxx'.
DATA: lin type i.
PERFORM AUTO_EMPID.
DESCRIBE TABLE it_all LINES lin.
table_control-lines = lin.
endmodule. " STATUS_1000 OUTPUT
01-10-2009 5:59 PM
hi,
Try include this code in PAI
loop at itab.
module modify_tab
endloop
in program
module modify_tab
describe table itab lines tc-liens
if tc-current_line > tc-lines
append itab
else
modify itab index tc-current_line
endmodule
01-11-2009 5:20 AM
Hi Danyel,
Use this code, its working:-
Take the names of the input/output fields as work_area-field_name.
What you need to do exactly is read the values from internal table into table control in PBO of the screen after modifying them in PAI.
At Screen Logic:-
PROCESS BEFORE OUTPUT.
MODULE status_8002. "for pf-status
LOOP WITH CONTROL po_tab. "po_tab is name of table control
MODULE pass_data. "to pass data into table control from internal table
ENDLOOP.
PROCESS AFTER INPUT.
MODULE user_command_8002. "to handle other user commands (back and exit)
LOOP WITH CONTROL po_tab. "po_tab is name of table control
MODULE modify_data. "to modify data from table control into internal table
ENDLOOP.
In PBO,
*&---------------------------------------------------------------------*
*& Module PASS_DATA OUTPUT
*&---------------------------------------------------------------------*
MODULE pass_data OUTPUT.
READ TABLE it_ekpo into wa_ekpo INDEX po_tab-current_line.
" read data from internal table into table control
DATA : line_count TYPE i.
DESCRIBE TABLE it_ekpo
LINES line_count. "count number of records in internal table
po_tab-lines = line_count + 5.
" take 5 more lines than the number of records in internal table
ENDMODULE. " PASS_DATA OUTPUT
"it_ekpo is internal table and wa_ekpo is the work area
In PAI,
*&---------------------------------------------------------------------*
*& Module MODIFY_DATA INPUT
*&---------------------------------------------------------------------*
MODULE MODIFY_DATA INPUT.
MODIFY IT_EKPO INDEX PO_TAB-CURRENT_LINE FROM WA_EKPO.
"modify records from table control into the internal table
ENDMODULE. " MODIFY_DATA INPUT
Hope this solves your problem.
Thanks & Regards,
Tarun Gambhir.