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

Inserting Values in database Table in function Module

Former Member
0 Likes
2,200

Hello,

I am doing modifications in one of the user exit ZXM06U44.

This is triggered during PO creation and PO Release.

On PO Creation i want to insert some data of header and line item to three different Z Tables which i Have created.

Now when i am going to insert the data to thes Z Tables then it is not inserting the same.

Will i have to declare them in TABLE tab of userexit.

Or anyone can give me other solution as it wants access key to change the Userexit function module.

Codeing is as

wa_table1-ebeln = i_ekko-ebeln.

wa_table1-ebelp = xekpo-ebelp.

wa_table1-menge = xekpo-menge.

wa_table1-idnlf = xekpo-idnlf.

wa_table1-matnr = xekpo-matnr.

wa_table1-werks = xekpo-werks.

insert ztable1 from wa_table1.

clear wa_table1.

wa_table2-ebeln = i_ekko-ebeln.

wa_table2-ebelp = xekpo-ebelp.

wa_table2-wempf = xekkn-wempf.

wa_table2-ablad = xekkn-ablad.

wa_table2-kostl = xekkn-kostl.

insert ztable2 from wa_table2.

clear wa_table2.

wa_table3-ebeln = i_ekko-ebeln.

wa_table3-ebelp = xekpo-ebelp.

wa_table3-eindt = xeket-eindt.

insert ztable3 from wa_table3.

clear wa_table3.

Now at insert command it is not inserting to database.

Anyone suggest me the solution.

Thanks & Regards,

nitin Malhotra

1 REPLY 1
Read only

former_member438956
Active Participant
0 Likes
711

use modify statement instead of insert statement. it will modify the record if it already exist and will insert record if it does not exist.

syntax is

modify <dbtablenam> from table <itab> or

modify <dbtablename> from <workaread>

Regards,

Anil N.