Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BAPI_ACC_DOCUMENT_POST down payment problem

Former Member
0 Likes
955

Hi,

I want to post down payment (as in transaction F-47) using BAPI_ACC_DOCUMENT_POST.

Everything seems to be ok. Return message is "Document posted successfully: BKPFF 003600005910002008 TEDCLNT110",

but when i check in table BKPF, nothing is created.

BAPI_TRANSACTION_COMMIT does not change anything.

I will be grateful for any input.

Regards,

Lukas

Here is my code:


  DATA:
    l_documentheader  TYPE bapiache09,
    lt_accountpayable TYPE TABLE OF bapiacap09,
    l_accountpayable  TYPE bapiacap09,
    lt_currencyamount TYPE TABLE OF bapiaccr09,
    l_currencyamount  TYPE bapiaccr09.
 
* Header
  l_documentheader-username   = sy-uname.
  l_documentheader-header_txt = 'test'.
  l_documentheader-comp_code  = '1000'.
  l_documentheader-doc_date   = sy-datum.
  l_documentheader-pstng_date = sy-datum.
  l_documentheader-fis_period = '06'.
  l_documentheader-fisc_year  = '2008'.
  l_documentheader-doc_type   = 'KA'.
  l_documentheader-ref_doc_no = '4500000029'.
 
* Item
  l_accountpayable-itemno_acc = '1'.
  l_accountpayable-vendor_no  = '0007000008'.
  l_accountpayable-comp_code  = '1000'.
  l_accountpayable-sp_gl_ind  = 'A'.
  l_accountpayable-pymt_cur   = 'USD'.
  l_accountpayable-pymt_amt   = '100'.
  APPEND l_accountpayable TO lt_accountpayable.
 
  l_currencyamount-itemno_acc = '1'.
  l_currencyamount-curr_type  = '00'.
  l_currencyamount-currency   = 'EUR'.
  l_currencyamount-amt_base   = '300.00'.
  APPEND l_currencyamount TO lt_currencyamount.
 
  CALL FUNCTION 'BAPI_ACC_DOCUMENT_CHECK'
    EXPORTING
      documentheader = l_documentheader
    TABLES
      accountpayable = lt_accountpayable
      currencyamount = lt_currencyamount
      return         = return.
 
  CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
    EXPORTING
      documentheader = l_documentheader
    TABLES
      accountpayable = lt_accountpayable
      currencyamount = lt_currencyamount
      return         = return.
 
  CLEAR commit_ret.
 
  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
      wait   = 'X'
    IMPORTING
      return = commit_ret.

4 REPLIES 4
Read only

Former Member
0 Likes
594

Hi,

Just wait for a moment(10 to 15 mins) since you have given WAIT in BAPI_TRANSACTION_COMMIT.

Check again, and hope it updates the values.

or else, Just give BAPI_TRANSACTION_COMMIT after the BAPI with no parameters.

Regards,

Anbalagan

Read only

0 Likes
594

I have tried this. Still no result.

Can I check somehow if an update to table is done ?

Read only

Former Member
0 Likes
594

Hi,

Use an Internal table for Document header by appending the values and pass it to BAPI.

Try it.

Regards,

Anbalagan

Read only

0 Likes
594

Do you mean table insead of structure l_documentheader ?

Canu2019t do that, import parameter is structure, not table.