Application Development 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: 

How to insert data from screen to database Table..??

Former Member
0 Kudos

This is regarding screen painter area..

I have created a Z-table.

Also created a screen where i am having input box.

After entering text in the input box, i will click "SAVE" push button.

When i click "SAVE" push button, the Text entered in the screen input box should be saved in that z-table.

How to do it...??

Can anybody explain me with ABAP code...???

Thanks

Pavan

1 ACCEPTED SOLUTION

dani_mn
Active Contributor
0 Kudos

TABLES: ztable.

DATA: ok_code like sy-ucomm.

DATA: screen_field(50).

CASE ok_code.

WHEN 'SAVE'.

ztable-text = screen_field.

INSERT ztable.

ENDCASE.

Regards,

Wasim Ahmed

6 REPLIES 6

Former Member
0 Kudos

u have to use INSERT / MODIFY / UPDATE Commmands.

Regards

Prabhu

dani_mn
Active Contributor
0 Kudos

TABLES: ztable.

DATA: ok_code like sy-ucomm.

DATA: screen_field(50).

CASE ok_code.

WHEN 'SAVE'.

ztable-text = screen_field.

INSERT ztable.

ENDCASE.

Regards,

Wasim Ahmed

Former Member
0 Kudos

I have used the same in my Program.its working fine.I can able tio save

When cicking the save Button,

Give code as "Insert table "

Former Member
0 Kudos

Hai,

You can use Insert dbtab fro work area, or modify.

It will insert a new record in the database table.

Regards,

Umasankar

Former Member
0 Kudos

Hi,

You can try follwong logic.

tables : ztable.

data wa_ztable like line of ztable.

Case sy-ucomm.

when 'SAVE'.

clear wa_ztable.

wa_ztable-field1 = screenfield1.

wa_ztable-field2 = screenfield2.

wa_ztable-field3 = screenfield3.

modify ztable from wa_ztable.

endcase.

If it is simple database insertion,

you can always use Table Maintainance provided by SAP.

So that the code will be automatically generated and you dont have to worry.

Regards,

Shashank

aris_hidalgo
Contributor
0 Kudos

Hi,

you should use modify statement for your requirement. If you want to insert records to a data dictionary table, just use insert command. To know more about these 2 commands, press F1 while it is highlighted.

Regards!

P.S. Please award points for useful answers.