‎2008 Feb 22 12:15 PM
doubt while doing screen painter.
first i created a table.i need to view thw table contents using screen painter.
for that i have created program,message type,transaction.
using se51 i copied the table contents and pasted it in screen.then i used some push buttons for save,exit,display
then i gone to transaction to view the table contents.but there it is not getting displayed.
so please u explain how to solve that problem.
‎2008 Feb 22 12:26 PM
hi,
For this u can use the table control. Below is the procedure to create a table control. U can display the contents od the database table in table form itself.
TABLE CONTROL COMPONENTS:
-
Table Control component is used to view the table records and if needed, we can directly modify table records and
update the database table using table control.
Here, the records can be viewed in rows and columns format separated by horizontal and vertical lines.
SYNTAX:
-
CONTROLS <table_Control_name> TYPE TABLEVIEW USING SCREEN <MPP_screen_number>
CONTROLS statement is used to create a memory space area for table control component in AS.
TABLEVIEW is a data type for table control component.
SCREEN NUMBER should be specified to make the system know where the table control was physically created.
Navigations to create TABLE CONTROL COMPONENT:
-
Create MPP program -> In TOP INCLUDE FILE, write the following code:
DATA ITAB LIKE KNA1 OCCURS 0 WITH HEADER LINE.
CONTROLS TABCTRL TYPE TABLEVIEW USING SCREEN '123'.
DATA CUR TYPE I.
Save -> Activate.
Create a Normal screen (123) -> Drag and drop TABLE CONTROL component from application toolbar -> Specify its name in
attributes box -> Specify title if necessary -> Select HORIZONTAL and VERTICAL SEPARATORS checkbox -> If needed,
select COLUMN and ROW selection radiobuttons -> Click on Dictionary/Program Fields from Appn. Toolbar ->
Specify internal table name specified in top include file -> Click on 'GET FROM PROGRAM' pushbutton ->
Choose required fields -> Click on continue -> Place the fields in table control component ->
Add labels for each fields -> Create two pushbuttons (FETCH, EXIT) -> Save -> Flow Logic.
In PAI module, write following code:
CASE SY-UCOMM.
WHEN 'FETCH'.
SELECT * FROM KNA1 INTO TABLE ITAB.
TABCTRL-LINES = SY-DBCNT.
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDCASE.
In Flow Logic editor, write following code:
PROCESS BEFORE OUTPUT.
MODULE STATUS_0123.
LOOP AT ITAB CURSOR CUR WITH CONTROL TABCTRL.
ENDLOOP.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_0123.
LOOP AT ITAB.
ENDLOOP.
Here, LOOP AT ITAB-ENDLOOP statement in PBO event is used to fetch the records and insert into table control component.
CURSOR statement is used to make use of the cursor in table control component
whenever we try to select a particular field and modify it.
LOOP AT ITAB-ENDLOOP statement in PAI event is used to make necessary modifications
to the database table from table control component.
Create Tcode -> Execute.
Hope this helps u,
Regards,
Arunsri.
‎2008 Feb 22 12:32 PM
Hi Revathi,
Can u explain me where you are getting the error.
Thanks & regards,
shiva
‎2008 Feb 26 3:51 AM
Hello friend,
i need to view the table contents in screen painter
so first i created table .
on going to se38 i created module pool program.after checking it there is no error.
then i went to se51.in that i clicked get data from dictionary fields and placed the table in screen painter.i have creted employee table,which contains id,name,address,phoneno
so u explain the method of after getting data from dictionary fields how to place it in screen painter.
also i have created transaction also.
thanks
revathy
‎2008 Feb 22 12:46 PM
hi
good
go through these links, hope these would help you to solve your problem.
http://help.sap.com/saphelp_sm32/helpdata/en/6d/150d67da1011d3963800a0c94260a5/content.htm
http://help.sap.com/saphelp_sm32/helpdata/en/d1/802338454211d189710000e8322d00/content.htm
thanks
mrutyun^