declare res number; DOCTYPE supermag.smdocuments.doctype%TYPE := 'OR'; DOCID supermag.smdocuments.id%TYPE := 'ЗП012345'; begin if supermag.core.getproc is null then res := supermag.Core.StartSMApp(); end if; supermag.SMDOCLOCK(DOCTYPE, DOCID); begin supermag.SMENABLEACTUALIZEGOODS; -- блокировка supermag.documents.changedocstate(DOCTYPE, DOCID, 1, 0); supermag.SMACTUALIZEGOODS; supermag.SMDOCUNLOCK(DOCTYPE, DOCID); exception when others then supermag.SMDOCUNLOCK(DOCTYPE, DOCID); raise; end; end;