top of page

SAP Business One - query em SQL para localizar nota pelo número

  • Foto do escritor: expertb1
    expertb1
  • 23 de jul. de 2021
  • 1 min de leitura

/* select from "OINV" T0 */


Declare @numeronf as int


set @numeronf = /* T0."Serial" */ '[%0]';










Select


t0."Serial", t0."CardName", t0."DocDate", t0."DocTotal" ,'VENDAS>>NOTA FISCAL DE SAÍDA' as "MenuSAP"


from


oinv t0


where


t0."Serial" = @numeronf






union all






Select


t0."Serial", t0."CardName", t0."DocDate", t0."DocTotal" ,'VENDAS>>ENTREGA' as "MenuSAP"


from


ODLN t0


where


t0."Serial" = @numeronf






UNION ALL






Select


t0."Serial", t0."CardName", t0."DocDate", t0."DocTotal" ,'VENDAS>>DEVOLUCAO DE ENTREGA' as "MenuSAP"


from


oRDN t0


where


t0."Serial" = @numeronf






UNION ALL






Select


t0."Serial", t0."CardName", t0."DocDate", t0."DocTotal" ,'VENDAS>>DEVOLUCAO DE NF DE SAIDA' as "MenuSAP"


from


oRIN t0


where


t0."Serial" = @numeronf






UNION ALL






Select


t0."Serial", t0."CardName", t0."DocDate", t0."DocTotal" ,'COMPRAS>>NOTA FISCAL DE ENTRADA' as "MenuSAP"


from


oPCH t0


where


t0."Serial" = @numeronf






UNION ALL






Select


t0."Serial", t0."CardName", t0."DocDate", t0."DocTotal" ,'COMPRAS>>DEVOLUCAO NOTA FISCAL DE ENTRADA' as "MenuSAP"


from


oRPC t0


where


t0."Serial" = @numeronf






UNION ALL






Select


t0."Serial", t0."CardName", t0."DocDate", t0."DocTotal" ,'COMPRAS>>RECEBIMENTO' as "MenuSAP"


from


oPDN t0


where


t0."Serial" = @numeronf






UNION ALL






Select


t0."Serial", t0."CardName", t0."DocDate", t0."DocTotal" ,'COMPRAS>>DEVOLUCAO DE MERCADORIA' as "MenuSAP"


from


oRPD t0


where


t0."Serial" = @numeronf;


  • Instagram
  • LinkedIn ícone social
  • iconeWhats
  • Nosso Canal com Dicas Rápidas
bottom of page