‎2008 Nov 21 10:14 AM
Hi All,
i have a problem in table control.
when i scroll down or up data is not updating....
like....
i have a 10 lines....
first it displays 1-6 lines...
when i scroll down once ...
it should display 2-7th line as so on....
i think u understand my prob...
can anybody send me the sample code.....
‎2008 Nov 21 10:17 AM
hi ,
Just go through this standard program. Hope it helps you
RSDEMO02Thanks & Regards
‎2008 Nov 21 10:17 AM
Hi Ranjith,
i think you are directly appending the lines to the interanl table.
in PAI
loop at itab.
a module to pass the data from screen to program
module modify_tc.
endloop.
module modify_tc.
describe table itab lines tc-lines.
if tc-current_line > tc-lines.
append itab.
else.
modify itab.
endif.
endmodule.
regards
Ramchander Rao.K
‎2008 Nov 21 10:17 AM
hi ,
Just go through this standard program. Hope it helps you
RSDEMO02Thanks & Regards
‎2008 Nov 21 10:27 AM
Hi Ranjith,
when u append data in itab in pbo.
Use syntax after inserting data into itab.
DESCRIBE TABLE itabname LINES table_control_name-lines._
regards
Nishit Jjoshi
‎2008 Nov 21 10:29 AM
In PBO before Loop and End loop
Module Scroll.
In module write code:
DESCRIBE TABLE ITAB LINES TC-LINES.
"where ITAB is table being displayed in Table control named TC
‎2008 Nov 21 10:31 AM
Use mentioned code in PBO
tabdata ->table control name
tabcounter is the integer variable.
it_det is the internal table name
TABDATA-CURRENT_LINE = 1.
DESCRIBE TABLE IT_DET LINES TABCOUNTER.
IF TABCOUNTER = 0.
TABDATA-LINES = 100.
ELSE.
TABDATA-LINES = TABCOUNTER + 18.
ENDIF.
‎2009 Jan 10 7:36 AM
Hi,
try this code in your module pool..
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.
‎2009 Jan 10 8:03 AM
Hi,
Just look into the Tcode 'abapdocu' -> ABAP USER DIALOGS-> SCREENS-> COMPLEX SCREEN ELEMENTS-> TABLE CONTROL WITH SCROLLING
Follow the above path, there you find the code for table control scrolling
‎2009 Jan 10 9:31 AM
Hi ,
Do the following things in your PBO and PAI evet of screen .
PROCESS BEFORE OUTPUT.
module call_screen .
Module LINES .
LOOP AT IT_CIVIL WITH CONTROL TCvLAB CURSOR
TCvLAB-CURRENT_LINE .
ENDLOOP .
PROCESS AFTER INPUT.
chain .
field IT_CIVIL-CIVILIND .
field IT_CIVIL-NAME_TEXT1 .
field IT_CIVIL-SUBCONT1 .
field IT_CIVIL-NAME_TEXT2 .
field IT_CIVIL-SUNCONT2 .
module modify_civil_DATA .
endchain .
*****************************************************
modules :
IN PBO
MODULE LINE OUTPUT .
DESCRIBE IT_CIVIL LINES LIN .
TCvLAB-LINES = LIN .
ENDMODULE .
IN PAI :
MODULE MODIFY_CIVIL_DATA INPUT.
clear : wa_civ .
move-corresponding it_civil to wa_civ .
read table it_civil index 1 .
if sy-subrc = 0 .
modify it_civil index 1 from wa_civ .
else .
append it_civil .
clear : it_civil .
endif .
******************************
YOUR PROB WILL SOLVED .
PLEASE REWARDS IF SATISFIED .
REGARD'S
NILESH JAIN
‎2009 Jan 10 11:18 AM
Find the no of lines in your internal table using DESCRIBE TABLE itab LINES gv_lines.
Then in PBO, write
tc-lines = gv_lines.
where tc is your table control.
regards,
Jinson
‎2009 Jan 11 5:42 AM
Hi,
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.