CE PLUS - Nota 010380

Módulo: CÂMBIO EXPORTAÇÃO

Funcionalidade: Relatórios

Data/Hora da Publicação: 08/07/2010 00:00:00

Data/Hora Última Alteração: 18/02/2011 15:56:17

Descrição da Nota: RELATORIO CAMBIOS FECHADOS, CONTRATOS PENDENTES, LIQUIDADOS, TODOS

Sintoma

O Relatório não estava respeitando o Parâmetro "Posição Em.: " para selecionar

as Vinculações e Liquidações do Contrato, e em determinados momentos, não enquadrando corretamente

como contratos pendentes ou liquidados.

 

 

Solução

O Relatório irá verificar qual data informada na Posição Em.: para selecionar corretamente os

valores vinculados e liquidados, selecionando as Vinculações e Liquidações de acordo com o Parâmetro

Posição Em.: e apresentando corretamente as informações conforme a data, e enquadrando corretamente

os contratos como Pendentes ou Liquidados.

 

Versões Tratadas

8.0


Pré-Requisitos

Produto:

Nota

Descrição

PROGRAMA DE CAMBIOS FECHADOS - CAMPO 'POSIÇÃO EM'

RELATÓRIO DE CÂMBIOS FECHADOS - DATA POSIÇÃO EM

SELEÇÃO DO RELATORIO DE CAMBIOS FECHADOS COMO O CAMPO "POSIÇÃO EM"

Informações Complementares

----------------------------------------------------------------------------------------------------

Nota Número 10380 Data: 08/07/2010 Hora: 09:38:11

----------------------------------------------------------------------------------------------------

 

----------------------------------------------------------------------------------------------------

Nota Número              : 10380

Categoria                : Erro de Programa

Prioridade               : Média

Versão PW.CE             : 8.0

Pacote                   : 00004

Agrupamento              : 00029

----------------------------------------------------------------------------------------------------

Referência às notas relacionadas:

Número - Ordem - Versão - Pacote - Descrição Breve

 

07151  - 00001 - 7.0    - 00006  - SELEÇÃO DO RELATORIO DE CAMBIOS FECHADOS COMO O CAMPO "POSIÇÃO EM

07319  - 00002 - 7.0    - 00007  - PROGRAMA DE CAMBIOS FECHADOS - CAMPO 'POSIÇÃO EM'

07342  - 00003 - 7.0    - 00007  - RELATÓRIO DE CÂMBIOS FECHADOS - DATA POSIÇÃO EM

----------------------------------------------------------------------------------------------------

RELATORIO CAMBIOS FECHADOS, CONTRATOS PENDENTES, LIQUIDADOS, TODOS

----------------------------------------------------------------------------------------------------

Palavras Chave:

RELATORIO CAMBIOS FECHADOS, CONTRATOS PENDENTES, LIQUIDADOS, TODOS

 

----------------------------------------------------------------------------------------------------

Objetos da nota:

REPS /PWS/ZYCBR047

 

----------------------------------------------------------------------------------------------------

Modificações efetuadas em REPS /PWS/ZYCBR047

 

...

        nrinvoic  like /pws/zycbt005-nrinvoic,

        nrparcf   like /pws/zycbt005-nrparcf,

        gsberf    like /pws/zycbt005-gsberf,

        dtvincul  like /pws/zycbt005-dtvincul,

        dtvencto  like /pws/zycbt005-dtvencto,

        waers     like /pws/zycbt005-waers,

        vlvinc    like /pws/zycbt005-vlvinc,

        slpagar   like /pws/zycbt005-slpagar,

        vljur     like /pws/zycbt005-vljur,

        waers_c   like /pws/zycbt005-waers,

* >> Início da inclusão:

        status    like /pws/zycbt005-status,

        parid     like /pws/zycbt005-parid,

        vlme_p    like /pws/zycbt005-vlme_p,

* << Fim da inclusão

      end of itab_zycbt005.

data: begin of itab_zycbt006 occurs 0,

        nrseqc    like /pws/zycbt006-nrseqc,

        tpdesp    like /pws/zycbt006-tpdesp,

        nrparc    like /pws/zycbt006-nrparc,

        dtincl    like /pws/zycbt006-dtincl,

        nrinvoic  like /pws/zycbt006-nrinvoic,

        nrparcf   like /pws/zycbt006-nrparcf,

        gsberf    like /pws/zycbt006-gsberf,

        dtvincul  like /pws/zycbt006-dtvincul,

        dtvencto  like /pws/zycbt006-dtvencto,

        dtpagto   like /pws/zycbt006-dtpagto,

        dtpagext  like /pws/zycbt006-dtpagext,

* >> Início da inclusão:

        status    like /pws/zycbt006-status,

        vlme      like /pws/zycbt006-vlme,

* << Fim da inclusão

      end of itab_zycbt006.

data: begin of itab_zycbt017 occurs 0,

        nrinvoic like /pws/zycbt017-nrinvoic,

        nrparcf  like /pws/zycbt017-nrparcf,

        gsberf   like /pws/zycbt017-gsberf,

        fkdat    like /pws/zycbt017-fkdat,

        dtbl     like /pws/zycbt017-dtbl,

        kunag    like /pws/zycbt017-kunag,

        zterm    like /pws/zycbt017-zterm,

        dtvencto like /pws/zycbt017-dtvencto,

...

 

...

  clear g_variant.

  g_variant-report = sy-repid.

  g_variant-username = sy-uname.

at selection-screen.

  clear p_varian.

at selection-screen on value-request for p_varian.

  perform f4_for_variant.

start-of-selection.

  perform seleciona_dados.

  perform cria_range.

* >> Início da exclusão:

  perform filtra_dados.

* << Fim da exclusão

* >> Início da inclusão:

  perform filtra_dados_novo.

* << Fim da inclusão

  if not p_alv is initial.

    perform imprime_relatorio.

    if not itab_erro[] is initial.

      perform imprime_relat_erro.

    endif.

  else.

    move sy-repid to v_repid.

    perform e04_comment_build using gt_list_top_of_page[].

    perform f_monta_final.

    perform f_fieldcat_fill.

...

 

...

        modify itab_zycbt001.

      endif.

    endloop.

  else.

    message i222.

    stop.

  endif.

  if not itab_zycbt001[] is initial.

    select nrseqc tpdesp nrparc dtincl nrinvoic nrparcf gsberf dtvincul

           dtvencto waers vlvinc slpagar vljur

* >> Início da exclusão: FORM SELECIONA_DADOS

           waers_c

* << Fim da exclusão

* >> Início da inclusão: FORM SELECIONA_DADOS

           waers_c  status parid vlme_p

* << Fim da inclusão

           into table itab_zycbt005 from /pws/zycbt005

           for all entries in itab_zycbt001

           where nrseqc eq itab_zycbt001-nrseqc.

    if sy-subrc eq 0.

      select * into table itab_zycbt004

         from /pws/zycbt004

         for all entries in itab_zycbt001

         where nrseqc eq itab_zycbt001-nrseqc

           and tpdesp like 'J%'.

      if not itab_zycbt005[] is initial.

        select nrseqc tpdesp nrparc dtincl nrinvoic nrparcf

               gsberf dtvincul dtvencto dtpagto dtpagext

* >> Início da inclusão: FORM SELECIONA_DADOS

               status vlme

* << Fim da inclusão

               into table itab_zycbt006 from /pws/zycbt006

               for all entries in itab_zycbt005

               where nrinvoic eq itab_zycbt005-nrinvoic and

                     nrparcf  eq itab_zycbt005-nrparcf  and

                     gsberf   eq itab_zycbt005-gsberf   and

                     dtvincul eq itab_zycbt005-dtvincul and

                     nrseqc   eq itab_zycbt005-nrseqc   and

                     tpdesp   eq itab_zycbt005-tpdesp   and

                     nrparc   eq itab_zycbt005-nrparc   and

                     dtincl   eq itab_zycbt005-dtincl   and

...

 

...

      endif.

    endif.

    select nrseqc txjtotal tptxjur into table itab_zycbt002

           from /pws/zycbt002 for all entries in itab_zycbt001

           where nrseqc eq itab_zycbt001-nrseqc and

                 tpparc eq 'J'                  and

                 nrparc eq '1'.

    select kunnr name1 into table itab_kna1cli

           from kna1 for all entries in itab_zycbt001

           where kunnr eq itab_zycbt001-kunnr.

* >> Início da inclusão: FORM SELECIONA_DADOS

    select tpcontr txtdesc

      from /pws/zycbt016

      into corresponding fields of table itab_zycbt016.  "#EC CI_NOWHERE

* << Fim da inclusão

  else.

    message i222.

    stop.

  endif.

  select * from /pws/zycbt007

      up to 1 rows

     where bukrs in s_bukrs.

  endselect.

  v_type = c_ctmoed.

  select single * from /pws/zycbt009

...

 

...

  else.

    if p_dtliq ne '00000000'.

      delete itab_zycbt001 where dtliquid gt p_dtliq.

      delete itab_zycbt005 where dtvincul gt p_dtliq.

      delete itab_zycbt006 where dtpagto  gt p_dtliq.

    else.

      delete itab_zycbt001 where dtliquid gt sy-datum.

    endif.

  endif.

endform.

* >> Início da inclusão:

form filtra_dados_novo.

  data: v_tabix   type sy-tabix,

        v_nrseq   like /pws/zycbt001-nrseqc,

        v_vr      like /pws/zycbt001-vlme,

        v_invoic  like /pws/zycbt006-nrinvoic,

        v_vincul  like /pws/zycbt001-vlme,

        v_liquid  like /pws/zycbt001-vlme.

  clear: itab_zycbt001,

         itab_zycbt005,

         itab_zycbt006,

         sy-subrc,

         v_tabix,

         v_nrseq,

         v_invoic,

         v_vr.

  sort  itab_zycbt001 by nrseqc .

  sort  itab_zycbt005 by nrseqc .

  sort  itab_zycbt006 by nrseqc .

  if p_dtliq eq '00000000'.

     move sy-datum to p_dtliq.

  endif.

  loop at itab_zycbt001.

    clear v_vr.

    v_tabix = sy-tabix.

    clear: v_vincul,

           v_liquid.

    loop at itab_zycbt005 where nrseqc = itab_zycbt001-nrseqc.

         if itab_zycbt001-tpcontr eq 'C'.

            if itab_zycbt005-dtvincul le p_dtliq.

               v_vincul = v_vincul + itab_zycbt005-vlme_p.

            endif.

         else.

            if itab_zycbt005-dtvincul le p_dtliq and

               itab_zycbt005-status   eq 'C'.

               v_vincul = v_vincul + itab_zycbt005-vlme_p.

            endif.

         endif.

    endloop.

    loop at  itab_zycbt006 where nrseqc = itab_zycbt001-nrseqc.

       if itab_zycbt006-dtpagto le p_dtliq and

          itab_zycbt006-status  eq 'C'.

          read table itab_zycbt005

            with key nrseqc   = itab_zycbt006-nrseqc

                     tpdesp   = itab_zycbt006-tpdesp

                     nrparc   = itab_zycbt006-nrparc

                     dtincl   = itab_zycbt006-dtincl

                     nrinvoic = itab_zycbt006-nrinvoic

                     nrparcf  = itab_zycbt006-nrparcf

                     gsberf   = itab_zycbt006-gsberf

                     dtvincul = itab_zycbt006-dtvincul

                     dtvencto = itab_zycbt006-dtvencto.

          if sy-subrc ne 0.

             v_liquid = v_liquid + itab_zycbt006-vlme.

          else.

             v_liquid = v_liquid +

                   ( itab_zycbt006-vlme * itab_zycbt005-parid ).

          endif.

       endif.

    endloop.

    itab_zycbt001-slvinc = itab_zycbt001-vlme -  v_vincul.

    modify itab_zycbt001.

    if p_contp eq 'X'.

       if itab_zycbt001-vlme = v_liquid.

          delete itab_zycbt001 index v_tabix.

       endif.

       if itab_zycbt001-tpcontr eq 'C'.

          delete itab_zycbt005 where nrseqc    = itab_zycbt001-nrseqc

                                 and dtvincul gt p_dtliq.

       else.

          delete itab_zycbt005 where nrseqc    = itab_zycbt001-nrseqc

                         and ( dtvincul gt p_dtliq or status ne 'C' ).

       endif.

       delete itab_zycbt006 where nrseqc = itab_zycbt001-nrseqc.

    elseif  p_contl eq 'X'.

        clear : v_tabix.

        loop at itab_zycbt006 where nrseqc = itab_zycbt001-nrseqc.

          if itab_zycbt006-dtpagto gt p_dtliq or

             itab_zycbt006-status  ne 'C'.

             v_tabix  = sy-tabix.

             v_nrseq  = itab_zycbt006-nrseqc.

             v_invoic = itab_zycbt006-nrinvoic.

             delete itab_zycbt006 index v_tabix.

             read table itab_zycbt005 with key nrinvoic = v_invoic.

             if sy-subrc = 0.

                delete itab_zycbt005 index sy-tabix.

             endif.

          endif.

        endloop.

        if       itab_zycbt006[] is initial or

           ( not itab_zycbt006[] is initial and

                 itab_zycbt001-vlme <> v_liquid ).

          delete itab_zycbt001 where nrseqc = itab_zycbt001-nrseqc.

        endif.

    elseif  p_todos eq 'X'.

        delete itab_zycbt001 where dtcontr gt p_dtliq.

        delete itab_zycbt001 where status eq 'I'.

        if itab_zycbt001-tpcontr eq 'C'.

           delete itab_zycbt005 where nrseqc    = itab_zycbt001-nrseqc

                                  and dtvincul gt p_dtliq.

        else.

           delete itab_zycbt005 where nrseqc    = itab_zycbt001-nrseqc

                          and ( dtvincul gt p_dtliq or status ne 'C' ).

        endif.

        delete itab_zycbt006 where dtpagto gt p_dtliq or status ne 'C'.

    endif.

  endloop.

  if itab_zycbt001[] is initial.

     message i222.

     stop.

  endif.

endform.

* << Fim da inclusão