top of page

SQL em Hana que localiza NF em qualquer menu.

Foto do escritor: expertb1expertb1

/* select from "OINV" T0 */

Declare numeronf int;

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;




94 visualizações0 comentário

Posts recentes

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