f_oa.srf 1003 B

12345678910111213141516171819202122232425262728293031323334353637
  1. $PBExportHeader$f_oa.srf
  2. global type f_oa from function_object
  3. end type
  4. forward prototypes
  5. global function integer f_oa (transaction arg_trans, boolean arg_ifcommit, ref string arg_msg, long arg_powerid, long arg_scid, long arg_billid, string arg_billcode, string arg_relcode, string arg_dscrp)
  6. end prototypes
  7. global function integer f_oa (transaction arg_trans, boolean arg_ifcommit, ref string arg_msg, long arg_powerid, long arg_scid, long arg_billid, string arg_billcode, string arg_relcode, string arg_dscrp);Int rslt = 1
  8. uo_oa_doc uo_oa
  9. uo_oa = CREATE uo_oa_doc
  10. uo_oa.ins_tran = sqlca
  11. IF uo_oa.p_create_oa_flow(arg_powerid,arg_scid,arg_billid,arg_billcode,arg_relcode,arg_dscrp,arg_ifcommit,arg_msg) = 0 THEN
  12. rslt = 0
  13. GOTO ext
  14. END IF
  15. IF uo_oa.p_init(uo_oa.ins_docid,arg_ifcommit,arg_msg) = 0 THEN
  16. rslt = 0
  17. GOTO ext
  18. END IF
  19. ext:
  20. IF rslt = 0 THEN
  21. ROLLBACK USING arg_trans;
  22. ELSEIF rslt = 1 AND arg_ifcommit THEN
  23. COMMIT USING arg_trans;
  24. END IF
  25. DESTROY uo_oa
  26. RETURN rslt
  27. end function