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

doubt in update function module

nivin_varkey
Active Participant
0 Likes
471

dear friends..

i have created an UPDATE function module with Processing type- Update Module, Start Immediate. i have handled the exceptions using Raise statement in the function module..

the call function looks as..

CALL FUNCTION 'ZFI_LCTXN_TABLES_UPDATE'

in update task

EXPORTING

ZLCTMB1 = p_lctmb1

NU_ENTRY = p_global-ins_zlctmb1

TABLES

UPD_PO = UPD_PO

UPD_SH = UPD_SH

EXCEPTIONS

ERROR = 1

OTHERS = 2.

p_subrc = sy-subrc.

commit work.

but if the update fails, and even though the RAISE ERROR works, and update termination message is registered in SM13, i dont get the value for sy-subrc as 1 .

is it the right way..if yes please tell me how to generate an error message within the transaction..so that the user knows the update has failed..

thank you for your time

Nivin

4 REPLIES 4
Read only

Former Member
0 Likes
448

1. Call your Update FM.

2. If error occurs handle in the report like, if sy-subrc ne 0. message e00(002) 'Update terminate'. endif.

Read only

marcelo_ramos1
SAP Mentor
SAP Mentor
0 Likes
448

Hi,

Maybe it's usefull for you.

<b>

IF sy-subrc EQ 4.

MESSAGE e001 RAISING not_found.

ELSEIF sy-subrc EQ 8.

MESSAGE e002 RAISING not_found.

ELSE.

...

ENDIF.</b>

Using this to create a message and raise in the same time !

Regards.

Marcelo Ramos

Read only

0 Likes
448

thank you for the responses..

the problem is that ..even if an exception is triggered in the update function module, the value of sy-subrc is not set "not equal to zero" into the calling transaction..i mean..the sy-subrc after the update function call is not zet to "NON ZERO" even after an exception is raised..i hope u have got the problem now..

Read only

nivin_varkey
Active Participant
0 Likes
448

the error is triggered in Update work process.