Hi Jim,
When commit is executed the program enters the update mode. You can't commit or rollback in update mode, it's already done.
Also you're in a synchronous call inside the function, so naturally if you abort the function so does the main program aborts.
I'm having a hard time understanding your code. Why isn't just something like:
CALL FUNCTION 'Z_UPDATE_IMS'
EXPORTING
imt_ims = gt_ims
exceptions
err_rollback = 1.
IF sy-subrc NE 0.
ROLLBACK WORK.
w_status = '68'.
w_msgv1 = 'IMS Invoice Load Failed'(t04).
ELSE.
commit work. "shouldn't be necessary...
w_status = '53'.
w_msgv1 = 'IMS Invoice(s) Loaded Successfully'(t05).
ENDIF.
and in function:
IF NOT lts_insert[] IS INITIAL.
TRY.
INSERT zims FROM TABLE lts_insert.
CATCH cx_sy_open_sql_db.
raise err_rollback.
ENDTRY.
ENDIF.
Regards,
Edgar