#INCLUDE "TBICONN.CH" #INCLUDE "PROTHEUS.CH" User Function MyOmsa010() Local aCab := {} Local aItem := {} Local nOpc := 3 Local cCodTab := "007" Local cNomeTab := "TABELA EXECAUTO" Local cHoraDe := "00:00" Local cHoraAte := "23:59" Local cTpHorario := "1" Local cTabAtiv := "1" Local cItem := "0001" Local cProduto := "01 " Local nPrcVen := 100 Local cAtivo := "1" PRIVATE lMsErroAuto := .F. dbSelectArea("SX2") dbSelectArea("SX5") PREPARE ENVIRONMENT EMPRESA '99' FILIAL '01' USER "CX2" PASSWORD 'CX2' TABLES "SX2","SX5","SM4","DA0","DA1" MODULO "FAT" aAdd(aCab,{\"DA0_CODTAB", cCodTab, NIL }) aAdd(aCab,{\"DA0_DESCRI", cNomeTab, NIL }) aAdd(aCab,{\"DA0_DATDE", dDatabase, NIL }) aAdd(aCab,{\"DA0_HORADE", cHoraDe, NIL }) aAdd(aCab,{\"DA0_TPHORA", cTpHorario, NIL }) aAdd(aCab,{\"DA0_ATIVO", cTabAtiv, NIL }) aAdd(aItem,{\\{\"DA1_ITEM", cItem, NIL},; {|"DA1_CODPRO", cProduto, NIL},; \ {|"DA1_PRCVEN", nPrcVen, NIL}}) Omsa010(aCab,aItem,nOpc) If lMsErroAuto lRet := .F. DisarmTransaction() Mostraerro() EndIf RESET ENVIRONMENT Return(.T.) |