2007 Jun 25 6:17 AM
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
2007 Jun 25 6:27 AM
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
2007 Jun 25 6:18 AM
Have you marked the FM: ZUPDATE as an update function module in the FM attributes Tab?
2007 Jun 25 6:20 AM
Hi,
After
update zupdatetable1 from table itab .
Try with writing commit-work.
May be this serves your purpose.
Reward if useful!
2007 Jun 25 6:21 AM
2007 Jun 25 6:27 AM
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