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

FM On Update Task

Former Member
0 Likes
765

Hi All,

I have written a subroutine and inside that I am calling a FM In Update Task.Control is going to the Subroutine but not into the FM In Update Task,but the SY-SUBRC = 0.

The Code is like this :

PERFORM sub_post_data.

FORM sub_post_data .

*----- Post through the FM in UPDATE TASK

CALL FUNCTION 'Z_MB1A_POST'

IN UPDATE TASK

EXPORTING

gm_header = gm_header

gm_code = gm_code

TABLES

gm_item = gm_item

t_return = gm_return.

ENDFORM.

The Processing type of the FM is selected as UPDATE MODULE and START IMMED.

Can anyone please tell me why the control is not going into the Update TASK FM?

Thx in Adv.

- Raj

Hi All,

I have written a subroutine and inside that I am calling a FM In Update Task.Control is going to the Subroutine but not into the FM In Update Task,but the SY-SUBRC = 0.

The Code is like this :

PERFORM sub_post_data.

FORM sub_post_data .

*----- Post through the FM in UPDATE TASK

CALL FUNCTION 'Z_MB1A_POST'

IN UPDATE TASK

EXPORTING

gm_header = gm_header

gm_code = gm_code

TABLES

gm_item = gm_item

t_return = gm_return.

ENDFORM.

The Processing type of the FM is selected as UPDATE MODULE and START IMMED.

Can anyone please tell me why the control is not going into the Update TASK FM?

Thx in Adv.

- Raj

4 REPLIES 4
Read only

Former Member
0 Likes
686

Hi Rajarshi,

When you call an FM in update task, it doesn't get executed until the system encounters a commit statement later in its flow.

This is what the sap help says:

<b>"Flags the function module func for execution in the update task. It is not executed at once, but the data passed with EXPORTING or TABLES is placed in a database table and a subsequent COMMIT WORK then causes the function module to be executed by the update task."</b>

Regards,

Ravi

Read only

0 Likes
686

Thx Ravi.

I need to Create the Goods Mvt. step by step using a BAPI.Say there are 3 sets of data,if the first one is OK but second one is with error I want to Rollback the first also.

If this is the case what I need to do?

Thx again.

Read only

Former Member
0 Likes
686

HI,

The function modules called in update task are executed at the end of the transaction .. if you want to look into the flow and debug in the update task.. while you are in the debugging mode place a break point at statment call function.. and go with f5 slowly u will get to the update funcation module at the end.

Thanks

Mahesh

Read only

0 Likes
686

if you want to debug the function module called in update task set the debugging setting as update debugging and put the break point inside the funtion module so it will stop at the funion

all the best .

rgds

srinu reddy