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: 

FM with ON UPDATE TASK not working

Former Member
0 Kudos

All,

I am not getting an entry into a custom database table.

Here is the calling program:

-


DATA: wa_zshopmonitor TYPE zshopmonitor.

*

  • it_sm-mandt = sy-mandt.

wa_zshopmonitor-shoprunid = '1234567890'.

wa_zshopmonitor-class = 'DATE DETERMINATION'.

wa_zshopmonitor-sub_class = '0'. "DUMMY VALUE CAUSE SAYS ALL FIELDS ARE REQUIRED

wa_zshopmonitor-zcluster = '0001'.

wa_zshopmonitor-datetime_start = 1.

wa_zshopmonitor-datetime_end = 2.

wa_zshopmonitor-runtime_msn = 1.

CALL FUNCTION 'ZMM_SHOP_LOGIC_MONITOR' IN UPDATE TASK

EXPORTING

shop_monitor_input = wa_zshopmonitor.

IF sy-subrc NE 0.

COMMIT WORK.

ENDIF.

-


The FM code is below - and yes the attributes have this defined as an UPDATE MODULE, start Immed.

The table I am trying to populate is a transparent table (ZSHOPMONITOR).

-


FUNCTION zmm_shop_logic_monitor.

*"----


""Update function module:

*"

""Local interface:

*" IMPORTING

*" VALUE(SHOP_MONITOR_INPUT) TYPE ZSHOPMONITOR STRUCTURE

*" ZSHOPMONITOR

*"----


INSERT INTO zshopmonitor VALUES shop_monitor_input.

IF sy-subrc NE 0.

  • error message here

WRITE: /'shop table not created'.

ENDIF.

ENDFUNCTION.

-


Thanks.

Scott

2 REPLIES 2

Former Member
0 Kudos

HI,

Remove the IN UPDATE TASK statement from the FM and excute FM and check in the custome table for the entry inserted or not.

If you specify IN UPDATE TASK then the function module is not executed immediately, but is scheduled for execution in a special work process (update work process).

Edited by: Avinash Kodarapu on Mar 18, 2009 10:49 PM

Former Member
0 Kudos

It now works - was a bad If statement.