CE PLUS - Nota 009017

Módulo: DOC. IMPORTAÇÃO

Funcionalidade: Recebimento

Data/Hora da Publicação: 16/09/2009 00:00:00

Data/Hora Última Alteração: 23/02/2011 09:58:11

Descrição da Nota: PREENCHIMENTO DO LOTE NA TABELA /PWS/ZYCIT279

Sintoma

Ajustado preenchimento da tabela /pws/zycit279 para gravar o lote sempre que o item possuir.

 

 

Solução

Ajustado preenchimento da tabela /pws/zycit279 para gravar o lote sempre que o item possuir.

 

Versões Tratadas

7.0


Pré-Requisitos

Produto:

Nota

Descrição

AO VINCULARO EMBARQUE É VINCULADO AO ATO CONCESSÓRIO DE DRAWBACK, DUMP

CALCULO DA QUANTIDADE ESTATISTICA

Informações Complementares

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

Nota Número 09017 Data: 16/09/2009 Hora: 11:14:56

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

 

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

Nota Número              : 09017

Categoria                : Erro de Programa

Prioridade               : Média

Versão PW.CE             : 8.0

Pacote                   : 00001

Agrupamento              : 00001

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

Referência às notas relacionadas:

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

 

03179  - 00001 - 6.0    - 00026  - AO VINCULARO EMBARQUE É VINCULADO AO ATO CONCESSÓRIO DE DRAWBACK,

07831  - 00002 - 7.0    - 00008  - CALCULO DA QUANTIDADE ESTATISTICA

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

PREENCHIMENTO DO LOTE NA TABELA /PWS/ZYCIT279

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

Palavras Chave:

PREENCHER - LOTE - TABELA - /PWS/ZYCIT279 - RECEBIMENTO - DRAWBACK

/PWS/SAPMZYCI017

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

Objetos da nota:

REPS /PWS/MZYCI017F02

 

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

Modificações efetuadas em REPS /PWS/MZYCI017F02

 

...

                                      ebeln = itab_zycit003-ebeln

                                      ebelp = itab_zycit003-ebelp.

    v_meins = itab_itens_nf-meins.

    v_propor = itab_zycit079-qtd_drawback / itab_zycit003-qtd_iten.

    itab_zycit003-qtd_iten = itab_zycit079-qtd_drawback.

    itab_itens_nf-qtd_item = itab_itens_nf-qtd_item * v_propor.

    SELECT SINGLE msehi                                 "#EC CI_NOFIELD

             FROM /pws/zyglt204 INTO itab_zycit003-meins

             WHERE zum = itab_zycit078-zum.

    itab_itens_nf-meins = itab_zycit003-meins.

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

    READ TABLE itab_zycit223 WITH KEY

                              nrseqnf   = itab_itens_nf-nrseqnf

                              nrseq     = itab_itens_nf-nrseq

                              nfglobal  = itab_itens_nf-nfglobal

                              nfremessa = itab_itens_nf-nfremessa

                              ebeln     = itab_itens_nf-ebeln

                              ebelp     = itab_itens_nf-ebelp .

    IF sy-subrc NE 0.

      SELECT SINGLE charg FROM mseg

           INTO itab_zycit279-lote

             WHERE mblnr EQ /pws/zycie041-mblnr_mb01

               AND ebeln EQ itab_itens_nf-ebeln

               AND ebelp EQ itab_itens_nf-ebelp.

    ENDIF.

* << Fim da inclusão

    READ TABLE itab_zycit279 WITH KEY nrseq = itab_zycit003-nrseq

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

                                      lote  = itab_zycit279-lote

* << Fim da inclusão

                                      ebeln = itab_zycit003-ebeln

                                      ebelp = itab_zycit003-ebelp.

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

    IF sy-subrc = 0 AND /pws/zycit321-lote EQ space.

* << Fim da exclusão

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

    IF sy-subrc = 0.

* << Fim da inclusão

      itab_zycit279-slqtde =

                        itab_zycit279-slqtde + itab_itens_nf-qtd_item.

      IF itab_zycit279-slqtde > 0.

        itab_zycit279-esgotado = space.

      ENDIF.

      MODIFY itab_zycit279 INDEX sy-tabix.

    ELSE.

      CLEAR: v_cob_camb, itab_zycit279-cob_camb.

      SELECT SINGLE a~frpagto

        FROM ( /pws/zycit006 AS a INNER JOIN /pws/zycit263 AS b

...

 

...

                             WHERE nrseqd EQ itab_zycit245-nrseqd

                               AND nritem EQ itab_zycit245-nritem.

      ENDIF.

      PERFORM taxa_converte USING    /pws/zycit001-waers

                                     /pws/zycit085-dttax

                            CHANGING v_taxa.

      IF NOT itab_zycit003-qtd_iten IS INITIAL.

        itab_zycit279-valor = ( itab_zycit100-vlfob * v_taxa ) /

                  itab_zycit003-qtd_iten.

      ENDIF.

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

      IF /pws/zycit321-lote IS INITIAL.

        APPEND itab_zycit279.

      ELSE.

* << Fim da exclusão

        READ TABLE itab_zycit223 WITH KEY

                                  nrseqnf   = itab_itens_nf-nrseqnf

                                  nrseq     = itab_itens_nf-nrseq

                                  nfglobal  = itab_itens_nf-nfglobal

                                  nfremessa = itab_itens_nf-nfremessa

                                  ebeln     = itab_itens_nf-ebeln

                                  ebelp     = itab_itens_nf-ebelp .

        IF sy-subrc NE 0.

          READ TABLE itab_zycit279 WITH KEY nrseq = itab_zycit003-nrseq

                                            ebeln = itab_zycit003-ebeln

                                            ebelp = itab_zycit003-ebelp.

          IF sy-subrc = 0.

            itab_zycit279-slqtde =

                     itab_zycit279-slqtde + itab_itens_nf-qtd_item.

            IF itab_zycit279-slqtde > 0.

              itab_zycit279-esgotado = space.

            ENDIF.

            MODIFY itab_zycit279 INDEX sy-tabix.

          ENDIF.

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

          IF /pws/zycit321-lote EQ '1'.

* << Fim da exclusão

            SELECT SINGLE charg FROM mseg

                  INTO itab_zycit279-lote

                    WHERE mblnr EQ /pws/zycie041-mblnr_mb01

                      AND ebeln EQ itab_itens_nf-ebeln

                      AND ebelp EQ itab_itens_nf-ebelp.

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

          ENDIF.

* << Fim da exclusão

          APPEND itab_zycit279.

          CONTINUE.

        ENDIF.

        wa_zycit279 = itab_zycit279.

        LOOP AT itab_zycit223 WHERE

                              nrseqnf   EQ itab_itens_nf-nrseqnf

                          AND nrseq     EQ itab_itens_nf-nrseq

                          AND nfglobal  EQ itab_itens_nf-nfglobal

                          AND nfremessa EQ itab_itens_nf-nfremessa

                          AND ebeln     EQ itab_itens_nf-ebeln

                          AND ebelp     EQ itab_itens_nf-ebelp .

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

          IF /pws/zycit321-lote EQ '1'.

* << Fim da exclusão

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

        IF /pws/zycit321-lote NE '2'.

* << Fim da inclusão

            wa_zycit279-lote = itab_zycit223-lote.

          ELSE.

            wa_zycit279-lote = itab_zycit223-lote_forn.

          ENDIF.

          itab_itens_nf-meins = v_meins.

          READ TABLE itab_zycit279 WITH KEY nrseq = itab_zycit279-nrseq

                                            ebeln = itab_zycit279-ebeln

                                            ebelp = itab_zycit279-ebelp

                                            lote  = wa_zycit279-lote.

          IF sy-subrc EQ 0.

...

 

...

                                      ( itab_zycit223-qtde /

                                           itab_itens_nf-qtd_item ).

              itab_zycit279-baseicms   = itab_zycit279-baseicms *

                                      ( itab_zycit223-qtde /

                                           itab_itens_nf-qtd_item ).

            ENDIF.

            COLLECT itab_zycit279.

          ENDIF.

        ENDLOOP.

      ENDIF.

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

    ENDIF.

* << Fim da exclusão

  ENDLOOP.

  IF NOT itab_zycit279[] IS INITIAL.

    MODIFY /pws/zycit279 FROM TABLE itab_zycit279.

    PERFORM unlock_record.

  ENDIF.

ENDFORM.

...

 

...

  ENDIF.

  LOOP AT itab_itens_nf.

    READ TABLE itab_matuse WITH KEY ebeln = itab_itens_nf-ebeln

                                    ebelp = itab_itens_nf-ebelp.

    READ TABLE itab_zycit279 WITH KEY nrseq = itab_itens_nf-nrseq

                                      ebeln = itab_itens_nf-ebeln

                                      ebelp = itab_itens_nf-ebelp.

    IF sy-subrc = 0 .

      v_tabix1 = sy-tabix.

      v_propor = itab_zycit279-menge / itab_zycit279-qtd_iten.

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

      IF /pws/zycit321-lote EQ space OR

         itab_zycit279-lote IS INITIAL.

* << Fim da exclusão

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

      IF itab_zycit279-lote IS INITIAL OR

         itab_zycit223[] IS INITIAL.

        SELECT SINGLE charg FROM mseg

              INTO itab_zycit279-lote

                WHERE mblnr EQ /pws/zycie041-mblnr_mb01

                  AND ebeln EQ itab_itens_nf-ebeln

                  AND ebelp EQ itab_itens_nf-ebelp.

        READ TABLE itab_zycit279 WITH KEY nrseq = itab_itens_nf-nrseq

                                          ebeln = itab_itens_nf-ebeln

                                          ebelp = itab_itens_nf-ebelp

                                          lote  = itab_zycit279-lote.

* << Fim da inclusão

        itab_itens_nf-qtd_item = itab_itens_nf-qtd_item * v_propor.

        itab_itens_nf-meins = itab_zycit279-meins.

        itab_zycit279-slqtde =

                          itab_zycit279-slqtde - itab_itens_nf-qtd_item.

        IF itab_zycit279-slqtde < 0.

          itab_zycit279-slqtde = 0.

        ENDIF.

        IF itab_zycit279-slqtde = 0.

         READ TABLE itab_zycit376d WITH KEY ebeln = itab_itens_nf-ebeln

                                            ebelp = itab_itens_nf-ebelp.

...

 

...

        ENDIF.

        MODIFY itab_zycit279 INDEX v_tabix1.

      ELSE.

        LOOP AT itab_zycit223 WHERE

                              nrseqnf   EQ itab_itens_nf-nrseqnf

                          AND nrseq     EQ itab_itens_nf-nrseq

                          AND nfglobal  EQ itab_itens_nf-nfglobal

                          AND nfremessa EQ itab_itens_nf-nfremessa

                          AND ebeln     EQ itab_itens_nf-ebeln

                          AND ebelp     EQ itab_itens_nf-ebelp .

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

          IF /pws/zycit321-lote EQ '1'.

* << Fim da exclusão

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

          IF /pws/zycit321-lote NE '2'.

* << Fim da inclusão

          READ TABLE itab_zycit279 WITH KEY nrseq = itab_itens_nf-nrseq

                                            ebeln = itab_itens_nf-ebeln

                                            ebelp = itab_itens_nf-ebelp

                                             lote  = itab_zycit223-lote.

          ELSE.

          READ TABLE itab_zycit279 WITH KEY nrseq = itab_itens_nf-nrseq

                                            ebeln = itab_itens_nf-ebeln

                                            ebelp = itab_itens_nf-ebelp

                                        lote  = itab_zycit223-lote_forn.

          ENDIF.

          v_tabix = sy-tabix.

          itab_zycit279-qtd_iten = itab_zycit279-qtd_iten -

                                   itab_zycit223-qtde.

          itab_zycit223-qtde = itab_zycit223-qtde * v_propor.

          itab_zycit279-slqtde =

                    itab_zycit279-slqtde - itab_zycit223-qtde.

          IF itab_zycit279-slqtde < 0.

            itab_zycit279-slqtde = 0.

          ENDIF.

          IF itab_zycit279-slqtde = 0.

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

            IF /pws/zycit321-lote EQ '1'.

* << Fim da exclusão

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

            IF /pws/zycit321-lote NE '2'.

* << Fim da inclusão

            DELETE FROM /pws/zycit279 WHERE nrseq = itab_itens_nf-nrseq

                                        AND ebeln = itab_itens_nf-ebeln

                                        AND ebelp = itab_itens_nf-ebelp

                                         AND lote  = itab_zycit223-lote.

            DELETE  itab_zycit279     WHERE nrseq = itab_itens_nf-nrseq

                                        AND ebeln = itab_itens_nf-ebeln

                                        AND ebelp = itab_itens_nf-ebelp

                                         AND lote  = itab_zycit223-lote.

            ELSE.

            DELETE FROM /pws/zycit279 WHERE nrseq = itab_itens_nf-nrseq

...