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

Difference between Function module in Update task

Former Member
0 Likes
7,201

Hi folks,

What is the difference between

1. A function module calling in 'update task'( if attributes not set for update mode).

2.A function module's attributes set to update mode, but while calling not specified 'Update task'.

Please clarify this doubt.

Thanks in advance.

Bhavani

5 REPLIES 5
Read only

Former Member
0 Likes
1,943

CALL FUNCTION func IN UPDATE TASK.

Additions:

1. ... EXPORTING p1 = f1 ... pn = fn

2. ... TABLES p1 = itab1 ... pn = itabn

Effect

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. Update function modules must be flagged as such in the Function Builder

The return value is not set.

Addition 1

... EXPORTING p1 = f1 ... pn = fn

Effect

Values of fields and field strings specified under EXPORTING are passed from the calling program to the function module. In the function module, the formal parameters are defined as import parameters. In the interface definition, default values must be assigned to all import parameters of the update function module.

Addition 2

... TABLES p1 = itab1 ... pn = itabn

Effect

TABLES passes references to internal tables. All table parameters of the function module must have values.

Note

With update function modules, both import parameters and exceptions are ignored when the call is made.

Administration transaction

Related

COMMIT WORK, SET UPDATE TASK LOCAL

regards,

kartikey.

Read only

Former Member
0 Likes
1,943

hi,

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. Update function modules must be flagged as such in the Function Builder

The return value is not set.

cheers,

sasi

Read only

Former Member
0 Likes
1,943

hi

you cannot use a CALL FUNCTION in update task if

it not has the property attribute set.

if you do this when you'll try the generate the program

the system will return an error.

on the other side you can use a function module with the attibute in update task like a normal function module.

remember that all the parameters specified in the fm

that you want to use in update task must be flagged by reference and that a fm in update task cannot have parameters in exporting or trigger exceptions.

the function module in update task is triggered at the

first explicit commitwork by using the instruction COMMIT WORK.

note: you can specified the fm in update task in two ways. "start immediately" or "start delayed". the first indicate that your FM will be processed like an update type V1, the second that the FM will be processed in an update type V2.

note: all the fm in update task of type V1 will be processed into the same LUW, all the fm in update task of type V2 are processed in separated LUW.

note that you can have

Read only

0 Likes
1,943

note that you can have more fm in update task

into your programs of differents types.

but if the fm type V1 will get an error all the fm type V2

will NOT be executed and all the modification into V1 update are rollbacked, if the fm type V1 will be okay but an error occurs into one fm type V2 the modification into that fm will be rollbacked, but the others V2 update process are processed and the modifications executed by V1 update process are NOT rollbacked.

bye

Read only

Former Member
0 Likes
1,943

Hi bhavani

-

-


To be able to call a function module in an update work process, you must flag it in the Function Builder. When you create the function module, set the Process Type attribute to one of the following values:

Update with immediate start


Set this option for high priority ("V1") functions that run in a shared (SAP LUW). These functions can be restarted by the update task in case of errors.

Update w. imm. start, no restart


Set this option for high priority ("V1") functions that run in a shared (SAP LUW). These functions may not be restarted by the update task.

Update with delayed start

Set this option for low priority ("V2") functions that run in their own update transactions. These functions can be restarted by the update task in case of errors.

To display the attributes screen in the Function Builder, choose Goto ® Administration.

-

-


Difference Is:

In Update Mode:


During the update, errors only occur in exceptional cases, since the system checks for all logical errors, such as incorrect entries, in the dialog phase of the SAP LUW. If a logical error occurs, the program can terminate the update using the ROLLBACK WORK statement. Then, the function modules are not called, and the log entry is deleted from table VBLOG. Errors during the update itself are usually technical, for example, memory shortage. If a technical error occurs, the update work process triggers a database rollback, and places the log entry back into VBLOG.

else

Function modules that you call using CALL FUNCTION...In that case,

After the COMMIT WORK, the dialog process does not wait for these function modules to be executed . All of the function modules that you register in this way are executed together in a single database LUW. These updates are useful, for example, when you need to maintain identical data in more than one database.

-

-


Cheers,

Vijay Raheja