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: 

commit in Z class method

Former Member
0 Kudos
112

Hello friends

I am enhanching someone else's code in a method in a class.

I am trying to insert something in my z table, but it won't insert without commit. If I write commit, it gives syntax error.

" insert zmm_intsales from ca_zmatint.

commit. "

can anyone guide how to commit in a method of a class.

Regards

Bhavna

5 REPLIES 5

Former Member
0 Kudos
67

try 'COMMIT WORK' instead of COMMIT.

0 Kudos
67

Hi

I have used commit work it does not give syntax error, but still nothing is getting inserted in the Z table.

Thanks

0 Kudos
67

Are you sure that there is data in the ca_zmatint ?

Regards,

Rich Heilman

0 Kudos
67

Hi

Yes if nothing else material number is there in it.

Thanks

0 Kudos
67

In debug mode check the content of SY-DBCNT field immediately after the INSERT. If it contains a non-zero value, the record(s) are getting inserted.

In that case, check the content of table structure ca_zmatint to make sure you have populated the fields correctly.