09-12-2007 1:15 PM
*----
-
English
Hi all.
I've to create a subsequent debit document, for freight reasons.
Im executing the bapi_incominginovoice_create with these parameters:
*-----Header parameters:
C_X to wl_header-INVOICE_IND ,
C_RE to wl_header-DOC_TYPE ,
it_mm018-dtfrete to wl_header-DOC_DATE ,
p_data to wl_header-PSTNG_DATE ,
it_mm018-NUMFRETE to wl_header-REF_DOC_NO ,
it_rbkp-bukrs to wl_header-COMP_CODE ,
it_mm018-LIFNR_O to wl_header-DIFF_INV ,
C_BRL to wl_header-CURRENCY ,
C_1 to wl_header-EXCH_RATE ,
it_mm018-VALFRETE to wl_header-GROSS_AMOUNT ,
C_X to wl_header-CALC_TAX_IND ,
p_data to wl_header-BLINE_DATE ,
wl_dias to wl_header-DSCT_DAYS1 ,
it_mm018-nffrete to wl_header-HEADER_TXT ,
it_mm018-VALFRETE to wl_header-DEL_COSTS ,
C_1 to wl_header-TAX_EXCH_RATE.
and
*Item
wl_cont to wl_it_item-INVOICE_DOC_ITEM,
it_rseg-ebeln to wl_it_item-po_number ,
it_rseg-ebelp to wl_it_item-po_item ,
it_rseg-lfbnr to wl_it_item-ref_doc ,
it_rseg-lfgja to wl_it_item-ref_doc_year ,
it_rseg-lfpos to wl_it_item-ref_doc_it ,
C_S to wl_it_item-de_cre_ind .
it_mm019-ivafrete to wl_it_item-tax_code.
it_rseg-menge to wl_it_item-quantity ,
it_rseg-bstme to wl_it_item-po_unit ,
it_rseg-bprme to wl_it_item-po_unit_iso ,
it_rseg-bpmng to wl_it_item-po_pr_qnt .
And its working fine.
but if i insert :
C_F5 to wl_header-PLANNING_LEVEL,
C_C1 to wl_header-J_1BNFTYPE ,
to the header structure, the bapi do not execute properly and return an error:
External NF number/series is wrong wl_header-REF_DOC_NO
I tried some other thinks like delete the left zeros of this number wl_header-REF_DOC_NO and doing this, the bapi does not return an error but does not return the invoicedocnumber(the # of the created document), in other words, it does not work.
Can anyone help me to fix this error ???
thanks and regards
*----
-
Português
Oi pessoal,
Eu tenho que criar um documento de débito posterior por razões de frete.
Estou executando a BAPI_INCOMINGINVOICE_CREATE com os seguintes parâmetros:
*-----Parâmetros de cabeçalho:
C_X to wl_header-INVOICE_IND ,
C_RE to wl_header-DOC_TYPE ,
it_mm018-dtfrete to wl_header-DOC_DATE ,
p_data to wl_header-PSTNG_DATE ,
it_mm018-NUMFRETE to wl_header-REF_DOC_NO ,
it_rbkp-bukrs to wl_header-COMP_CODE ,
it_mm018-LIFNR_O to wl_header-DIFF_INV ,
C_BRL to wl_header-CURRENCY ,
C_1 to wl_header-EXCH_RATE ,
it_mm018-VALFRETE to wl_header-GROSS_AMOUNT ,
C_X to wl_header-CALC_TAX_IND ,
p_data to wl_header-BLINE_DATE ,
wl_dias to wl_header-DSCT_DAYS1 ,
it_mm018-nffrete to wl_header-HEADER_TXT ,
it_mm018-VALFRETE to wl_header-DEL_COSTS ,
C_1 to wl_header-TAX_EXCH_RATE.
e
*Parâmetros de Item
wl_cont to wl_it_item-INVOICE_DOC_ITEM,
it_rseg-ebeln to wl_it_item-po_number ,
it_rseg-ebelp to wl_it_item-po_item ,
it_rseg-lfbnr to wl_it_item-ref_doc ,
it_rseg-lfgja to wl_it_item-ref_doc_year ,
it_rseg-lfpos to wl_it_item-ref_doc_it ,
C_S to wl_it_item-de_cre_ind .
it_mm019-ivafrete to wl_it_item-tax_code.
it_rseg-menge to wl_it_item-quantity ,
it_rseg-bstme to wl_it_item-po_unit ,
it_rseg-bprme to wl_it_item-po_unit_iso ,
it_rseg-bpmng to wl_it_item-po_pr_qnt .
E esta funcionando muito bem.
Mas se eu insiro os seguintes parametros:
C_F5 to wl_header-PLANNING_LEVEL,
C_C1 to wl_header-J_1BNFTYPE ,
a estrutura do cabeçalho, a bapi não executa como deveria e retorna o seguinte erro:
Nº NF externo/série está incorreto wl_header-REF_DOC_NO
Eu tentei outras coisas como apagaros zeros da esquerda do campo wl_header-REF_DOC_NO e fazendo isso a bapi nao retona mais o erro, porém também nao retorna o número do documento criado, em outras palavras, não funiona.
Alguém poderia me ajudar a resolver este problema???
Grato
Leonardo Oliveira
09-18-2007 6:28 PM
09-20-2007 2:18 PM
I Solve this problem using the same code that can be found in the 1st message, and after each bapi I made a batch input at the J1b1n transaction to make the document apper at the fiscal book
thanks anyway