Skip to Content
avatar image
Former Member

BAPI_ACC_DOCUMENT_POST in down payment

Hi!

When i create a Purchase order i have to make an automatic down payment request (F-47), i'm working with an user exit that calls the BAPI_ACC_DOCUMENT_POST bapi from the PO transaction. Anybody have a code example on how to use this bapi with this scenario?. I made a local program to test the bapi with this call:

CALL FUNCTION 'BAPI_ACC_DOCUMENT_CHECK'

EXPORTING

DOCUMENTHEADER = WA_DOCHEAD

  • CUSTOMERCPD =

  • CONTRACTHEADER =

TABLES

  • ACCOUNTGL =

  • ACCOUNTRECEIVABLE =

ACCOUNTPAYABLE = IT_VENDOR

  • ACCOUNTTAX =

CURRENCYAMOUNT = IT_CURRENCY

  • CRITERIA =

  • VALUEFIELD =

  • EXTENSION1 =

RETURN = IT_RETURN

  • PAYMENTCARD =

  • CONTRACTITEM =

  • EXTENSION2 =

  • REALESTATE =

.

The IT_RETURN itab from BAPI_ACC_DOCUMENT_CHECK returns "Document check - no errors" .

the IT_RETURN itab from BAPI_ACC_DOCUMENT_POST returns

"Document posted successfully"

But no document had been posted! i look at the BKPF itab and nothing was created.

Please help.

Thanks in advance.

John.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

7 Answers

  • Best Answer
    avatar image
    Former Member
    May 05, 2005 at 09:18 PM

    Need to commit your work in the test program. May not need to do it in the user exit if it is called before PO save.

    Use BAPI_TRANSACTION_COMMIT to commit your work, there is a WAIT (set it to 'X') parameter if you want the commit to be synchronous.

    Rishi

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 09, 2005 at 05:52 PM

    Posting a FI document using the structure BAPIACAP09 for payment data you will need two different currencies, in this case you use 'USD' as the document currency and 'VEB' as payment currency. Then when you gonna make the automatic payment you will have more problems. This is a document with two different currencies.

    How to solve this problem?

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 11, 2006 at 01:13 AM

    Hi,

    I've found your post during searching solution of the same problem with yours - using bapi for f-47.

    I wonder you have finished your work.

    It will be very helpful if you post your working code and some instructions.

    Best regards,

    Lee

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 11, 2006 at 09:45 AM

    Hello, I call to the function and it gives back a message to me saying that this all correct one, but does not record I

    I use the function BAPI_ACC_DOCUMENT_POST and BAPI_TRANSACTION_COMMIT

    I pass to the function the following values to him:

    From these tables BKPF and BSEG position the tables that the function uses

        MOVE sy-uname           TO wa_bkpf-usnam.
        MOVE t_bkpf-bktxt       TO wa_bkpf-bktxt.
        MOVE t_bkpf-bukrs       TO wa_bkpf-bukrs.
    * Convertir fecha a interno
        CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
             EXPORTING
                  date_external = t_bkpf-bldat
             IMPORTING
                  date_internal = wa_bkpf-bldat.
    * Convertir fecha a interno
        CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
             EXPORTING
                  date_external = t_bkpf-budat
             IMPORTING
                  date_internal = wa_bkpf-budat.
        MOVE wa_bkpf-budat+0(4) TO wa_bkpf-gjahr.
        MOVE t_bkpf-blart       TO wa_bkpf-blart.
        MOVE t_bkpf-xblnr       TO wa_bkpf-xblnr.
        MOVE 'RFBU'             TO wa_bkpf-glvor.
        MOVE t_bkpf-waers       TO wa_bkpf-waers.
        MOVE 'BKPF'             TO wa_bkpf-awtyp.
        MOVE wa_bkpf-budat+4(2) TO wa_bkpf-monat.
        MOVE sy-mandt           TO wa_bkpf-mandt.

        MOVE t_bkpf-bukrs       TO t_bseg_aux-bukrs.
        MOVE t_bseg-bschl       TO t_bseg_aux-bschl.
        MOVE t_bseg-hkont       TO t_bseg_aux-hkont.
    * Convertir fecha a interno
        CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
            EXPORTING
                 date_external = t_bseg-valut
            IMPORTING
                 date_internal = t_bseg-valut.
        MOVE t_bseg-zuonr       TO t_bseg_aux-zuonr.
        MOVE 'Finanzas'         TO t_bseg_aux-kontl.
        MOVE t_bseg-dmbtr       TO t_bseg_aux-dmbtr.
        MOVE t_bseg-prctr       TO t_bseg_aux-prctr.
        MOVE t_bseg-projk       TO t_bseg_aux-projk.
        MOVE t_bseg-vbund       TO t_bseg_aux-vbund.
        MOVE t_bseg-sgtxt       TO t_bseg_aux-sgtxt.
        MOVE 'S'                TO t_bseg_aux-koart.

    Message was edited by: David MG

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 06, 2007 at 09:23 AM

    Even i am trying to use the same bapi but its giving me error that 1. Error in document BKPF $ devclnt300

    Add comment
    10|10000 characters needed characters exceeded

    • Hi,

      Does anybody of you are succeeded in posting downpayment requests(F-47) through BAPI_ACC_DOCUMENT_POST?

      If so pls guid me how can we achieve this.

      Regards,

      Nanda.

  • avatar image
    Former Member
    Jan 08, 2009 at 03:05 PM

    Hi everyone!

    Has anybody managed to do F-47 with BAPI_ACC_DOCUMENT_POST?

    What is the story with two currencies? Im getting the error that tells me to use 2 different amounts (different currencies).

    If anyone has managed to solve that, I would really appreciate your solution!

    Thanks in advance,

    MaryM

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 07, 2012 at 06:07 AM

    Am having the same requirement.

    When PO is created, it should trigger automatic Down payment request.

    Am using BAPI_PAYMENTREQUEST_CREATE.

    What the validation and logic i have to do for this requirement.

    Please share ur ideas...

    Add comment
    10|10000 characters needed characters exceeded