Application Development 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: 

BAPI

Former Member
0 Kudos

Hi,

I am executing BAPI_ACC_DOCUMENT_POST bapi successfully showing 'S' flag msg.

like this -> 'S RW 605 Document posted successfully: BKPFF DOCUMENT NUMBER DV1CLNT400'.

but not genrated Accounting Document Number. Why ?

NOTE : I used commit work also.

CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'

EXPORTING

documentheader = gd_documentheader

customercpd = gd_customercpd

contractheader = gd_fica_hd

IMPORTING

obj_type = l_type

obj_key = l_key

obj_sys = l_sys

TABLES

accountgl = it_accountgl

accountreceivable = it_accountreceivable

accountpayable = it_accountpayable

accounttax = it_accounttax

currencyamount = it_currencyamount

criteria = it_criteria

valuefield = it_valuefield

extension1 = it_extension

return = it_return

paymentcard = it_paymentcard

contractitem = it_fica_it.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = 'X'.

4 REPLIES 4

Former Member
0 Kudos
 CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
    EXPORTING
      documentheader    = docheader
    TABLES
      accountgl         = gltable
      accountreceivable = artable
      currencyamount    = aramounts
      return            = returntab.

  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
  REFRESH : docheader, docheader[], gltable, gltable[], artable,
           artable[], aramounts, aramounts[], returntab,returntab[].

Former Member
0 Kudos

Hi,

Check this , may be helpful

[;

Rhea.

Former Member
0 Kudos

You don't get the number in return. You have to search for it after commit.

Try BAPI_ACC_DOCUMENTS_RECORD with

obj_type = l_type

obj_key = l_key

obj_sys = l_sys

in EXTERNAL_DOCUMENTS.

Then loop ACCOUNTING_DOCUMENTS, rec_key should contain account document number.

Regards,

Allan Finden

Former Member
0 Kudos

Check the SY structure in debugging mode....after the COMMIT