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

Update module FM- Exception

Former Member
0 Likes
1,015

Hi,

Can i raise exceptions in a FM that is an update module (start imm)? If i cannot raise exceptions, kindly tell me a way i can handle errors? this FM requires me to create  a Service order. and am going to call this FM in a user exit.

Kindly help.

1 ACCEPTED SOLUTION
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
803

Hello Sneha,

Updates registered via update function-modules(without the SET UPDATE TASK LOCAL addition) are executed in special work processes - UPD(Update). This is disjoint with the actual program execution & hence EXCEPTIONS are not considered for Update FMs.

If the Update terminates with an error, database rollback is issued & the update owner is notified via SAPMail.

BR,

Suhas

4 REPLIES 4
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
804

Hello Sneha,

Updates registered via update function-modules(without the SET UPDATE TASK LOCAL addition) are executed in special work processes - UPD(Update). This is disjoint with the actual program execution & hence EXCEPTIONS are not considered for Update FMs.

If the Update terminates with an error, database rollback is issued & the update owner is notified via SAPMail.

BR,

Suhas

Read only

Former Member
0 Likes
803

Hi Suhas,

Thank you for the reply. but what is the difference if I use the statement SET UPDATE TASK LOCAL??

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
803

Hello Sneha,

When you use SET UPDATE TASK LOCAL before the call of the update FM, the update occurs within the same work process in which the program is being executed. Read the SAP documentation for further details.

In both the cases the execution of the Update FM is disjoint from the actual program. So i don't think this makes any difference.

BR,

Suhas

Read only

matt
Active Contributor
0 Likes
803

The trick is to identify the causes for error and handle them before you call the FM in the update task. Only the most unusual errors should happen in there.