Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

TABLE CONTROL AND SCREEN

Former Member
0 Likes
1,049

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

11 REPLIES 11
Read only

Former Member
0 Likes
1,026

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>

Read only

0 Likes
1,026

This report wil help u

its quite simple

DEMO_DYNPRO_TABCONT_LOOP

Read only

Former Member
0 Likes
1,026

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.

Read only

Former Member
0 Likes
1,026

Hi Anuj,

Give me your mail Id . I will give you a small PPT on creation of table control..

regards

Sourabh Verma

Read only

0 Likes
1,026

hi Sourabh my email id is:

anuj_arch@yahoo.com

thanks

anuj

Read only

0 Likes
1,026

Hi Anuj,

I have mailed on your mail ID . Please check and confirm.

Regards

Sourabh Verma

Read only

Former Member
0 Likes
1,026

Hi,

Look at the below demo programs in SAP

DEMO_DYNPRO_TABLE_CONTROL_1

DEMO_DYNPRO_TABLE_CONTROL_2

Regards

Sudheer

Read only

0 Likes
1,026

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

Read only

0 Likes
1,026

Hi Anuj,

Use Update statement to store the records in the data base table..

Regards

Sourabh Verma

Read only

0 Likes
1,026

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.

Read only

0 Likes
1,026

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