08-11-2011 6:04 AM
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.
08-11-2011 6:18 AM
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
08-11-2011 6:18 AM
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
08-11-2011 7:16 AM
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.