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 with UPDATE TASK

Former Member
0 Likes
3,598

All,

Have a look at the below code. While debugging the control is not going inside the function module called using <b>call function ...... in update task</b> statement.

I believe the function module is not executed immediately, but is scheduled for execution in a special work process (update work process). For this purpose, the name of the function module including the passed actual parameters is stored as a log record in the database table VBLOG. If the statement is executed during the update task, the addition IN UPDATE TASK is ignored.

The actual execution is triggered by the statement COMMIT WORK which is not happening in this case. The formal parameters of the function module receive the values of the actual parameters from table VBLOG. How can I read the entries in VBLOG? Why the function module is not executed? Please suggest.

PERFORM bte_publish ON COMMIT LEVEL 9.
* syncron update
    COMMIT WORK AND WAIT.

*&---------------------------------------------------------------------*
*       Publish business transaction events. The function module have
*       to call as last update module!
*----------------------------------------------------------------------*
FORM bte_publish.

  IF NOT gvt_nodes IS INITIAL.
    CALL FUNCTION 'CUSTOMER_HIERARCHY_THROW_BTE' IN UPDATE TASK
         EXPORTING
              ffi_valid_on    = knvh-datab
              fti_event_list  = gvt_nodes
              fti_event_listx = gvt_nodesx.
  ENDIF.
ENDFORM.                               " BTE_PUBLISH

Thanks,

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,847

Go to SM13 and display the update termination and check in which function module you got the error..And try to fix the error..

Thanks,

Naen

10 REPLIES 10
Read only

Former Member
0 Likes
1,847

Hi,

For the update modules you have to set the update debugging on to debug those..

In the debugging screen..

In the menu choose the option Settings -> Update debugging.

Thanks,

Naren

Read only

0 Likes
1,847

Thanks. But when I did that...it said...update debugging has triggered. But the control is not going inside the update function module. How can I do that?

Thanks,

Read only

Former Member
0 Likes
1,847

Hi,

If you put a break point I believe it will not stop..

Once you set the update debuggin..Press F8..It will process all the update function modules..

Skip the function modules that you don't want to debug by pressing F6 on the function module calls..

Thanks,

Naren

Read only

0 Likes
1,847

Right Naren. But I need to check inside the update function module, whether it is calling the BTE function module I had configured and the code which I had put in it. Any ideas?

The COMMIT WORK is returning 4 and hence I believe it is not popping up another debuggin session in which the update FM runs.

Thanks,

Message was edited by: Somen

Read only

Former Member
0 Likes
1,847

Are you getting any update termination error when executing the code..Check SM13 for update terminaation logs...

Thanks,

Naren

Read only

0 Likes
1,847

Yes. Right. What should I do in this case?

Thanks,

Read only

Former Member
0 Likes
1,848

Go to SM13 and display the update termination and check in which function module you got the error..And try to fix the error..

Thanks,

Naen

Read only

0 Likes
1,847

Naren,

Thanks. I did fixed the error now. And now the status is 'initial'. I am not sure what does that mean?

What is the next step?

Thanks,

Read only

0 Likes
1,847

Naren,

Kewl. I executed that module from SM13 and it took me there. Full points to you.

Thanks,

Read only

Former Member
0 Likes
1,847

Try to re-process the transaction..

Then set the update debugging..

Then make sure there is no update errors before your code is executed..

Thanks,

Naren