[RESOLVIDO] FTAPI001

Discussão em 'EMS , HCM e Totvs 11' iniciado por muertebr, Agosto 14, 2013.

Status do Tópico:
Não esta aberto para novas mensagens.
  1. muertebr

    muertebr Membro Participativo

    Ola, estou tentando utilizar a FTAPI001 para integração com o contas a receber mais me retorna erro:

    "O parametro identificador de temp-table tt-nota-fiscal nao confere com a temp-table destino tt-nota-fiscal. (5363)"

    Alguem sabe o que poderia ser?

    Código:
    def var i-versao-api       as integer   no-undo.
    def var i-cod-pais-imposto as integer   no-undo.
    def var i-portador         as integer FORMAT ">>>>9"  no-undo.
    def var i-gera-titulo      as integer   no-undo.
    def var c-arquivo-exp      as character no-undo.
    
    DEF TEMP-TABLE tt-nota-fiscal
        FIELD atualizar     as LOG   initial yes
        FIELD referencia    as CHAR FORMAT "X(10)"
        FIELD r-nota-fiscal as ROWID.
    
    DEF TEMP-TABLE tt-retorno-nota-fiscal
        FIELD tipo       AS INT  FORMAT 9
        FIELD cod-erro   AS CHAR FORMAT "X(10)"
        FIELD referencia AS CHAR FORMAT "X(10)"
        FIELD desc-erro  AS CHAR
        FIELD situacao   AS LOG
        FIELD cod-chave  AS CHAR.
    
    DEF TEMP-TABLE tt-total-refer
        FIELD referencia     AS CHAR FORMAT "X(10)"
        FIELD nr-doctos      AS INT
        FIELD vendas-a-vista AS DEC FORMAT "->>>,>>>,>>9.99"
        FIELD vendas-a-prazo AS DEC FORMAT "->>>,>>>,>>9.99"
        FIELD vl-total       AS DEC FORMAT "->>>,>>>,>>9.99".
        
    ASSIGN i-versao-api = 3
           i-cod-pais-imposto = 1 /** Brasil **/
           i-portador = 342
           i-gera-titulo = 2
           c-arquivo-exp = "c:\datasul\teste.txt".
    
    FIND FIRST nota-fiscal NO-LOCK
        WHERE nota-fiscal.cod-estabel = "101" AND
              nota-fiscal.serie = "3" AND
              nota-fiscal.nr-nota-fis = "0231790" NO-ERROR.
    IF AVAIL nota-fiscal THEN DO:
        CREATE tt-nota-fiscal.
        ASSIGN tt-nota-fiscal.r-nota-fiscal = ROWID(nota-fiscal)
               tt-nota-fiscal.atualizar     = YES.
    END.
    
    run ftp/ftapi001.p (input  i-versao-api,
                        input  i-cod-pais-imposto,
                        input  i-portador,
                        input  i-gera-titulo,
                        input  c-arquivo-exp,
                        input  table tt-nota-fiscal,
                        output table tt-retorno-nota-fiscal,
                        output table tt-total-refer).
    
    FOR EACH tt-retorno-nota-fiscal NO-LOCK.
        display
            tt-retorno-nota-fiscal
            with stream-io width 320 no-box down.
        
    END.
    FOR EACH tt-total-refer NO-LOCK.
        display
            tt-total-refer
            with stream-io width 320 no-box down.
        
    END.

    Arquivos Anexados:

  2. Rogerio

    Rogerio Moderator Moderador Equipe de Suporte

    O ideal é voce abrir um chamado na Totvs pedindo para eles lhe mandarem os programas para utilizam dessa API.

    Com certeza o a definicao da TT-PARAM na include que está usando está diferente do .r
  3. LFBuozi

    LFBuozi Membro Participativo

    Apague as definições das temp-tables e use:
    Código:
    {ftp/ftapi001.i}
    {ftp/ftapi001.i1}
Status do Tópico:
Não esta aberto para novas mensagens.

Compartilhe esta Página