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

IN UPDATE TASK

Former Member
0 Likes
600

hi

I have written commit work inside the calling program but my database table is not getting updated with new value ie 30. Please help me.

report zfuncton_update.

CALL FUNCTION 'ZUPDATE' in update task

EXPORTING

ITEM = 30.

commit work.

data: itab1 type standard table of zupdatetable1, “ <b>Zupdatetable1 is my database table containing only 2 fields MANDT and POSNR.</b>

wa_itab1 type zupdatetable1.

select * from zupdatetable1 into corresponding fields of table itab1.

loop at itab1 into wa_itab1.

write: / wa_itab1-posnr.

endloop.

<b>And following is my ‘ZUPADTE’ FM</b>

FUNCTION ZUPDATE.

*"----


""Update Function Module:

*"

""Local Interface:

*" IMPORTING

*" VALUE(ITEM) TYPE POSNR

*"----


data: itab type standard table of zupdatetable1,

wa_itab type zupdatetable1 .

wa_itab-posnr = item. “ <b>item is of type POSNR and I have declared it as an import parameter in Zupdate FM</b>

append wa_itab to itab.

update zupdatetable1 from table itab .

ENDFUNCTION.

Regards,

ravish

1 ACCEPTED SOLUTION
Read only

varma_narayana
Active Contributor
0 Likes
564

Hi,

In the Attributes of the FM

Set the Processing type to : Update Module (Immediate start).

AND

In the FM source code

there is no need to declare the internal table as you are updating a single record.

You can use the code

update zupdatetable1 set POSNR = ITEM where POSNR = ?.

Hope this will hep you.

regards

4 REPLIES 4
Read only

former_member150733
Contributor
0 Likes
564

Have you marked the FM: ZUPDATE as an update function module in the FM attributes Tab?

Read only

Former Member
0 Likes
564

Hi,

After

update zupdatetable1 from table itab .

Try with writing commit-work.

May be this serves your purpose.

Reward if useful!

Read only

Former Member
0 Likes
564

hi

thanks for replies bt the query has been resolved

Read only

varma_narayana
Active Contributor
0 Likes
565

Hi,

In the Attributes of the FM

Set the Processing type to : Update Module (Immediate start).

AND

In the FM source code

there is no need to declare the internal table as you are updating a single record.

You can use the code

update zupdatetable1 set POSNR = ITEM where POSNR = ?.

Hope this will hep you.

regards