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 update from PAI

Former Member
0 Likes
1,385

Hi All,

I have couple of fields in my screen,based on the entries made on these two fields i will have have to

update my database table with the same entries.

Please help as how my PAI should be..

Thanks,

Rahul

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,090

declare the fields of the same type in your abap program that serves as the interface between screen and ABAP prog. In PAI module, move the data from screen fields to these fields defined in prog. then INSERT or UPDATE statement may be used to update the DB table.

Hi All,

I have couple of fields in my screen,based on the entries made on these two fields i will have have to

update my database table with the same entries.

Please help as how my PAI should be..

Thanks,

Rahul

6 REPLIES 6
Read only

Former Member
0 Likes
1,091

declare the fields of the same type in your abap program that serves as the interface between screen and ABAP prog. In PAI module, move the data from screen fields to these fields defined in prog. then INSERT or UPDATE statement may be used to update the DB table.

Read only

0 Likes
1,090

Hi Abhilasha,

Thank you for your reply.

could u please help me with a sample code.

and is there any thing else to be done?

Thanks,

R

Read only

0 Likes
1,090
UPDATE zoutput_c FROM wa_zoutput_c.

write update and insert in editor and hit F1 and you will get more data...

This is the first thing you need to do.. and if you have any issues then post a thread on it... Thanks.

Read only

0 Likes
1,090

if its standard SAP tbl, pls. try to use any FM or BAPI to update the DB table....try to avoide to use INSERT or UPDATE.

thanq

Edited by: SAP ABAPer on Dec 30, 2008 8:25 PM

Read only

Former Member
0 Likes
1,090

Hi Rahul,

Pl see

Data: screen_input1, "these are the field names defined as well on screen

screen_input2, "screen field name where data would come after entering on to screen

input1,

input 2.

in PAI module

input1 = screen_input1. "trf the data to the field reqd by you.

input2 = screen_input2.

UPDATE <database table name>

SET field1 = input1

field2 = input2

WHERE condition to select the right record for updation.

Read only

Former Member
0 Likes
1,090

Hi,

You can use MODIFY command also rather than insert or update.

Declare thye screen fields name same as table filed name.Use work area rather than internal tabel with heaer line .In PAI just write these two line

MOVE_CORRESPONDING wa to dbtable.

MODIFY dbtable. OR MODIFY dbtable FROM wa.

Pooja