1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

  2. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

Duvida ENAPI209 - componentes onde se usa

Discussão em 'EMS , HCM e Totvs 11' iniciado por reissobr, Janeiro 23, 2020.

  1. reissobr

    reissobr Membro Participativo

    Pessoal,

    Alguém já usou a ENAPI209 - componentes onde se usa ?
    A principio, ela é para retornar as mesmas informações da tela EN0804.

    Estou tramitando uns chamados com a TOTVS, mas por enquanto nem os includes que eles passaram está compilando ....

    Att;
  2. reissobr

    reissobr Membro Participativo

    Bom dia Pessoal ....
    somente compartilhando .... fechei o uso da ENAPI209.

    Em relação aos includes, no pro-path é necessário os abaixo:
    enp/enapi209.i
    enp/enapi209.i1
    enp/enapi607.i

    Mas declarado no programa, somente o enp/enapi209.i1.

    Abaixo está o codigo que usei para realizar meus testes.

    {enp/enapi209.i1}

    DEF VAR c-it-codigo AS CHAR NO-UNDO INITIAL "157.107-0".

    DEF VAR h-utapi033 AS HANDLE NO-UNDO.

    DEF VAR c-arq-nome AS CHARACTER NO-UNDO.
    DEF VAR c-titulo AS CHARACTER NO-UNDO.

    /*-------------------------------------------------------------------------------------------------------*/
    /* Inicializa a API da planilha em .XML */
    /*-------------------------------------------------------------------------------------------------------*/

    RUN utp/utapi033.p PERSISTENT SET h-utapi033.

    /* coluna, tipo, label, mascara, largura coluna */
    RUN piColumn IN h-utapi033 (INPUT 1, INPUT "INTE", INPUT "I-sequen", INPUT ">>,>>9", INPUT 40).
    RUN piColumn IN h-utapi033 (INPUT 2, INPUT "CHAR", INPUT "Item", INPUT "", INPUT 40).
    RUN piColumn IN h-utapi033 (INPUT 3, INPUT "CHAR", INPUT "Item.NMB", INPUT "", INPUT 40).
    RUN piColumn IN h-utapi033 (INPUT 4, INPUT "CHAR", INPUT "Componente", INPUT "", INPUT 40).
    RUN piColumn IN h-utapi033 (INPUT 5, INPUT "INTE", INPUT "Sequencia", INPUT ">>,>>9", INPUT 40).
    RUN piColumn IN h-utapi033 (INPUT 6, INPUT "INTE", INPUT "Nivel", INPUT "->>9", INPUT 40).
    RUN piColumn IN h-utapi033 (INPUT 7, INPUT "INTE", INPUT "Nivel Inv", INPUT "->>9", INPUT 40).
    RUN piColumn IN h-utapi033 (INPUT 8, INPUT "CHAR", INPUT "C-nivel", INPUT "", INPUT 40).
    RUN piColumn IN h-utapi033 (INPUT 9, INPUT "CHAR", INPUT "Chave", INPUT "", INPUT 40).
    RUN piColumn IN h-utapi033 (INPUT 10, INPUT "CHAR", INPUT "Chave Pai", INPUT "", INPUT 40).
    RUN piColumn IN h-utapi033 (INPUT 11, INPUT "DECI", INPUT "Qtd Usada", INPUT "->>>,>>9.9999", INPUT 40).
    RUN piColumn IN h-utapi033 (INPUT 12, INPUT "DECI", INPUT "Qtd Liquid", INPUT "->>>,>>9.9999", INPUT 40).
    RUN piColumn IN h-utapi033 (INPUT 13, INPUT "DECI", INPUT "Qtd Sumari", INPUT "->>>,>>9.9999", INPUT 40).
    RUN piColumn IN h-utapi033 (INPUT 14, INPUT "DECI", INPUT "Qtd Liq.Sum", INPUT "->>>,>>9.9999", INPUT 40).
    RUN piColumn IN h-utapi033 (INPUT 15, INPUT "DECI", INPUT "Fator Perda", INPUT "->>9.99", INPUT 40).
    RUN piColumn IN h-utapi033 (INPUT 16, INPUT "CHAR", INPUT "Cod Lista Comp", INPUT "", INPUT 40).
    RUN piColumn IN h-utapi033 (INPUT 17, INPUT "CHAR", INPUT "cod-ref-it", INPUT "", INPUT 40).
    RUN piColumn IN h-utapi033 (INPUT 18, INPUT "CHAR", INPUT "cod-ref-es", INPUT "", INPUT 40).
    RUN piColumn IN h-utapi033 (INPUT 19, INPUT "CHAR", INPUT "fantasma", INPUT "", INPUT 40).
    RUN piColumn IN h-utapi033 (INPUT 20, INPUT "CHAR", INPUT "data-valid", INPUT "", INPUT 40).
    RUN piColumn IN h-utapi033 (INPUT 21, INPUT "CHAR", INPUT "alternativo", INPUT "", INPUT 40).


    /*-------------------------------------------------------------------------------------------------------*/
    /* LIMPA AS TABELAS UTILIZADAS PELA API */
    /*-------------------------------------------------------------------------------------------------------*/

    EMPTY TEMP-TABLE tt-param NO-ERROR.
    EMPTY TEMP-TABLE tt-digita NO-ERROR.
    EMPTY TEMP-TABLE tt-estrutura NO-ERROR.

    /*-----------------------------------------------------------------------------------------------------------------------*/
    /* */
    /* Preenchendo a tt=param conforme tela (EN0804A) de parametros - somente itens ativos e que são produtos acabados */
    /* A tela tem o campo Visualiza por Lista Componente tipo tooogle box (marca / desmarca) (tg-dif-lista-compon) */
    /* tem o campo Todos os Itens Fabricados / somente Produtos Acabados Tipo Radio Set (rs-situacao) */
    /* A tt-param tem os campos */
    /* sumariza - logical */
    /* i-agrup-lista - logical */
    /* */
    /*-----------------------------------------------------------------------------------------------------------------------*/

    CREATE tt-param.
    ASSIGN tt-param.dt-corte = TODAY /* como no en0804a */
    tt-param.nr-niveis = 30 /* como no en0804a */
    tt-param.de-quantidade = 1 /* como no en0804a */
    tt-param.ind-process-mrp = 2 /* como no en0804a, assumindo que 1 = processo principal e */
    /* 2 = todos os processos */
    tt-param.cod-estabel = "" /* como no en0804a */
    tt-param.nr-linha = ? /* como no en0804a */
    tt-param.cod-unid-negoc = "" /* como no en0804a */
    tt-param.sumariza = NO /* ???? Sem entendimento de qual é a função deste parametro ???? */
    tt-param.estado[1] = YES /* como o campo Estado no En0804a [1] = ativo */
    tt-param.estado[2] = NO /* como o campo Estado no En0804a [2] = Obsoleto ordens automarticas */
    tt-param.estado[3] = NO /* como o campo Estado no En0804a [3] = Obsoleto Totas as Ordens */
    tt-param.estado[4] = NO /* como o campo Estado no En0804a [4] = Totalmente Onsoletos */
    tt-param.l-agrup-lista = NO /* ???? Sem entendimento de qual é a função deste parametro ???? */
    .


    CREATE tt-digita.

    CREATE tt-digita.
    ASSIGN tt-digita.it-codigo = c-it-codigo
    tt-digita.cod-refer = "".

    Run enp/enapi209.p (input table tt-param,
    Input table tt-digita,
    Output table tt-estrutura).

    FOR EACH tt-estrutura USE-INDEX tt-estr:

    FIND item WHERE item.it-codigo = tt-estrutura.it-codigo NO-LOCK.
    RUN piNewLine IN h-utapi033.
    RUN piLine IN h-utapi033 (INPUT 1, INPUT tt-estrutura.i-sequen).
    RUN piLine IN h-utapi033 (INPUT 2, INPUT tt-estrutura.it-codigo).
    RUN piLine IN h-utapi033 (INPUT 3, INPUT item.niv-mais-bai).
    RUN piLine IN h-utapi033 (INPUT 4, INPUT tt-estrutura.es-codigo).
    RUN piLine IN h-utapi033 (INPUT 5, INPUT tt-estrutura.sequencia).
    RUN piLine IN h-utapi033 (INPUT 6, INPUT tt-estrutura.nivel).
    RUN piLine IN h-utapi033 (INPUT 7, INPUT tt-estrutura.nivel-inv).
    RUN piLine IN h-utapi033 (INPUT 8, INPUT tt-estrutura.c-nivel).
    RUN piLine IN h-utapi033 (INPUT 9, INPUT tt-estrutura.chave).
    RUN piLine IN h-utapi033 (INPUT 10, INPUT tt-estrutura.chave-pai).
    RUN piLine IN h-utapi033 (INPUT 11, INPUT tt-estrutura.quant-usada).
    RUN piLine IN h-utapi033 (INPUT 12, INPUT tt-estrutura.quant-liquid).
    RUN piLine IN h-utapi033 (INPUT 13, INPUT tt-estrutura.quant-sumariz).
    RUN piLine IN h-utapi033 (INPUT 14, INPUT tt-estrutura.quant-liq-sum).
    RUN piLine IN h-utapi033 (INPUT 15, INPUT tt-estrutura.fator-perda).
    RUN piLine IN h-utapi033 (INPUT 16, INPUT tt-estrutura.cod-lista-compon).
    RUN piLine IN h-utapi033 (INPUT 17, INPUT tt-estrutura.cod-ref-it).
    RUN piLine IN h-utapi033 (INPUT 18, INPUT tt-estrutura.cod-ref-es).
    RUN piLine IN h-utapi033 (INPUT 19, INPUT tt-estrutura.fantasma).
    RUN piLine IN h-utapi033 (INPUT 20, INPUT tt-estrutura.data-valid).
    RUN piLine IN h-utapi033 (INPUT 21, INPUT tt-estrutura.alternativo).
    END.

    ASSIGN c-arq-nome = "x:/temp/enapi209.xla".
    ASSIGN c-titulo = "tt-estrut da ENAPI0290 - emitido em: " + STRING(TODAY).

    RUN piProcessa IN h-utapi033 (INPUT-OUTPUT c-arq-nome,
    INPUT "Qg-Converte-Epi",
    INPUT c-titulo).

    DELETE OBJECT h-utapi033 NO-ERROR.

    ASSIGN h-utapi033 = ?.

    MESSAGE "Programa Encerrado" VIEW-AS ALERT-BOX.

Compartilhe esta Página