04-23-2009 9:14 AM
Hi,
I have created a screen with tabstrip having 3 tabs.The 3rd tab has the table control.I have created tabstrip and the table control using the tabstrip wizard and the table control wizard.When I run this program it gives me a dump but when I run the same program without using the table control, it runs fine.
Please suggest what could be the problem.
04-23-2009 9:21 AM
hi,
-->create sub screen with 100 with some screen number.
-->Create Table control..
--> append table control screen to Tab Strip.
-
. . . . > > > > see the example below
Scenario:
Screen 601 has a table control named CTRL_ANVSTED.
The table should be filled with records from the table zanvstedm
For this purpose you use an internal table called TBL_ANVSTED
Declare the table control
CONTROLS CTRL_ANVSTED TYPE TABLEVIEW USING SCREEN 601.
*Internal table used to hold data
DATA: TBL_ANVSTED LIKE ZANVSTEDM OCCURS 100 WITH HEADER LINE,
Flag for initial reading
Data: FLAG_INITIAL TYPE I VALUE 0.
PROCESS BEFORE OUTPUT.
*----
Read data into the table control and the internal table
*----
PF status etc.
MODULE INITIALIZE_601.
Read data from table anvstedm into internal table tbl_anvsted.
MODULE INIT_TBL_ANVSTED.
Fill control with data from ythe internal table
LOOP WITH CONTROL CTRL_ANVSTED.
MODULE FILL_CTRL_ANVSTED.
ENDLOOP.
MODULE INIT_TBL_ANVSTED OUTPUT.
Read data from table anvstedm into internal table tbl_anvsted.
IF FLAG_INITIAL = 0.
FLAG_INITIAL = 1.
SELECT * FROM ZANVSTEDM INTO TABLE TBL_ANVSTED.
ENDIF.
ENDMODULE.
MODULE FILL_CTRL_ANVSTED OUTPUT.
Fill control with data from the internal table
READ TABLE TBL_ANVSTED INDEX CTRL_ANVSTED-CURRENT_LINE.
IF SY-SUBRC NE 0.
EXIT FROM STEP-LOOP.
ENDIF.
ENDMODULE.
PROCESS AFTER INPUT.
Write changes in table control to internal table
LOOP WITH CONTROL CTRL_ANVSTED.
MODULE CTRL_ANVSTED.
ENDLOOP.
MODULE CTRL_ANVSTED INPUT.
Write changes in table control to internal table
MODIFY TBL_ANVSTED INDEX CTRL_ANVSTED-CURRENT_LINE.
ENDMODULE.
regards.
Aditya
04-23-2009 9:23 AM
what is the Dump message..? Don't post your dump, But analyzing the dump you can find the correction.
04-23-2009 9:38 AM
Is the table control referred is having correct name. Just check the table control wherever you have used