Application Development 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: 

Do I need ROLBACK WORK in EXIT_SAPLCLFM_002 ?

Former Member
0 Kudos

Hi, all.

I have a probem using costomer-exit EXIT_SAPLCLFM_002 in IQ02.

my code is below: (EXIT_SAPLCLFM_002)

-


READ TABLE T_ALLAUSP WHERE OBJEK = LW_EQUNR

AND ...

W_AREA-FIELD01 = T_ALLAUSP-OBJEK.

W_AREA-FIELD02 = T_ALLAUSP-ATWRT.

...

INSERT ZTABLE001 FROM W_AREA.

IF SY-SUBRC <> 0.

MESSAGE S001(Z01) DESPLAY LIKE 'E'.

SET SCREEN sy-dynnr.

LEAVE SCREEN.

ENDIF.

-


When it happend any error in IQ02 after exit, It isn't cancelled to INSERT ZTABLE001.

Ofcource It isn't update in IQ02 because of error, ONLY update to insert ZTABLE001.

There are different SAP LUW?

Do I need to use ROLLBACK WORK?

If you know that, please let me know.

Regards

Rie.

1 ACCEPTED SOLUTION

former_member195402
Active Contributor
0 Kudos

Hi Rie,

never use "COMMIT WORK" or "ROLLBACK WORK" in a userexit !

For inserting entries to your z-table write a fm, mark it as update module and call it with

CALL FUNCTION ... IN UPDATE TASK.

Then it will be inserted only if the whole transcation will be saved and processed without errors.

Pass the values you want to the fm. The fm may only have one code line

INSERT Z-TABLE FROM IMPORT-PARAMETER (your Z-TABLE STRUCTURE)

Regards,

Klaus

2 REPLIES 2

former_member195402
Active Contributor
0 Kudos

Hi Rie,

never use "COMMIT WORK" or "ROLLBACK WORK" in a userexit !

For inserting entries to your z-table write a fm, mark it as update module and call it with

CALL FUNCTION ... IN UPDATE TASK.

Then it will be inserted only if the whole transcation will be saved and processed without errors.

Pass the values you want to the fm. The fm may only have one code line

INSERT Z-TABLE FROM IMPORT-PARAMETER (your Z-TABLE STRUCTURE)

Regards,

Klaus

0 Kudos

Hi Klaus,

Thank you for your reply.

It is very clear!!

I tried 'CALL FUNCTION ... IN UPDATE TASK', It solved my problem.

Thanks!

Regards

Rie.