‎2007 Jul 27 10:41 AM
HI Gurus,
i have to following requirement,
i have to make a screen in which there would be four fields
name xxx
age x
date xx.xx.xx
time xx xx xx
the screen fields are to by filled by the user at the run time and this data should be saved in the data base table(say ztable)
so as far i have understood i need to create a screen with a table control and a database table to save the data of the table control (after the user press save buttom)
please help me how to create a table control
and also
help me with the logic of calling the screen(this screen with table control)
also the logic of save butoom too
please help as soon as possible
points will be surely awarded ..
thanks in advance
anuj
‎2007 Jul 27 10:42 AM
hi
just refer to the link below
http://www.sapmaterial.com/tablecontrol_sap.html
<b>step by step procedure with screen shots</b>
regards
ravish
<b>plz dont forget to reward points if helpful</b>
‎2007 Jul 27 10:44 AM
This report wil help u
its quite simple
DEMO_DYNPRO_TABCONT_LOOP
‎2007 Jul 27 10:43 AM
use this eg to your requirement
PROGRAM YTABLEDML .
TABLES : KNA1.
DATA : ITAB LIKE KNA1 OCCURS 0 WITH HEADER LINE.
CONTROLS : VCONTROL TYPE TABLEVIEW USING SCREEN '100'.
MODULE USER_COMMAND_0100 INPUT.
CASE SY-UCOMM.
WHEN 'INSERT'.
MOVE KNA1 TO ITAB.
APPEND ITAB.
INSERT INTO KNA1 VALUES ITAB.
IF SY-SUBRC = 0.
MESSAGE I000(0) WITH 'INSERTED'.
ELSE.
MESSAGE E001(0) WITH 'NOTINSERTED'.
ENDIF.
WHEN 'UPDATE'.
MOVE KNA1 TO ITAB.
APPEND ITAB.
UPDATE KNA1 FROM TABLE ITAB.
IF SY-SUBRC = 0.
MESSAGE I000(0) WITH 'UPDATED'.
ELSE.
MESSAGE E001(0) WITH 'NOTUPDATED'.
ENDIF.
WHEN 'DELETE'.
MOVE KNA1 TO ITAB.
APPEND ITAB.
DELETE FROM KNA1 WHERE KUNNR = ITAB-KUNNR.
MESSAGE I000(0) WITH 'DELETED'.
IF SY-SUBRC = 0.
ELSE.
MESSAGE E001(0) WITH 'NOTDELETED'.
ENDIF.
ENDCASE.
ENDMODULE.
MODULE USER_EXIT INPUT.
CASE SY-UCOMM.
WHEN 'EXIT'.
CALL TRANSACTION 'SE38'.
ENDCASE.
ENDMODULE.
***************************************************
*PROCESS BEFORE OUTPUT.
*LOOP WITH CONTROL VCONTROL.
*ENDLOOP.
MODULE STATUS_0100.
*
*
*PROCESS AFTER INPUT.
*LOOP WITH CONTROL VCONTROL.
MODULE USER_COMMAND_0100.
ENDLOOP.
*
*MODULE USER_EXIT.
TCODE IS YDMLTAB.
‎2007 Jul 27 10:46 AM
Hi Anuj,
Give me your mail Id . I will give you a small PPT on creation of table control..
regards
Sourabh Verma
‎2007 Jul 27 11:14 AM
‎2007 Jul 27 11:25 AM
Hi Anuj,
I have mailed on your mail ID . Please check and confirm.
Regards
Sourabh Verma
‎2007 Jul 27 11:17 AM
Hi,
Look at the below demo programs in SAP
DEMO_DYNPRO_TABLE_CONTROL_1
DEMO_DYNPRO_TABLE_CONTROL_2
Regards
Sudheer
‎2007 Jul 27 11:32 AM
hi gurus,
i have seen my of ur sugeested link and demo codes
in tht the data or records are selected from a table (database table)
i need to sotre the data or records in the the data base table(ztable)
please help me with the same as soon as possible
thanks
anuj
‎2007 Jul 27 11:36 AM
Hi Anuj,
Use Update statement to store the records in the data base table..
Regards
Sourabh Verma
‎2007 Jul 27 11:40 AM
modify the demo code like this
MODULE user_command_0100 INPUT.
save_ok = ok_code.
CLEAR ok_code.
CASE save_ok.
WHEN 'SAVE'.
insert <dbtab> from table itab.
ENDCASE.
ENDMODULE.
‎2007 Jul 27 12:52 PM
hi Arjun
how i ll store the data in the internal table from the fields of table control please give the code for that also.
thanks
anuj