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 modify record in table 2 when updating a record in table 1 via SM30

aris_hidalgo
Contributor
0 Kudos
100

Hello experts,

I have a new requirement that whenever a user modifies a certain field(in this case, address field) and saved it, it would also update that particular record in table 2. Any help would be of great help to me.

Again, thank you guys and have a nice day!

1 ACCEPTED SOLUTION

dani_mn
Active Contributor
0 Kudos
68

Go and change the module pool program for the maintenance transaction of your table.

Save the table in PBO in an internal table and when user changes and press the save key. match the old with new one and if some modification is done change your second table according to it.

Regards,

Wasim Ahmed

5 REPLIES 5

dani_mn
Active Contributor
0 Kudos
69

Go and change the module pool program for the maintenance transaction of your table.

Save the table in PBO in an internal table and when user changes and press the save key. match the old with new one and if some modification is done change your second table according to it.

Regards,

Wasim Ahmed

Former Member
0 Kudos
68

data: begin of itab.

address.

end of itab.

select address into table itab from zdbtab.

loop at itab.

update zdbtab2 set address = itab-addres where cond.

endloop.

Former Member
0 Kudos
68

Hi viraylab,

1. For that u may have to use

table maintenance events,

and write abap code inside the routine.

regards,

amit m.

0 Kudos
68

Hi guys,

How will I know the particular record that the user modified? so that I will equate it to table 2 and modify it accordingly. Also, if its an event, what event is it?

Again, thanks guys for your time and take care!

0 Kudos
68

Hi again,

1. There are many events.

2. Then one which u can use will be

AFTER SAVE Event.

( the event code is 02)

3.

How will I know the particular record that the user modified

The CURRENT RECORD

is stored in EXTRACT.

3. U will h ave to use OFFSET to get the

primary key value of that table / or anything u want.

EG.

mykey = EXTRACT+3(10)

(BCOS 3 WILL BE MANDT FIELD

NEXT 10 EG WILL BE VBELN FIELD)

regards,

amit m.