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

Function module(updating table)

Former Member
0 Likes
4,314

Hello, Friends i want to update a table through rfm but its showing that it is entered into the table but when i check the table there is no entry.Please someone help me out..

Here is my code

FUNCTION Zdemo.

*"----------------------------------------------------------------------

*"*"Local Interface:

*"  EXPORTING

*"     REFERENCE(PRODUCT_CODE) TYPE  ZPRODUCT

*"     REFERENCE(PRODUCT_DESCR) TYPE  ZDESCRIPTION

*"  TABLES

*"      ITAB STRUCTURE  ZPRODUCT_MASTER

*"----------------------------------------------------------------------

ITAB-PRODUCT_CODE = '10 '.

ITAB-PRODUCT_DESCR = 'Sun'.

APPEND ITAB .

update ZPRODUCT_MASTER from itab .

modify ZPRODUCT_MASTER from itab .

ENDFUNCTION.

4 REPLIES 4
Read only

former_member195270
Active Participant
0 Likes
2,523

use commit work statement after calling database update and also check value of sy-subrc.It should be zero.

Read only

vinoth_aruldass
Contributor
0 Likes
2,523

use work area in this case.

loop at itab.

modify zproduct_master from itab.

endloop.

hope it helps,

Vinoth

Read only

Former Member
0 Likes
2,523

Hi parikshit,

use

modify ZPRODUCT_MASTER from table itab[] .

after the fm you have to use commit work....

hope it will help to solve your problem and if you get correct answer then close your thread according SCN rules and engagement.

Regards

Sabyasachi

Read only

Sijin_Chandran
Active Contributor
0 Likes
2,523

HI Parikshit ,

As per your statement ,

 i want to update a table through rfm but its showing that it is entered into the table but when i check the table there is no entry.Please someone help me out..

I would like to know how the RFM is making you know that values has been entered into the table.

And also why are you using INSERT and MODIFY simultaneously.

MODIFY itself will do the job.

MODIFY = INSERT + UPDATE.

And also as told by Vinoth use a WORK AREA of type itab for MODIFY statement.