on 05-21-2014 7:27 PM
Boa tarde.
Alguém saberia me informar se existe alguma maneira de verificar se uma nota fiscal já existe na base de dados quando criando notas pela J1B1N, ou seja, controle de duplicidade de notas ?
Grato.
Ulisses.
Oi Ulisses
Se você tiver o TDF existe uma chamada para que você possa aplicar diversas validações. Caso contrário o jeito é partir para uma field exit.
Veja o exemplo abaixo:
FUNCTION field_exit_j_1bseries.
ASSIGN ('(SAPMJ1B1)J_1BDYDOC-PARID') TO <parid>.
ASSIGN ('(SAPMJ1B1)J_1BDYDOC-NFTYPE') TO <nftype>.
ASSIGN ('(SAPLJ1BB2)J_1BDYDOC-NFNUM') TO <nfnum>.
ASSIGN ('(SAPLJ1BB2)J_1BDYDOC-NFENUM') TO <nfenum>.
IF NOT <nfnum> IS INITIAL.
SELECT * INTO j_1bnfdoc FROM j_1bnfdoc UP TO 1 ROWS
WHERE nfnum EQ <nfnum>
AND parid EQ <parid>
AND nftype EQ <nftype>
AND series EQ input
AND cancel NE c_x
AND direct EQ c_1.
ENDSELECT.
IF sy-subrc IS INITIAL.
MESSAGE e120.
ENDIF.
ENDIF.
IF NOT <nfenum> IS INITIAL.
SELECT * INTO j_1bnfdoc FROM j_1bnfdoc UP TO 1 ROWS
WHERE nfenum EQ <nfenum>
AND parid EQ <parid>
AND nftype EQ <nftype>
AND series EQ input
AND cancel NE c_x
AND direct EQ c_1.
ENDSELECT.
IF sy-subrc IS INITIAL.
MESSAGE e120.
ENDIF.
ENDIF.
ENDFUNCTION.
Abraço
Eduardo Chagas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Bom dia Ulisses,
Talvez um ABAP consiga lhe ajudar melhor com os detalhes da implementação.
Mas na Wiki existe um material informando sobre essas etapas que me foi útil, acredito que possa lhe ajudar > http://wiki.scn.sap.com/wiki/display/ABAP/Field+exits.
Atenciosamente,
Evandro Cortes.
User | Count |
---|---|
13 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.