03-16-2007 11:24 AM
Hello guys
I have created a Table Control and when I run the program, it displays the data.
When I scroll from left to right or right to left, everything works as expected.
However, when I scroll up and down the top most rows disappear and I can't see the
first few top rows. However this is affecting just the screen and not the actual table.
If I quit and restart the transaction it shows up again normally until I again scroll up and down.
Has anyone seen this problem. Is it a bug or is there some thing I am missing. I would appreciate your feedback.
Thanks
Ram
03-16-2007 1:45 PM
Hi Ram ,
Remove the Tick under <b>Vertical</b> check box under RESIZING option
in Table Control attributes.It is working.
03-16-2007 11:32 AM
03-16-2007 1:34 PM
Hi Navin
Thanks for the response. Please find the code below
=======Main Module Pool program (SE38)===============
&----
*& Module pool ZWM_ZWMSCHED_TABLECONTROL *
*& *
&----
*& *
*& *
&----
**----
*
This program lets the user update the ZWMSCHED table.
*
Initial Coding:
03/14/2007 by TFConsulting
*
Modification Log:
User:
Data:
Correction:
Purpose:
*
**----
INCLUDE ZWM_ZWMSCHED_TABLECONTROL_TOP . "
INCLUDE ZWM_ZWMSCHED_TABLECONTROL_O01 . *
INCLUDE ZWM_ZWMSCHED_TABLECONTROL_I01 . *
INCLUDE ZWM_ZWMSCHED_TABLECONTROL_F01 . *
*&spwizard: type for the data of tablecontrol 'TC_ZWMSCHED'
types: begin of t_TC_ZWMSCHED,
LGNUM like ZWMSCHED-LGNUM,
CARRIER like ZWMSCHED-CARRIER,
CUSTNAME like ZWMSCHED-CUSTNAME,
CITY like ZWMSCHED-CITY,
STATE like ZWMSCHED-STATE,
ZIP like ZWMSCHED-ZIP,
QTY like ZWMSCHED-QTY,
VBELN like ZWMSCHED-VBELN,
INCO like ZWMSCHED-INCO,
WT like ZWMSCHED-WT,
VOLUMN like ZWMSCHED-VOLUMN,
EQUIPMENT like ZWMSCHED-EQUIPMENT,
PICK_STAT like ZWMSCHED-PICK_STAT,
LOAD_STAT like ZWMSCHED-LOAD_STAT,
BOL_STAT like ZWMSCHED-BOL_STAT,
GM_STATUS like ZWMSCHED-GM_STATUS,
LOAD_SEQ like ZWMSCHED-LOAD_SEQ,
WAVENUM like ZWMSCHED-WAVENUM,
DOOR like ZWMSCHED-DOOR,
SHIP_DATE like ZWMSCHED-SHIP_DATE,
MBOL like ZWMSCHED-MBOL,
SEAL like ZWMSCHED-SEAL,
NOTES like ZWMSCHED-NOTES,
end of t_TC_ZWMSCHED.
*&spwizard: internal table for tablecontrol 'TC_ZWMSCHED'
data: g_TC_ZWMSCHED_itab type t_TC_ZWMSCHED occurs 0,
g_TC_ZWMSCHED_wa type t_TC_ZWMSCHED. "work area
data: g_TC_ZWMSCHED_copied. "copy flag
*&spwizard: declaration of tablecontrol 'TC_ZWMSCHED' itself
controls: TC_ZWMSCHED type tableview using screen 0100.
*&spwizard: output module for tc 'TC_ZWMSCHED'. do not change this line!
*&spwizard: copy ddic-table to itab
module TC_ZWMSCHED_init output.
if g_TC_ZWMSCHED_copied is initial.
*&spwizard: copy ddic-table 'ZWMSCHED'
*&spwizard: into internal table 'g_TC_ZWMSCHED_itab'
select * from ZWMSCHED
into corresponding fields
of table g_TC_ZWMSCHED_itab.
g_TC_ZWMSCHED_copied = 'X'.
sort g_TC_ZWMSCHED_itab ascending by lgnum vbeln.
refresh control 'TC_ZWMSCHED' from screen '0100'.
endif.
endmodule.
*&spwizard: output module for tc 'TC_ZWMSCHED'. do not change this line!
*&spwizard: move itab to dynpro
module TC_ZWMSCHED_move output.
move-corresponding g_TC_ZWMSCHED_wa to ZWMSCHED.
endmodule.
&----
*& Module modify_inttab INPUT
&----
text
----
MODULE modify_inttab INPUT.
modify g_TC_ZWMSCHED_itab from zwmsched index
tc_zwmsched-current_line.
sort g_TC_ZWMSCHED_itab ascending by lgnum vbeln.
modify g_TC_ZWMSCHED_itab from g_TC_ZWMSCHED_wa index
tc_zwmsched-current_line.
ENDMODULE. " modify_inttab INPUT
&----
*& Module STATUS_0100 OUTPUT
&----
text
----
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'STATUS1'.
SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_0100 OUTPUT
&----
*& Module USER_COMMAND_0100 INPUT
&----
text
----
MODULE USER_COMMAND_0100 INPUT.
FCODE2 = FCODE.
CLEAR FCODE.
CASE FCODE2.
when 'SAVE'.
********************************************
Update the changes made by the user in *
the table control fields. *
********************************************
loop at g_tc_zwmsched_itab into g_tc_zwmsched_wa.
update ZWMSCHED
set ship_date = g_tc_zwmsched_wa-ship_date
equipment = g_tc_zwmsched_wa-equipment
door = g_tc_zwmsched_wa-door
wavenum = g_tc_zwmsched_wa-wavenum
load_seq = g_tc_zwmsched_wa-load_seq
notes = g_tc_zwmsched_wa-notes
where
lgnum = g_tc_zwmsched_wa-lgnum and
vbeln = g_tc_zwmsched_wa-vbeln.
endloop.
LEAVE PROGRAM.
when 'EXIT'.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
TITLEBAR = 'EXIT? '
DIAGNOSE_OBJECT = ' '
TEXT_QUESTION = 'EXIT THIS TRANSACTION?'
TEXT_BUTTON_1 = 'Yes'
ICON_BUTTON_1 = ' '
TEXT_BUTTON_2 = 'No'
ICON_BUTTON_2 = ' '
DEFAULT_BUTTON = '1'
DISPLAY_CANCEL_BUTTON = 'X'
USERDEFINED_F1_HELP = ' '
START_COLUMN = 25
START_ROW = 6
POPUP_TYPE =
IMPORTING
ANSWER = p_answer.
if p_answer = '1'.
LEAVE PROGRAM.
else.
call screen 100.
endif.
when others.
call screen 100.
endcase.
ENDMODULE. " USER_COMMAND_0100 INPUT
=========================================================
===============CODE in SE51 follows======================
PROCESS BEFORE OUTPUT.
module TC_ZWMSCHED_init.
loop at g_TC_ZWMSCHED_itab
into g_TC_ZWMSCHED_wa
with control TC_ZWMSCHED
cursor TC_ZWMSCHED-current_line.
module TC_ZWMSCHED_move.
endloop.
MODULE STATUS_0100.
PROCESS AFTER INPUT.
loop at g_TC_ZWMSCHED_itab.
module modify_inttab.
endloop.
MODULE USER_COMMAND_0100.
03-16-2007 11:40 AM
Hi Ram,
In the TABLE Control you have to do coding with loop in PBO and PAI... In the mdoule which is inside loop of PBO you have to count number of records.. with following code...
1. LOOP AT <internal table> CURSOR <scroll-var>
[WITH CONTROL <table-control> ]
[FROM <line1> ] [TO <line2> ].
...<actions>...
ENDLOOP.
You have to specify FROM LINE1 and TO LINE2. Line numbers .... or
OR
2. Use following logic to REad lines...
PROCESS BEFORE OUTPUT.
MODULE status_0100.
LOOP WITH CONTROL flights.
MODULE fill_table_control.
ENDLOOP.
PROCESS AFTER INPUT.
MODULE cancel AT EXIT-COMMAND.
LOOP WITH CONTROL flights.
MODULE read_table_control.
ENDLOOP.
MODULE fill_table_control OUTPUT.
READ TABLE itab INTO demo_conn INDEX flights-current_line.
ENDMODULE.
MODULE read_table_control INPUT.
lines = sy-loopc.
MODIFY itab FROM demo_conn INDEX flights-current_line.
ENDMODULE.
Please check. and reply.
Hope this will solve u r problem and if it solves....
Please give points..
Cheers : )
DARSHAN PATEL
03-16-2007 1:39 PM
Darshan
I tried the changes you suggested and still i see the same problem. Is there any other suggestions that I can try
Thanks a lot for ur response. I appreciate it
Ram
03-16-2007 1:45 PM
Hi Ram ,
Remove the Tick under <b>Vertical</b> check box under RESIZING option
in Table Control attributes.It is working.
03-16-2007 1:55 PM
Hi Vigneswaran
Your suggestion did the trick.
Thanks to everyone who took time to help me out. I appreciate it a lot.
Thanks
Ram
12-03-2007 6:29 AM
HI RAM,
i have the same issue,when i scroll down my top records are disappears .i am not clear what to change i changed the attributes of table control resizing vertical still the record dissapears,can u please help me what to do...